Regression: Crash if you use the measure tool while changing certain user preferences in a 'depsgraph_update_post' handler #118223
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118223
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2024-01-18 00:01, hash:
d068407a004c
Worked: version: 4.1.0 Alpha, branch: main, commit date: 2024-01-11 21:04, hash:
16741e735b1b
Short description of error
If you have a handler of type
depsgraph_update_post
and this handler changes certain user preferences, Blender will crash when using the measure tool.Example code to add the problematic handler:
Exact steps for others to reproduce the error
Before I can even drag the tool, Blender Crashes.
Hi @Ric-Lopez,
Thank you for reporting this issue.
To investigate the crash with the measure tool in Blender 4.10 Beta, could you to provide us with crash logs? These logs can help us identify the cause of the crash and find a solution.
See: https://docs.blender.org/manual/en/dev/troubleshooting/crash.html#macos
Additionally, if you have any other information or error messages related to the crash, please let us know.
Attached is the crash log - no additional messages came on screen
Thank you for providing the crash log, @Ric-Lopez.
I analyzed the IPS file, but I didn't identify anything obvious that could indicate why it's crashing :\
Maybe the developers can figure it out (@Michael-Parkin-White-Apple ?).
Looking at the history of changes in the measure tool file, I also didn't find anything that could justify the regression.
https://projects.blender.org/blender/blender/commits/branch/main/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc
I will forward it to our developers for further investigation. In the meantime, is there anything else you'd like to add or any other steps you think might have triggered the crash?
Also, if you have some time, could you test some archived development builds to try and find out which build the problem was introduced in?
https://builder.blender.org/download/daily/archive/
Thank you for your review of the problem - there may be other issues , I never got past the measure tool crash - I will test again with a fresh install...
I Forgot to test without addons installed.....
I'll get back to you
Ok, well Blender measure works fine in a fresh install - so it has to be an addon - what a pain to go throught them all to figure out where the problem is.....
just to follow up - it was NONE of the addons
I was running a python script that wouls change the background color based on what mode I am in
ie Red for EDIT, Blue for SCULPT etc, as a visual cue of what I am doing - I found it helpful, but that caused the crash when I invoked the Measure tool in Blender 4.1
A copy of the script has been attached
I acually wish this could be added to Blender as a standard, it is really nice to know what mode you are in when multitasking other operations.
measure tool crash Blender 4.1 Betato Regression: Crash if you use the measure tool while changing certain user preferences in a 'depsgraph_update_post' handlerThanks for the update, I was able to replicate the crash and therefore updated the description.
Apologies for the delay in replying.
The step now is to bisect and find out where the problem was introduced.
Caused by
da1ed32f76
@mont29 ^
as I stated above, once I removed the custom python script (also attached above) the crash no longer occured
Can't check this right now (maybe @ideasman42 could have a look)... But in general editing data in a
depsgraph_update
handler is not the safest thing to do...Note that the only change in
da1ed32f76
that I could see causing this 'issue' is the addition of proper depsgraph update tagging inview3d_ruler_gpencil_ensure
when adding a new GP ID. That could cause thebpy.context
to have some invalid data at that point.I would not expect accessing
bpy.context
from adepsgraph_update
handler to be valid code. As in, I would not expect Blender to be able to guarantee thatbpy.context
is in a valid state at this point. Maybe @Sergey, @dr.sybren or @JacquesLucke know better about this topic though?You surely need to be careful what you access from the callback. Here it is not so much access to
bpy.context
which is a problem: I do not see howdepsgraph_update_post
could cause issues as it is running on the main thread, after the depsgraph is evaluated.What happens here is the following:
Not sure what to do here then, this sounds to me as a 'not expected to work' case?
In any case, does not really looks like a high-priority issue, again, manipulating data in handlers in general, and depsgraph handlers in particular, is risky (see also https://docs.blender.org/api/master/bpy.app.handlers.html#note-on-altering-data ).