Blender segfault if Bake Line Art #110751

Closed
opened 2023-08-03 12:53:39 +02:00 by Sergey Stepanov · 8 comments

System Information
Operating system: Debian Linux Stable 11
Graphics card: Intel internal UHD Graphics 630 (driver: i915)

Blender Version
Broken: 3.2.2 - 3.6.1 official releases

Short description of error
Blender segfault if Bake Line Art.

Console:

Writing: /tmp/blender.crash.txt
Segmentation fault

File /tmp/blender.crash.txt:

# Blender 3.2.2, Commit date: 2022-08-02 18:15, Hash bcfdb14560e7
bpy.ops.object.delete(use_global=False, confirm=False)  # Operator
Deleted 1 object(s)  # Info
bpy.ops.object.gpencil_add(align='WORLD', location=(0, 0, 0), scale=(1, 1, 1), type='MONKEY')  # Operator
bpy.context.space_data.context = 'MODIFIER'  # Property
bpy.ops.object.gpencil_modifier_add(type='GP_LINEART')  # Operator

# backtrace
./blender(BLI_system_backtrace+0x20) [0xc1619d0]
./blender() [0x11da18d]
/lib/x86_64-linux-gnu/libc.so.6(+0x38d60) [0x7f97f7664d60]
./blender(MEM_lockfree_allocN_len+0x7) [0xc16e1e7]
./blender(MEM_lockfree_dupallocN+0x14) [0xc16e624]
./blender(BKE_gpencil_stroke_duplicate+0x1a) [0x11f926a]
./blender(BKE_gpencil_frame_copy_strokes+0x42) [0x11f94c2]
./blender() [0x1207d97]
./blender(BKE_gpencil_prepare_eval_data+0x1b7) [0x1208b07]
./blender(BKE_object_handle_data_update+0x2fe) [0x12af9ae]
./blender(BKE_object_eval_uber_data+0x2f) [0x12afc7f]
./blender() [0x1913f22]
./blender() [0x19140f2]
./blender() [0xc16574d]
./blender() [0x1796a35]
./blender() [0x1796ceb]
./blender() [0x1783d27]
./blender() [0x1790720]
./blender() [0x179275c]
./blender() [0x1792959]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7ea7) [0x7f97f807aea7]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f97f7727a2f]

# Python backtrace

Exact steps for others to reproduce the error

  1. Open Blender
  2. Click to default box and delete it (press del)
  3. Press Shift+A
  4. Select "Grease Pencil" - "Monkey"
  5. At right area select "Modifier Properties"
  6. Click "Add Modifier"
  7. Select "Line Art"
  8. At bottom of this area click "Bake" - "Bake Line Art"
  9. Segfault here
**System Information** Operating system: Debian Linux Stable 11 Graphics card: Intel internal UHD Graphics 630 (driver: i915) **Blender Version** Broken: 3.2.2 - 3.6.1 official releases **Short description of error** Blender segfault if Bake Line Art. Console: ``` Writing: /tmp/blender.crash.txt Segmentation fault ``` File /tmp/blender.crash.txt: ``` # Blender 3.2.2, Commit date: 2022-08-02 18:15, Hash bcfdb14560e7 bpy.ops.object.delete(use_global=False, confirm=False) # Operator Deleted 1 object(s) # Info bpy.ops.object.gpencil_add(align='WORLD', location=(0, 0, 0), scale=(1, 1, 1), type='MONKEY') # Operator bpy.context.space_data.context = 'MODIFIER' # Property bpy.ops.object.gpencil_modifier_add(type='GP_LINEART') # Operator # backtrace ./blender(BLI_system_backtrace+0x20) [0xc1619d0] ./blender() [0x11da18d] /lib/x86_64-linux-gnu/libc.so.6(+0x38d60) [0x7f97f7664d60] ./blender(MEM_lockfree_allocN_len+0x7) [0xc16e1e7] ./blender(MEM_lockfree_dupallocN+0x14) [0xc16e624] ./blender(BKE_gpencil_stroke_duplicate+0x1a) [0x11f926a] ./blender(BKE_gpencil_frame_copy_strokes+0x42) [0x11f94c2] ./blender() [0x1207d97] ./blender(BKE_gpencil_prepare_eval_data+0x1b7) [0x1208b07] ./blender(BKE_object_handle_data_update+0x2fe) [0x12af9ae] ./blender(BKE_object_eval_uber_data+0x2f) [0x12afc7f] ./blender() [0x1913f22] ./blender() [0x19140f2] ./blender() [0xc16574d] ./blender() [0x1796a35] ./blender() [0x1796ceb] ./blender() [0x1783d27] ./blender() [0x1790720] ./blender() [0x179275c] ./blender() [0x1792959] /lib/x86_64-linux-gnu/libpthread.so.0(+0x7ea7) [0x7f97f807aea7] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f97f7727a2f] # Python backtrace ``` **Exact steps for others to reproduce the error** 1. Open Blender 2. Click to default box and delete it (press del) 3. Press Shift+A 4. Select "Grease Pencil" - "Monkey" 5. At right area select "Modifier Properties" 6. Click "Add Modifier" 7. Select "Line Art" 8. At bottom of this area click "Bake" - "Bake Line Art" 9. Segfault here
Sergey Stepanov added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2023-08-03 12:53:40 +02:00
Germano Cavalcante added
Module
Grease Pencil
Status
Confirmed
Interest
Line Art
and removed
Status
Needs Triage
labels 2023-08-03 20:24:06 +02:00

