Crash when changing UV selection modes after pinning UVs in a second UVMap while viewport shading is in solid mode and Color Type is Texture #73044

Closed
opened 2020-01-11 14:28:27 +01:00 by Juha · 14 comments

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 419.67

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42
Also broken on: 2.82 Beta (2020-01-10 15:30) and 2.83 Alpha (2020-01-10 17:32)
Worked: 2.80 release

Short description of error
While having the viewport shading in solid mode and color type is set to Texture, working on other than the first UVMap in the list, pinning vertices and changing selection modes cause visual artifacts and crashes.

Exact steps for others to reproduce the error
(Based on the default startup file)

  1. Start Blender with the default scene
  2. Go to UV Editing workspace
  3. Add second UV Map to the default cube and select all faces so that they show up in UV editor
  4. In viewport shading (while in solid mode) select Texture as Color Type
  5. In UV window go to edge mode and select an edge (potential crash)
  6. Pin the vertices
  7. Change to vertex mode in UV window (most probable crash, if not at least visual artifacts)
  8. Keep changing modes and pinning until crash occurs

Reproducible on two different Windows 10 computers.
(The other one has GTX 1080 and latest nvidia Studio Driver 441.66)
Also tested on latest Game Ready drivers 441.87 and the issue is still there.

Screenshot of the artifacts on the edge drawing when changing to vertex mode (if crash does not occur):
Blender_UV_Bug.PNG
If the mesh is more dense the artifacts are more severe and might go wildly all over the place:
Blender_UV_Bug3.png

**System Information** Operating system: Windows-10-10.0.18362 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 419.67 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: `26bd5ebd42` Also broken on: 2.82 Beta (2020-01-10 15:30) and 2.83 Alpha (2020-01-10 17:32) Worked: 2.80 release **Short description of error** While having the viewport shading in solid mode and color type is set to Texture, working on other than the first UVMap in the list, pinning vertices and changing selection modes cause visual artifacts and crashes. **Exact steps for others to reproduce the error** (Based on the default startup file) 1. Start Blender with the default scene 2. Go to UV Editing workspace 3. Add second UV Map to the default cube and select all faces so that they show up in UV editor 4. In viewport shading (while in solid mode) select Texture as Color Type 5. In UV window go to edge mode and select an edge (potential crash) 6. Pin the vertices 7. Change to vertex mode in UV window (most probable crash, if not at least visual artifacts) 8. Keep changing modes and pinning until crash occurs Reproducible on two different Windows 10 computers. (The other one has GTX 1080 and latest nvidia Studio Driver 441.66) Also tested on latest Game Ready drivers 441.87 and the issue is still there. Screenshot of the artifacts on the edge drawing when changing to vertex mode (if crash does not occur): ![Blender_UV_Bug.PNG](https://archive.blender.org/developer/F8269831/Blender_UV_Bug.PNG) If the mesh is more dense the artifacts are more severe and might go wildly all over the place: ![Blender_UV_Bug3.png](https://archive.blender.org/developer/F8271972/Blender_UV_Bug3.png)
Author

Added subscriber: @zubasa85

Added subscriber: @zubasa85
Author

Started Blender from the command prompt and got this on the crash:

Error : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFB93E61CE0
Module : C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_d223212c0a2275b5\nvoglv64.dll

Does this indicate that the issue is in the Nvidia drivers?

Also when using blender_debug_gpu.cmd and blender_debug_gpu_glitchworkaround.cmd I get the visual errors but cannot get the Blender to crash.

Started Blender from the command prompt and got this on the crash: Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FFB93E61CE0 Module : C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_d223212c0a2275b5\nvoglv64.dll Does this indicate that the issue is in the Nvidia drivers? Also when using blender_debug_gpu.cmd and blender_debug_gpu_glitchworkaround.cmd I get the visual errors but cannot get the Blender to crash.

Added subscriber: @Jarwa

Added subscriber: @Jarwa

Managed to reproduce this as well on RTX 2070 (studio driver 441.28)
Got some less severe artifacts: edges disappeared and minor edge mess (compared to ones in the images)
and eventually crash when switching from edge mode to vertex mode in UV editor.

Blender 2.83 alpha (from January 12th 2020)
Windows 10

Managed to reproduce this as well on RTX 2070 (studio driver 441.28) Got some less severe artifacts: edges disappeared and minor edge mess (compared to ones in the images) and eventually crash when switching from edge mode to vertex mode in UV editor. Blender 2.83 alpha (from January 12th 2020) Windows 10

Added subscriber: @iss

Added subscriber: @iss

No crash on Radeon RX 550, win 10.

No crash on Radeon RX 550, win 10.

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Clément Foucault was assigned by Campbell Barton 2020-01-13 09:10:57 +01:00

The issue happens on step five In UV window go to edge mode,

The issue is caused by the UV coords being freed, with other UV buffers being kept.

Attached a file to redo the error.

This is a rough fix for the issue:

diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index abff8911697..fa73081f460 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1115,6 +1115,8 @@ void DRW_mesh_batch_cache_create_requested(
                             MBC_EDIT_TRIANGLES | MBC_EDIT_LNOR | MBC_EDIT_SELECTION_FACES);
   }
 
