bpy.ops.sculpt.dynamic_topology_toggle causes a SegFault from Python in background mode #71605

Closed
opened 2019-11-15 11:41:34 +01:00 by Loïc Norgeot · 6 comments

System Information
Operating system: Linux-5.0.0-32-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: f6cb5f5449
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-14 09:40, hash: c25a910e4e
Broken: version: 2.82 (sub 1), branch: master, commit date: 2019-11-14 23:23, hash: 96ce32dca6
Worked: version: 2.79 (sub 0), branch: master, commit date: 2017-09-11 10:43, hash: 5bd8ac9abf, type: Release

Short description of error
With SCULPT mode and DynTopo activated, toggling DynTopo from a Python script works from the UI, but segfaults when ran in background.

Exact steps for others to reproduce the error

  • Open the default startup file
  • With the cube selected, toggle Sculpt mode
  • Turn on Dyntopo in the Active Tool settings
  • Save the .blend file in this state
  • Run the attached python script on the .blend with the UI: should open the file and switch to object mode.
  • Run the attached python script on the .blend in background mode: Segfault when trying to toggle Dyntopo
blender file.blend -P getoutofsculptmode.py     -> OK
blender file.blend -b -P getoutofsculptmode.py  -> SegFault

Attached files

  • .py script
  • default .blend file saved in sculpt mode with Dyntopo
  • backtrace (/tmp/file.crash.txt, same for all the versions tested)

sculpt_segfault.blend

getoutofsculptmode.py

sculpt_segfault.crash.txt

**System Information** Operating system: Linux-5.0.0-32-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116 **Blender Version** Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: `f6cb5f5449` Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-14 09:40, hash: `c25a910e4e` Broken: version: 2.82 (sub 1), branch: master, commit date: 2019-11-14 23:23, hash: `96ce32dca6` Worked: version: 2.79 (sub 0), branch: master, commit date: 2017-09-11 10:43, hash: 5bd8ac9abfa, type: Release **Short description of error** With SCULPT mode and DynTopo activated, toggling DynTopo from a Python script works from the UI, but segfaults when ran in background. **Exact steps for others to reproduce the error** - Open the default startup file - With the cube selected, toggle Sculpt mode - Turn on Dyntopo in the Active Tool settings - Save the .blend file in this state - Run the attached python script on the .blend with the UI: should open the file and switch to object mode. - Run the attached python script on the .blend in background mode: Segfault when trying to toggle Dyntopo ``` blender file.blend -P getoutofsculptmode.py -> OK blender file.blend -b -P getoutofsculptmode.py -> SegFault ``` **Attached files** - .py script - default .blend file saved in sculpt mode with Dyntopo - backtrace (/tmp/file.crash.txt, same for all the versions tested) [sculpt_segfault.blend](https://archive.blender.org/developer/F8089592/sculpt_segfault.blend) [getoutofsculptmode.py](https://archive.blender.org/developer/F8089594/getoutofsculptmode.py) [sculpt_segfault.crash.txt](https://archive.blender.org/developer/F8089596/sculpt_segfault.crash.txt)
Author

Added subscriber: @Loic-Norgeot

Added subscriber: @Loic-Norgeot
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

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

Changed status from 'Needs Triage' to: 'Confirmed'
Member

In a debug build it actually crashes in both cases.

libc.so.6!__GI_raise(...) (/build/glibc-4WA41p/glibc-2.30/sysdeps/unix/sysv/linux/raise.c:50)
libc.so.6!__GI_abort(...) (/build/glibc-4WA41p/glibc-2.30/stdlib/abort.c:79)
BKE_undosys_step_push_init_with_type(...) (/home/jacques/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:457)
sculpt_undo_push_begin(...) (/home/jacques/blender-git/blender/source/blender/editors/sculpt_paint/sculpt_undo.c:1114)
sculpt_dynamic_topology_disable_with_undo(...) (/home/jacques/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c:8124)
ED_object_sculptmode_exit_ex(...) (/home/jacques/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c:8612)
sculpt_mode_toggle_exec(...) (/home/jacques/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c:8660)
wm_operator_invoke(...) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:1453)
wm_operator_call_internal(...) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:1688)
WM_operator_call_py(...) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:1788)
...
/* We could detect and clean this up (but it should never happen!). */
BLI_assert(ustack->step_init == NULL);
In a debug build it actually crashes in both cases. ``` libc.so.6!__GI_raise(...) (/build/glibc-4WA41p/glibc-2.30/sysdeps/unix/sysv/linux/raise.c:50) libc.so.6!__GI_abort(...) (/build/glibc-4WA41p/glibc-2.30/stdlib/abort.c:79) BKE_undosys_step_push_init_with_type(...) (/home/jacques/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:457) sculpt_undo_push_begin(...) (/home/jacques/blender-git/blender/source/blender/editors/sculpt_paint/sculpt_undo.c:1114) sculpt_dynamic_topology_disable_with_undo(...) (/home/jacques/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c:8124) ED_object_sculptmode_exit_ex(...) (/home/jacques/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c:8612) sculpt_mode_toggle_exec(...) (/home/jacques/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c:8660) wm_operator_invoke(...) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:1453) wm_operator_call_internal(...) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:1688) WM_operator_call_py(...) (/home/jacques/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:1788) ... ``` ``` /* We could detect and clean this up (but it should never happen!). */ BLI_assert(ustack->step_init == NULL); ```

This issue was referenced by ad5f1d0231

This issue was referenced by ad5f1d02318a30c545196f124e30504615294416

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Campbell Barton self-assigned this 2020-09-12 05:43:23 +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#71605
No description provided.