calling evaluated_depsgraph_get() while active object in EDIT mode can crash Blender #75371

Closed
opened 2020-04-04 12:00:52 +02:00 by Gaia Clary · 4 comments
Member

System Information
Operating system:
Graphics card:

Blender Version
Broken: master
Worked: unknown

I was actually chasing a bug in an Addon. For this purpose i called evaluated_depsgraph_get() for testing. By this i found that calling that function repeatedly causes Blender to crash.

Exact steps for others to reproduce the error

I was able to create a small demo blend file depsgraph_crash.blend
This file contains 2 objects and a modifier.
Also a small script is attached:

dg = bpy.context.evaluated_depsgraph_get()
ob_eval = bpy.context.object.evaluated_get(dg)
me_eval = ob_eval.to_mesh(preserve_all_data_layers=True, depsgraph=dg)

for m in bpy.context.object.modifiers:
    m.show_viewport=True

depsgraph = bpy.context.evaluated_depsgraph_get() # <== Blender crashes here

When you cut/paste this script to the Python console, you see that blender crashes on the last line. I am not sure if the modifications in the modifier are important, but this way the crash is reproducible. It might be a timing thing.

Important notice: The Crash only happens when the active object is in edit mode. When the Object is in Object mode then all works as expected.

note: I found another issue yesterday which actually seems to have the exact same cause as what happens in the demo blendfile: When i call bpy.context.evaluated_depsgraph_get() within a handler then Blender also crashes when the handler is called while the active object is in Edit mode.

**System Information** Operating system: Graphics card: **Blender Version** Broken: master Worked: unknown I was actually chasing a bug in an Addon. For this purpose i called evaluated_depsgraph_get() for testing. By this i found that calling that function repeatedly causes Blender to crash. **Exact steps for others to reproduce the error** I was able to create a small demo blend file [depsgraph_crash.blend](https://archive.blender.org/developer/F8447480/depsgraph_crash.blend) This file contains 2 objects and a modifier. Also a small script is attached: ``` dg = bpy.context.evaluated_depsgraph_get() ob_eval = bpy.context.object.evaluated_get(dg) me_eval = ob_eval.to_mesh(preserve_all_data_layers=True, depsgraph=dg) for m in bpy.context.object.modifiers: m.show_viewport=True depsgraph = bpy.context.evaluated_depsgraph_get() # <== Blender crashes here ``` When you cut/paste this script to the Python console, you see that blender crashes on the last line. I am not sure if the modifications in the modifier are important, but this way the crash is reproducible. It might be a timing thing. Important notice: The Crash only happens when the active object is in edit mode. When the Object is in Object mode then all works as expected. note: I found another issue yesterday which actually seems to have the exact same cause as what happens in the demo blendfile: When i call bpy.context.evaluated_depsgraph_get() within a handler then Blender also crashes when the handler is called while the active object is in Edit mode.
Author
Member

Added subscriber: @GaiaClary

Added subscriber: @GaiaClary

Added subscribers: @Sergey, @mano-wii

Added subscribers: @Sergey, @mano-wii

Think I forgot to mention bugfix number in the commit.

The issue was actually fixed in blender/blender@9fca9b9953. Thanks fore the report, closing!

Think I forgot to mention bugfix number in the commit. The issue was actually fixed in blender/blender@9fca9b9953. Thanks fore the report, closing!

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

Changed status from 'Needs Triage' to: 'Resolved'
Sergey Sharybin self-assigned this 2020-04-07 14:25:18 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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-addons#75371
No description provided.