Regression: crash and assert hit in curve sculpt mode after undo #108923

Closed
opened 2023-06-13 06:45:11 +02:00 by Pratik Borhade · 6 comments
Member

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 532.03

Blender Version
Broken: 4.0, 31145ffce538cd0c73a88709ced00415f65075ed
Worked: 3.6 beta.

Git bisect points to: ebb5643e59

Short description of error
Crash and assert hit at BLI_assert(id->us >= 0); on Undo operation in curve sculpt mode.

Exact steps for others to reproduce the error

  1. Open default scene.
  2. Add Empty hair object on default cube.
  3. Switch to sculpt mode.
  4. Undo.
  5. Repeat last two steps if crash does not happen after first attempt
**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 532.03 **Blender Version** Broken: 4.0, `31145ffce538cd0c73a88709ced00415f65075ed` Worked: 3.6 beta. Git bisect points to: ebb5643e598a17b2f21b4e50acac35afe82dbd55 **Short description of error** Crash and assert hit at `BLI_assert(id->us >= 0);` on Undo operation in curve sculpt mode. **Exact steps for others to reproduce the error** 1. Open default scene. 2. Add `Empty hair` object on default cube. 3. Switch to sculpt mode. 4. Undo. 5. Repeat last two steps if crash does not happen after first attempt
Pratik Borhade added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2023-06-13 06:45:12 +02:00

I can not reproduce that in last debug build

I can not reproduce that in last debug build
Author
Member

