Page MenuHome

Crash in sculpt mode using "Smooth" brush and tab with tablet stylus
Closed, ResolvedPublic

Description

System Information
Operating system: Windows 10
Graphics card: GTX 1050Ti (latest studio driver)
Other: Wacom Intuos 5 (latest driver, wireless)

Blender Version
Broken: All versions after 2.90.1
Worked: 2.90.1

Caused by rB3e5431fdf439: Sculpt: Invert Smooth to Enhance Details

Short description of error
Crash in sculpt mode with the Draw brush and smoothing (pressing ) when using a tablet.

The issue is that ss->cache->detail_directions is NULL in do_enhance_details_brush_task_cb_ex.

Exact steps for others to reproduce the error

  • File > New > Sculpting
  • choose the Smooth brush
  • set Radius to 4px
  • enable Strength Pressure sensitivity (should be ON by default though)
  • use tablet (not mouse) and tap with the stylus, don't drag, repeatedly
  • crash

Original report:

  1. Open the attached file
  2. Select the Draw brush, hold and tap with the stylus, don't drag, repeatedly on the area shown in the screenshot below.


Stack trace 3.0.0 Alpha, branch: master, commit date: 2021-06-24 07:12, hash: rB657015992902

madd_v3_v3v3fl(float * r, const float * a, const float * b, float f) Line 720	C
do_enhance_details_brush_task_cb_ex(void * userdata, const int n, const TaskParallelTLS * tls) Line 249	C
BLI_task_parallel_range(const int start, const int stop, void * userdata, void(*)(void *, const int, const TaskParallelTLS *) func, const TaskParallelSettings * settings) Line 140	C++
SCULPT_enhance_details_brush(Sculpt * sd, Object * ob, PBVHNode * * nodes, const int totnode) Line 291	C
SCULPT_do_smooth_brush(Sculpt * sd, Object * ob, PBVHNode * * nodes, int totnode) Line 401	C
do_brush_action(Sculpt * sd, Object * ob, Brush * brush, UnifiedPaintSettings * ups) Line 6017	C
do_tiled(Sculpt * sd, Object * ob, Brush * brush, UnifiedPaintSettings * ups, void(*)(Sculpt *, Object *, Brush *, UnifiedPaintSettings *) action) Line 6469	C
do_symmetrical_brush_actions(Sculpt * sd, Object * ob, void(*)(Sculpt *, Object *, Brush *, UnifiedPaintSettings *) action, UnifiedPaintSettings * ups) Line 6552	C
sculpt_stroke_update_step(bContext * C, PaintStroke * UNUSED_stroke, PointerRNA * itemptr) Line 7929	C
paint_brush_stroke_add_step(bContext * C, wmOperator * op, const float * mouse_in, float pressure) Line 637	C
paint_space_stroke(bContext * C, wmOperator * op, const float * final_mouse, float final_pressure) Line 873	C
paint_stroke_modal(bContext * C, wmOperator * op, const wmEvent * event) Line 1553	C
wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2080	C
wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2909	C
wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2957	C
wm_event_do_handlers(bContext * C) Line 3377	C
WM_main(bContext * C) Line 650	C
main(int argc, const unsigned char * * UNUSED_argv_c) Line 562	C

Original crash log

Event Timeline

Same crash produced on Windows 10 21H1, Ryzen 2600x, 64Gb, GTX 1060 (Studio Driver 462.59), Wacom Intuos 3, Blender 2.93.0

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Needs Information from User.Jun 23 2021, 5:08 PM

All crash-logs show that the crash happens in do_enhance_details_brush_task_cb_ex.
But without reproducible steps, unfortunately we can't triage this as a complete bug report.

For the development team to be able to help, there needs to be reproducible steps (start blender, press this, then that and crash).

Likely the same underlying issue as T85135

All crash-logs show that the crash happens in do_enhance_details_brush_task_cb_ex.

Can you direct me what kind of function it is? I would be more than happy to catch this bug.

Ok, so the crash happened for me always when using smoothing with the basic "draw" brush. I managed to create a .blend where the crash can be reproduced constantly and without too much effort .
Load the attached .blend, hold down SHIFT and do a few rapid dots (NOT strokes!) with your stylus (NOT mouse) over the area marked in the image.



I have reproduced it on different Windows systems using Blender 2.93.0, with different Wacom tablets (Intuos 3, Intuos, Cintiq).

Robert Guetzkow (rjg) changed the task status from Needs Information from User to Confirmed.Jun 24 2021, 11:21 AM
Robert Guetzkow (rjg) updated the task description. (Show Details)
Robert Guetzkow (rjg) renamed this task from EXCEPTION_ACCESS_VIOLATION in sculpt mode to Crash in sculpt mode using "Draw" brush and holding Shift.Jun 24 2021, 11:27 AM

2.93.2 RC still crashes but 3.0.0 alpha seems to be stable! I'll probably move to 3.0.0 right away and test it more deeply. Kudos to the one who did the magic :)

Thanks for the update :)

Closing since it was fixed.

If the problem persists, please let us know so we can re-open the report. Don't forget to mention the specific version you tested again.

It seems, it only solved the problem in the case of the attached crash.blend . In my actual daytime job I got the same crash with the same smooth brush :/ (Blender 3.0.0 Alpha - fb87d236edb7)

Pratik Borhade (PratikPB2123) reopened this task as Needs Triage.Sep 13 2021, 7:49 AM

In my actual daytime job I got the same crash with the same smooth brush :/ (Blender 3.0.0 Alpha - fb87d236edb7)

Reopening then.

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Sep 28 2021, 4:35 PM

Can confirm the crash.

Happens mostly with a very small brush.
Can also be reproduced from the default sculpting template, setting the brush size to 4px, smooth brush (Strength Pressure sensitivity ON), use tablet and hit a few dots (not strokes)

Philipp Oeser (lichtwerk) renamed this task from Crash in sculpt mode using "Draw" brush and holding Shift to Crash in sculpt mode using "Smooth" brush with small radius and tab with tablet stylus.Sep 28 2021, 4:38 PM
Philipp Oeser (lichtwerk) updated the task description. (Show Details)
Philipp Oeser (lichtwerk) triaged this task as High priority.

Caused by rB3e5431fdf439: Sculpt: Invert Smooth to Enhance Details

Issue is that sculpting could start with using SCULPT_smooth and (because of the Pressure sensitivity dropping to zero) code would switch to SCULPT_enhance_details_brush at stregth zero.
Issue with this though is that this can be in the middle or end of a stroke and the necessary ss->cache->detail_directions are only initialized for the first brush step (see SCULPT_stroke_is_first_brush_step in SCULPT_enhance_details_brush). With these missing, it could only go downhill from there.

Suggest to prevent the "mode-flip" from SCULPT_smooth to SCULPT_enhance_details_brush (happening solely because of pressure strength) by changing the condition.
Now do SCULPT_enhance_details_brush only if strength is below zero and SCULPT_smooth only if strength is above zero.
Skipping exactly zero should be fine since with an influence of zero, the brush step would not do anything anyways.

I think this can happen quite often actually (first assumption of this happening only with small brush radius is wrong -- can happen with all sizes), so will dare setting this to High prio.
Fix incomming.

Philipp Oeser (lichtwerk) renamed this task from Crash in sculpt mode using "Smooth" brush with small radius and tab with tablet stylus to Crash in sculpt mode using "Smooth" brush and tab with tablet stylus.Sep 28 2021, 5:47 PM
Philipp Oeser (lichtwerk) updated the task description. (Show Details)