Sculpting with multiresolution modifier in 4.1 crashes #120187

Closed
opened 2024-04-02 21:17:07 +02:00 by Mike-Roberts-2 · 17 comments

System Information
Operating system: Windows 11
Graphics card: Nvidia RTX 3060 with latest drivers

Blender Version
Broken: Blender 4.1
Worked: Blender 4

Whenever I try to sculpt with multiresolution modifier on an object at about 8 million polygons or above in 4.1 it crashes every time. Still works just fine in Blender 4.

Step 1: Add multiresolution modifier to object.
Step 2: Subdivide several times so you get to around 8 million or so polygons.
Step 3: Sculpt for about 30 seconds to a minute and it will crash.

Tried it on a second computer with Windows 10 and Nvidia RTX 3050 and had same issue in 4.1

**System Information** Operating system: Windows 11 Graphics card: Nvidia RTX 3060 with latest drivers **Blender Version** Broken: Blender 4.1 Worked: Blender 4 Whenever I try to sculpt with multiresolution modifier on an object at about 8 million polygons or above in 4.1 it crashes every time. Still works just fine in Blender 4. Step 1: Add multiresolution modifier to object. Step 2: Subdivide several times so you get to around 8 million or so polygons. Step 3: Sculpt for about 30 seconds to a minute and it will crash. Tried it on a second computer with Windows 10 and Nvidia RTX 3050 and had same issue in 4.1
Mike-Roberts-2 added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2024-04-02 21:17:08 +02:00

Can you check the latest official release, or the latest daily build?

Please try the latest daily build: https://builder.blender.org/download/

I was able to confirm some crashes in development versions of 4.1, but not in the last one.

Which object would be best to replicate the issue? (Cube, Monkey...)

How many subdivisions did you test? (6, 7)

Can you check the latest official release, or the latest daily build? Please try the latest daily build: https://builder.blender.org/download/ I was able to confirm some crashes in development versions of 4.1, but not in the last one. Which object would be best to replicate the issue? (Cube, Monkey...) How many subdivisions did you test? (6, 7)
Germano Cavalcante added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2024-04-02 22:31:45 +02:00
Author

Tried today's latest build and still does it when I get to level 6. Tried it on sphere and multiple custom models on two different computers. If I go back to blender 4 I don't have the problem and everything works great.

Tried today's latest build and still does it when I get to level 6. Tried it on sphere and multiple custom models on two different computers. If I go back to blender 4 I don't have the problem and everything works great.
Germano Cavalcante added
Status
Needs Triage
and removed
Status
Needs Information from User
labels 2024-04-03 00:04:25 +02:00
Member

Hi @Mike-Roberts-2 Any chance you could get us the crash log?

On my machine (debug build) simply by subdividing the multires level to 6 will cause a crash in sculpt mode. For me it crashed in create_index_grids where args.grid_indices has a _size of 0. Not sure if that's the exact problem you are having