+  bool cd_uv_update = false;
+
   if (batch_requested &
       (MBC_SURFACE | MBC_SURF_PER_MAT | MBC_WIRE_LOOPS_UVS | MBC_EDITUV_FACES_STRETCH_AREA |
        MBC_EDITUV_FACES_STRETCH_ANGLE | MBC_EDITUV_FACES | MBC_EDITUV_EDGES | MBC_EDITUV_VERTS)) {
@@ -1138,6 +1140,7 @@ void DRW_mesh_batch_cache_create_requested(
       {
         if ((cache->cd_used.uv & cache->cd_needed.uv) != cache->cd_needed.uv) {
           GPU_VERTBUF_DISCARD_SAFE(mbuffercache->vbo.uv);
+          cd_uv_update = true;
         }
         if ((cache->cd_used.tan & cache->cd_needed.tan) != cache->cd_needed.tan ||
             cache->cd_used.tan_orco != cache->cd_needed.tan_orco) {
@@ -1179,7 +1182,7 @@ void DRW_mesh_batch_cache_create_requested(
     /* Discard UV batches if sync_selection changes */
     if (ts != NULL) {
       const bool is_uvsyncsel = (ts->uv_flag & UV_SYNC_SELECTION);
-      if (cache->is_uvsyncsel != is_uvsyncsel) {
+      if (cache->is_uvsyncsel != is_uvsyncsel || cd_uv_update) {
         cache->is_uvsyncsel = is_uvsyncsel;
         FOREACH_MESH_BUFFER_CACHE(cache, mbuffercache)
         {
The issue happens on step five `In UV window go to edge mode`, The issue is caused by the UV coords being freed, with other UV buffers being kept. Attached a file to redo the error. - Select edge UV selection mode crashes here (or it may crash on loading the file): [T73044_redo.blend](https://archive.blender.org/developer/F8275264/T73044_redo.blend) - Resulting ASAN output: [T73044_redo.txt](https://archive.blender.org/developer/F8275271/T73044_redo.txt) This is a rough fix for the issue: ``` diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index abff8911697..fa73081f460 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -1115,6 +1115,8 @@ void DRW_mesh_batch_cache_create_requested( MBC_EDIT_TRIANGLES | MBC_EDIT_LNOR | MBC_EDIT_SELECTION_FACES); } + bool cd_uv_update = false; + if (batch_requested & (MBC_SURFACE | MBC_SURF_PER_MAT | MBC_WIRE_LOOPS_UVS | MBC_EDITUV_FACES_STRETCH_AREA | MBC_EDITUV_FACES_STRETCH_ANGLE | MBC_EDITUV_FACES | MBC_EDITUV_EDGES | MBC_EDITUV_VERTS)) { @@ -1138,6 +1140,7 @@ void DRW_mesh_batch_cache_create_requested( { if ((cache->cd_used.uv & cache->cd_needed.uv) != cache->cd_needed.uv) { GPU_VERTBUF_DISCARD_SAFE(mbuffercache->vbo.uv); + cd_uv_update = true; } if ((cache->cd_used.tan & cache->cd_needed.tan) != cache->cd_needed.tan || cache->cd_used.tan_orco != cache->cd_needed.tan_orco) { @@ -1179,7 +1182,7 @@ void DRW_mesh_batch_cache_create_requested( /* Discard UV batches if sync_selection changes */ if (ts != NULL) { const bool is_uvsyncsel = (ts->uv_flag & UV_SYNC_SELECTION); - if (cache->is_uvsyncsel != is_uvsyncsel) { + if (cache->is_uvsyncsel != is_uvsyncsel || cd_uv_update) { cache->is_uvsyncsel = is_uvsyncsel; FOREACH_MESH_BUFFER_CACHE(cache, mbuffercache) { ```

This issue was referenced by 2359979141

This issue was referenced by 2359979141862cdffa8072f7dd8fc1e67ee228cf

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Author

Still the same artifacts and crashing on:
Blender 2.82 Beta 2020-01-15 21:07
Blender 2.83 Alpha 2020-01-15 17:08

Still the same artifacts and crashing on: Blender 2.82 Beta 2020-01-15 21:07 Blender 2.83 Alpha 2020-01-15 17:08

Changed status from 'Resolved' to: 'Confirmed'

Changed status from 'Resolved' to: 'Confirmed'
Author

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Juha closed this issue 2020-01-28 19:01:57 +01:00
Author

Bug seems to be fixed in current versions:
Blender 2.82 Beta 2020-01-27 18:52
Blender 2.83 Alpha 2020-01-27 21:31

Bug seems to be fixed in current versions: Blender 2.82 Beta 2020-01-27 18:52 Blender 2.83 Alpha 2020-01-27 21:31
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#73044
No description provided.