@mod_moder , can still confirm in current master (I'll check which commit broke this).
Repeat last two steps if crash does not happen on first try.

@mod_moder , can still confirm in current master (I'll check which commit broke this). Repeat last two steps if crash does not happen on first try.
Author
Member

Git bisect points to: ebb5643e59

Git bisect points to: ebb5643e598a17b2f21b4e50acac35afe82dbd55
Iliya Katushenock removed the
Interest
Geometry Nodes
Interest
Nodes & Physics
labels 2023-06-14 14:21:08 +02:00

I can confirm the crash with a release build of Windows and with an ASAN build on Linux though they're a bit different:

Windows

ExceptionCode         : EXCEPTION_ACCESS_VIOLATION

BKE_lib_override_library_is_system_defined C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\lib_override.cc:343
rna_property_editable_do C:\Users\jesse\source\blender-git\blender\source\blender\makesrna\intern\rna_access.cc:2001
ui_def_but_rna C:\Users\jesse\source\blender-git\blender\source\blender\editors\interface\interface.cc:4745
uiDefIconButR_prop C:\Users\jesse\source\blender-git\blender\source\blender\editors\interface\interface.cc:5633
uiDefAutoButR C:\Users\jesse\source\blender-git\blender\source\blender\editors\interface\interface_utils.cc:70
uiItemFullR C:\Users\jesse\source\blender-git\blender\source\blender\editors\interface\interface_layout.cc:2444
rna_uiItemR C:\Users\jesse\source\blender-git\blender\source\blender\makesrna\intern\rna_ui_api.c:124

Linux

==24308==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d0049322f4 at pc 0x000000d9bc2e bp 0x7ffe16abe750 sp 0x7ffe16abe740
READ of size 4 at 0x61d0049322f4 thread T0
    #0 0xd9bc2d in id_us_plus_no_lib /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_id.c:302
    #1 0xda9230 in id_refcount_recompute_callback /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_id.c:1653
    #2 0xe11afe in BKE_lib_query_foreachid_process /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_query.c:88
    #3 0x161c8e2 in scene_foreach_paint /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/scene.cc:564
    #4 0x161f7f2 in scene_foreach_toolsettings /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/scene.cc:762
    #5 0x162152f in scene_foreach_id /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/scene.cc:906
    #6 0xe1412c in library_foreach_ID_link /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_query.c:345
    #7 0xe142fa in BKE_library_foreach_ID_link /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_query.c:364
    #8 0xda9d09 in BKE_main_id_refcount_recompute /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_id.c:1685
    #9 0x8ed351 in setup_app_data /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/blendfile.cc:942
I can confirm the crash with a release build of Windows and with an ASAN build on Linux though they're a bit different: Windows ``` ExceptionCode : EXCEPTION_ACCESS_VIOLATION BKE_lib_override_library_is_system_defined C:\Users\jesse\source\blender-git\blender\source\blender\blenkernel\intern\lib_override.cc:343 rna_property_editable_do C:\Users\jesse\source\blender-git\blender\source\blender\makesrna\intern\rna_access.cc:2001 ui_def_but_rna C:\Users\jesse\source\blender-git\blender\source\blender\editors\interface\interface.cc:4745 uiDefIconButR_prop C:\Users\jesse\source\blender-git\blender\source\blender\editors\interface\interface.cc:5633 uiDefAutoButR C:\Users\jesse\source\blender-git\blender\source\blender\editors\interface\interface_utils.cc:70 uiItemFullR C:\Users\jesse\source\blender-git\blender\source\blender\editors\interface\interface_layout.cc:2444 rna_uiItemR C:\Users\jesse\source\blender-git\blender\source\blender\makesrna\intern\rna_ui_api.c:124 ``` Linux ``` ==24308==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d0049322f4 at pc 0x000000d9bc2e bp 0x7ffe16abe750 sp 0x7ffe16abe740 READ of size 4 at 0x61d0049322f4 thread T0 #0 0xd9bc2d in id_us_plus_no_lib /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_id.c:302 #1 0xda9230 in id_refcount_recompute_callback /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_id.c:1653 #2 0xe11afe in BKE_lib_query_foreachid_process /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_query.c:88 #3 0x161c8e2 in scene_foreach_paint /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/scene.cc:564 #4 0x161f7f2 in scene_foreach_toolsettings /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/scene.cc:762 #5 0x162152f in scene_foreach_id /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/scene.cc:906 #6 0xe1412c in library_foreach_ID_link /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_query.c:345 #7 0xe142fa in BKE_library_foreach_ID_link /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_query.c:364 #8 0xda9d09 in BKE_main_id_refcount_recompute /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/lib_id.c:1685 #9 0x8ed351 in setup_app_data /home/deadpin/source/blender-git/blender/source/blender/blenkernel/intern/blendfile.cc:942 ```
Jesse Yurkovich added
Module
Core
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-06-14 21:16:51 +02:00
Author
Member

Git bisect points to: ebb5643e59

cc @mont29

> Git bisect points to: ebb5643e598a17b2f21b4e50acac35afe82dbd55 cc @mont29
Pratik Borhade added
Priority
High
and removed
Priority
Normal
labels 2023-06-15 04:41:51 +02:00
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2023-06-16 13:54:00 +02:00
Julian Eisel changed title from Regression: crash and asset hit in curve sculpt mode after undo to Regression: crash and assert hit in curve sculpt mode after undo 2023-06-19 11:37:43 +02:00

This issue is actually a set of bugs in the scene_undo_preserve codepath (which attempts to preserve toolsettings accross undos, and therefore has to shuffle around ID pointers). the current design simply cannot work, it happened to 'not crash' before ebb5643e59 because of the extra complete recheck of pointers that used to happen at the end of the setup_app_data process, which was hiding the issues.

The whole handling of undo_preserve when dealing with data with some ID pointers needs to be re-thought here, the problem is actually very similar to the handling of the new 'no undo' IDs introduced in ebb5643e59, so hopefully similar (or even shared) code can be used.

This issue is actually a set of bugs in the `scene_undo_preserve` codepath (which attempts to preserve toolsettings accross undos, and therefore has to shuffle around ID pointers). the current design simply cannot work, it happened to 'not crash' before ebb5643e59 because of the extra complete recheck of pointers that used to happen at the end of the `setup_app_data` process, which was hiding the issues. The whole handling of `undo_preserve` when dealing with data with some ID pointers needs to be re-thought here, the problem is actually very similar to the handling of the new 'no undo' IDs introduced in ebb5643e59, so hopefully similar (or even shared) code can be used.
Bastien Montagne added
Priority
Normal
and removed
Priority
High
labels 2023-06-20 19:33:45 +02:00
Bastien Montagne self-assigned this 2023-06-20 19:33:52 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-06-21 15:38:31 +02:00
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
4 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#108923
No description provided.