Hi @Mike-Roberts-2 Any chance you could get us the [crash log](https://docs.blender.org/manual/en/latest/troubleshooting/crash.html#windows)? On my machine (debug build) simply by subdividing the multires level to 6 will cause a crash in sculpt mode. For me it crashed in `create_index_grids` where `args.grid_indices` has a `_size` of 0. Not sure if that's the exact problem you are having
Member

Will mark this as Confirmed, Looks to me that at least 40a5e739e2 is running correctly.

Will bisect. Apparently I can't reproduce now on latest 8252208955 ... Could you guys try latest build and see again?

Will mark this as Confirmed, Looks to me that at least 40a5e739e270 is running correctly. ~~Will bisect.~~ Apparently I can't reproduce now on latest 82522089550c67be1abf ... Could you guys try latest build and see again?
YimingWu added
Priority
Normal
Status
Needs Information from User
and removed
Priority
High
Status
Confirmed
labels 2024-04-03 08:52:01 +02:00
Member

Just noting something similar has been reported in #120080

@ChengduLittleA : can you repro tat as well?

Just noting something similar has been reported in #120080 @ChengduLittleA : can you repro tat as well?
Member

@lichtwerk Nope in latest main I can't make sculpt+multires it to really crash even at ~8 million polys. Are you able to reproduce?

@lichtwerk Nope in latest main I can't make sculpt+multires it to really crash even at ~8 million polys. Are you able to reproduce?
Member

@lichtwerk Nope in latest main I can't make sculpt+multires it to really crash even at ~8 million polys. Are you able to reproduce?

#120080 (comment)

> @lichtwerk Nope in latest main I can't make sculpt+multires it to really crash even at ~8 million polys. Are you able to reproduce? https://projects.blender.org/blender/blender/issues/120080#issuecomment-1158692
Member

Still unable to crash it in windows using 4.1 or 4.2... Tried extensive sculpting and also the randomize option. 🤔

Here's the system info I have on windows:

Still unable to crash it in windows using 4.1 or 4.2... Tried extensive sculpting and also the randomize option. 🤔 Here's the system info I have on windows:

After absentmindedly sculpting a sphere with multiresolution subdivided 6 times for a few minutes, I witnessed the crash in Blender 4.1

I tried to replicate with a 4.1 debug build, but as soon as I entered sculpt mode with the sphere, I came across 5 asserts launched simultaneously:

BLI_assert failed: D:\BlenderDev\blender\source\blender\blenlib\BLI_span.hh:318, first(), at 'size_ > 0'

(Reminds me of #120179 which was recently fixed... cc. @HooglyBoogly ).

So I tested it with a debug build of main (assert resolved) and after 6 minutes of sculpting I had the crash:
image

Visual Studio ended up crashing too, so I couldn't copy the call stack, but I remember it was something in sculpt's UNDO system.

It appears to be a problem where Blender runs out of memory.

It seems like something really difficult to bisect...

After absentmindedly sculpting a sphere with multiresolution subdivided 6 times for a few minutes, I witnessed the crash in Blender 4.1 I tried to replicate with a 4.1 debug build, but as soon as I entered sculpt mode with the sphere, I came across 5 asserts launched simultaneously: ``` BLI_assert failed: D:\BlenderDev\blender\source\blender\blenlib\BLI_span.hh:318, first(), at 'size_ > 0' ``` (Reminds me of #120179 which was recently fixed... cc. @HooglyBoogly ). So I tested it with a debug build of main (assert resolved) and after 6 minutes of sculpting I had the crash: ![image](/attachments/3b821dbd-580d-4a1b-978d-215a3480c2d0) Visual Studio ended up crashing too, so I couldn't copy the call stack, but I remember it was something in sculpt's UNDO system. It appears to be a problem where Blender runs out of memory. It seems like something really difficult to bisect...

While bisecting, I was able to identify a pattern.
In bad commits, performance is greatly affected.
So, it was easy to identify which commits were bad and which were good, just checking the lag.

The commit causing the issue is 4b427e1b57
@HooglyBoogly ^

This is the call_stack:

>	blender.exe!blender::ed::sculpt_paint::undo::store_coords(Object * ob, blender::ed::sculpt_paint::undo::Node * unode) Line 1297	C++
 	blender.exe!tbb::interface7::internal::delegated_function<`blender::ed::sculpt_paint::undo::push_node'::`2'::<lambda_1> const ,void>::operator()() Line 97	C++
 	[External Code]	
 	blender.exe!tbb::interface7::internal::isolate_impl<void,`blender::ed::sculpt_paint::undo::push_node'::`2'::<lambda_1> const>(const blender::ed::sculpt_paint::undo::push_node::__l2::<lambda_1> & f) Line 216	C++
 	blender.exe!blender::ed::sculpt_paint::undo::push_node(Object * ob, PBVHNode * node, blender::ed::sculpt_paint::undo::Type type) Line 1524	C++
 	blender.exe!do_brush_action_task(Object * ob, const Brush * brush, PBVHNode * node) Line 3290	C++
 	blender.exe!blender::FunctionRef<void __cdecl(blender::IndexRange)>::callback_fn<`do_brush_action'::`55'::<lambda_1> const>(__int64 callable, blender::IndexRange <params_0>) Line 96	C++
 	blender.exe!tbb::interface9::internal::dynamic_grainsize_mode<tbb::interface9::internal::adaptive_mode<tbb::interface9::internal::auto_partition_type> >::work_balance<tbb::interface9::internal::start_for<tbb::blocked_range<__int64>,`blender::threading::detail::parallel_for_impl'::`5'::<lambda_1>,tbb::auto_partitioner const >,tbb::blocked_range<__int64> >() Line 442	C++
 	blender.exe!tbb::interface9::internal::start_for<tbb::blocked_range<__int64>,`blender::threading::detail::parallel_for_impl'::`5'::<lambda_1>,tbb::auto_partitioner const >::execute() Line 143	C++
 	[External Code]	

This is the line when it crashed:

unode->normal[index] = float3(CCG_elem_offset_no(&key, elem, i));
While bisecting, I was able to identify a pattern. In bad commits, performance is greatly affected. So, it was easy to identify which commits were bad and which were good, just checking the lag. The commit causing the issue is 4b427e1b57 @HooglyBoogly ^ This is the call_stack: ``` > blender.exe!blender::ed::sculpt_paint::undo::store_coords(Object * ob, blender::ed::sculpt_paint::undo::Node * unode) Line 1297 C++ blender.exe!tbb::interface7::internal::delegated_function<`blender::ed::sculpt_paint::undo::push_node'::`2'::<lambda_1> const ,void>::operator()() Line 97 C++ [External Code] blender.exe!tbb::interface7::internal::isolate_impl<void,`blender::ed::sculpt_paint::undo::push_node'::`2'::<lambda_1> const>(const blender::ed::sculpt_paint::undo::push_node::__l2::<lambda_1> & f) Line 216 C++ blender.exe!blender::ed::sculpt_paint::undo::push_node(Object * ob, PBVHNode * node, blender::ed::sculpt_paint::undo::Type type) Line 1524 C++ blender.exe!do_brush_action_task(Object * ob, const Brush * brush, PBVHNode * node) Line 3290 C++ blender.exe!blender::FunctionRef<void __cdecl(blender::IndexRange)>::callback_fn<`do_brush_action'::`55'::<lambda_1> const>(__int64 callable, blender::IndexRange <params_0>) Line 96 C++ blender.exe!tbb::interface9::internal::dynamic_grainsize_mode<tbb::interface9::internal::adaptive_mode<tbb::interface9::internal::auto_partition_type> >::work_balance<tbb::interface9::internal::start_for<tbb::blocked_range<__int64>,`blender::threading::detail::parallel_for_impl'::`5'::<lambda_1>,tbb::auto_partitioner const >,tbb::blocked_range<__int64> >() Line 442 C++ blender.exe!tbb::interface9::internal::start_for<tbb::blocked_range<__int64>,`blender::threading::detail::parallel_for_impl'::`5'::<lambda_1>,tbb::auto_partitioner const >::execute() Line 143 C++ [External Code] ``` This is the line when it crashed: ``` unode->normal[index] = float3(CCG_elem_offset_no(&key, elem, i)); ```
Blender Bot added
Priority
Normal
Status
Archived
and removed
Priority
High
Status
Confirmed
labels 2024-04-03 18:39:04 +02:00
Iliya Katushenock added
Priority
High
Status
Confirmed
and removed
Priority
Normal
Status
Archived
labels 2024-04-03 18:41:33 +02:00
Author

Sounds like you might have figured it out but ran blender debug log anyway on most recent build I could download. Hopefully these can help.

Sounds like you might have figured it out but ran blender debug log anyway on most recent build I could download. Hopefully these can help.
Member

Thanks a lot for the investigation @mano-wii, that saved me a lot of time.

Thanks a lot for the investigation @mano-wii, that saved me a lot of time.
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2024-04-03 19:49:07 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-04-03 19:51:35 +02:00
Author

When will the fix be available?

When will the fix be available?
Author

Tried todays build and so far no problems with it crashing while sculpting at level 6. I even tried it at level 7 and it seemed to be fine.

Tried todays build and so far no problems with it crashing while sculpting at level 6. I even tried it at level 7 and it seemed to be fine.

Hi! This bug still exists in the Steam version.

Hi! This bug still exists in the Steam version.
Member

Currently the plan is to release 4.1.1 on April 16. There's more info here: #119631

Currently the plan is to release 4.1.1 on April 16. There's more info here: #119631

Currently the plan is to release 4.1.1 on April 16. There's more info here: #119631

Thank you for the info!

> Currently the plan is to release 4.1.1 on April 16. There's more info here: #119631 Thank you for the info!
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#120187
No description provided.