Thanks for the report, I can confirm the crash:

>	blender.exe!MEM_lockfree_allocN_len(const void * vmemh) Line 71	C
 	blender.exe!MEM_lockfree_dupallocN(const void * vmemh) Line 113	C
 	blender.exe!BKE_gpencil_stroke_duplicate(bGPDstroke * gps_src, bool dup_points, bool dup_curve) Line 866	C++
 	blender.exe!BKE_gpencil_frame_copy_strokes(bGPDframe * gpf_src, bGPDframe * gpf_dst) Line 937	C++
 	blender.exe!copy_frame_to_eval_ex(bGPDframe * gpf_orig, bGPDframe * gpf_eval) Line 685	C++
 	blender.exe!gpencil_copy_visible_frames_to_eval(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 720	C++
 	blender.exe!BKE_gpencil_prepare_eval_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 792	C++
 	blender.exe!BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 192	C++
 	blender.exe!BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 341	C++
 	blender.exe!blender::deg::DepsgraphNodeBuilder::build_object_data_geometry::__l2::<lambda>(Depsgraph * depsgraph) Line 1642	C++
 	[External Code]	
 	blender.exe!blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Line 109	C++
 	blender.exe!blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Line 122	C++
 	blender.exe!Task::operator()() Line 168	C++
 	blender.exe!tbb::internal::function_task<Task>::execute() Line 1060	C++
 	[External Code]	
 	blender.exe!tbb::task::wait_for_all() Line 821	C++
 	blender.exe!tbb::internal::task_group_base::wait() Line 168	C++
 	blender.exe!tbb_task_pool_work_and_wait(TaskPool * pool) Line 243	C++
 	blender.exe!BLI_task_pool_work_and_wait(TaskPool * pool) Line 474	C++
 	blender.exe!blender::deg::`anonymous namespace'::evaluate_graph_threaded_stage(blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, TaskPool * task_pool, const blender::deg::`anonymous-namespace'::EvaluationStage stage) Line 325	C++
 	blender.exe!blender::deg::deg_evaluate_on_refresh(blender::deg::Depsgraph * graph) Line 448	C++
 	blender.exe!deg_flush_updates_and_refresh(blender::deg::Depsgraph * deg_graph) Line 46	C++
 	blender.exe!DEG_evaluate_on_framechange(Depsgraph * graph, float frame) Line 81	C++
 	blender.exe!BKE_scene_graph_update_for_newframe_ex(Depsgraph * depsgraph, bool clear_recalc) Line 2834	C++
 	blender.exe!BKE_scene_graph_update_for_newframe(Depsgraph * depsgraph) Line 2882	C++
 	blender.exe!lineart_gpencil_bake_startjob(void * customdata, bool * stop, bool * do_update, float * progress) Line 245	C++
 	blender.exe!do_job_thread(void * job_v) Line 388	C++
 	blender.exe!tslot_thread_start(void * tslot_p) Line 178	C++
 	[External Code]	

Thanks for the report, I can confirm the crash: ``` > blender.exe!MEM_lockfree_allocN_len(const void * vmemh) Line 71 C blender.exe!MEM_lockfree_dupallocN(const void * vmemh) Line 113 C blender.exe!BKE_gpencil_stroke_duplicate(bGPDstroke * gps_src, bool dup_points, bool dup_curve) Line 866 C++ blender.exe!BKE_gpencil_frame_copy_strokes(bGPDframe * gpf_src, bGPDframe * gpf_dst) Line 937 C++ blender.exe!copy_frame_to_eval_ex(bGPDframe * gpf_orig, bGPDframe * gpf_eval) Line 685 C++ blender.exe!gpencil_copy_visible_frames_to_eval(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 720 C++ blender.exe!BKE_gpencil_prepare_eval_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 792 C++ blender.exe!BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 192 C++ blender.exe!BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 341 C++ blender.exe!blender::deg::DepsgraphNodeBuilder::build_object_data_geometry::__l2::<lambda>(Depsgraph * depsgraph) Line 1642 C++ [External Code] blender.exe!blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Line 109 C++ blender.exe!blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Line 122 C++ blender.exe!Task::operator()() Line 168 C++ blender.exe!tbb::internal::function_task<Task>::execute() Line 1060 C++ [External Code] blender.exe!tbb::task::wait_for_all() Line 821 C++ blender.exe!tbb::internal::task_group_base::wait() Line 168 C++ blender.exe!tbb_task_pool_work_and_wait(TaskPool * pool) Line 243 C++ blender.exe!BLI_task_pool_work_and_wait(TaskPool * pool) Line 474 C++ blender.exe!blender::deg::`anonymous namespace'::evaluate_graph_threaded_stage(blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, TaskPool * task_pool, const blender::deg::`anonymous-namespace'::EvaluationStage stage) Line 325 C++ blender.exe!blender::deg::deg_evaluate_on_refresh(blender::deg::Depsgraph * graph) Line 448 C++ blender.exe!deg_flush_updates_and_refresh(blender::deg::Depsgraph * deg_graph) Line 46 C++ blender.exe!DEG_evaluate_on_framechange(Depsgraph * graph, float frame) Line 81 C++ blender.exe!BKE_scene_graph_update_for_newframe_ex(Depsgraph * depsgraph, bool clear_recalc) Line 2834 C++ blender.exe!BKE_scene_graph_update_for_newframe(Depsgraph * depsgraph) Line 2882 C++ blender.exe!lineart_gpencil_bake_startjob(void * customdata, bool * stop, bool * do_update, float * progress) Line 245 C++ blender.exe!do_job_thread(void * job_v) Line 388 C++ blender.exe!tslot_thread_start(void * tslot_p) Line 178 C++ [External Code] ```
Member

Will raise the priority here since this is a crasher (that is not totally uncommon to run into)

Will raise the priority here since this is a crasher (that is not totally uncommon to run into)
Philipp Oeser added
Priority
High
and removed
Priority
Normal
labels 2024-02-13 16:03:04 +01:00
Falk David added this to the Grease Pencil project 2024-03-08 12:21:44 +01:00
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2024-03-08 21:24:25 +01:00
Member

@ChengduLittleA Could you take a look?

@ChengduLittleA Could you take a look?
Member

Will do. Is there any particular test file available? It's a quite old issue, I'd imagine it resolved itself sometime ago since I don't quite get any reports on line art bake crashing

Will do. Is there any particular test file available? It's a quite old issue, I'd imagine it resolved itself sometime ago since I don't quite get any reports on line art bake crashing
Member

Is there any particular test file available? It's a quite old issue, I'd imagine it resolved itself sometime ago since I don't quite get any reports on line art bake crashing

No file, just follow the repro steps. This is still happening in 4.1beta

> Is there any particular test file available? It's a quite old issue, I'd imagine it resolved itself sometime ago since I don't quite get any reports on line art bake crashing No file, just follow the repro steps. This is still happening in 4.1beta
Member

Looks like it's crashing in BKE_scene_graph_update_for_newframe() when there are strokes within the object that's not generated by line art.

Looks like it's crashing in `BKE_scene_graph_update_for_newframe()` when there are strokes within the object that's not generated by line art.
Member

Note this fix does not really preserve the old behaviour of line art baking (will now remove previous baked frames when start baking).

This particular crash is supposedly broken since the change to using a job system to bake line art, which somehow caused conflict in having UI display and with BKE_scene_graph_update_for_newframe(). In order to avoid crashing in there, I have to remove all previous strokes to achieve the goal. Not sure what difference does it make. Line art bakes just fine if you don't have strokes already present in the gpencil object.

Note this fix does not really preserve the old behaviour of line art baking (will now remove previous baked frames when start baking). This particular crash is supposedly broken since the change to using a job system to bake line art, which somehow caused conflict in having UI display and with `BKE_scene_graph_update_for_newframe()`. In order to avoid crashing in there, I have to remove all previous strokes to achieve the goal. Not sure what difference does it make. Line art bakes just fine if you don't have strokes already present in the gpencil object.
Member

IIRC it's quite common to lock the UI during baking to avoid crashes, see WM_set_locked_interface.

IIRC it's quite common to lock the UI during baking to avoid crashes, see `WM_set_locked_interface`.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-03-19 17:59:33 +01: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
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#110751
No description provided.