Regression: Attempt to move object with Copy Location (with Offset) crashes #111120
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111120
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.67
Blender Version
Broken: version: 3.4.0 Alpha, branch: master, commit date: 2022-10-13 23:21, hash:
rB1fbd300adb9a
Worked: version: 3.4.0 Alpha, branch: master, commit date: 2022-10-13 00:16, hash:
rBb3e6a2888a2d
Short description of error
A consistent crash when trying to move an object with COPY LOC w/ Offset enabled.
Exact steps for others to reproduce the error
Open the attached blend file
Move the pre-selected object in any direction, you may have to do this two or three times
program will crash with EXCEPTION_ACCESS_VIOLATION
This is happening every time.
Attempt to move object with Copy Locatioh (with Offset) crashesto Regression: Attempt to move object with Copy Locatioh (with Offset) crashesI'll check.
update, while this happens consistently on the reporting platform, it doesn't happen on:
System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.67
Regression: Attempt to move object with Copy Locatioh (with Offset) crashesto Regression: Attempt to move object with Copy Location (with Offset) crashesThanks for report. I can confirm bug, but also i can see dependency cycle in terminal:
This is undefined behavior. If i delete both objects, i unable to reproduce crash anymore.
Can you fix your project to avoid cycles and confirm fix of crash?
Because I don't know how to fix the dependency cycle, I just deleted the driver and will adjust these variables manually. Yes: it no longer crashes.
I also notice that the driver editor window sometimes cannot be closed if I leave it alone for a coffee break, unless I switch to another app and back again. Perhaps I'll switch to decaf? ;)
Talked to @Sergey in chat, dependency cycles can lead to undefined behavior, however, these should not crash, will reopen...
Additional ASAN info:
@Sergey : seems something is not threadsafe, I think I cant repro with
blender -t 1
@lichtwerk Dependency cycle solver will remove a random relation to solve the cycle. And relations is what ensures thread safety, by making it so depsgraph operations are only executed when inputs are ready.
There are some special tricks in the graph to make it so if the execution order wasn't correct an access to outdated but valid data happens instead of a crash.
P.S. On a related note, it is not really guaranteed that
-t 1
will solve crashes when there are dependency cycles. It might, or might solve them. It is still possible that operation nodes are executed one at a time, but in a wrong order, causing crash.Potentially caused by
c67e5628d2
@HooglyBoogly /^
Not sure it's related to that commit. But #96968 is related. Though retrieving a mesh bounding box is threadsafe, functions like
BKE_object_dimensions_get
are not. I'd like to go further in the refactors for bounds to make it so objects don't have their own bounds cache but just return the cached bounds of their geometry. I don't fully understand the specific problem reported here, but I think that would fix it.Any updates here please?
The problem here is that dependency cycle prevents a typical flow when all operations are executed when their inputs are ready. This leads to situation that a driver access an object's "
dimensions
" and those do on-demand calculation of bounds and that calculation accesses object's evaluated state which is freed in a parallel thread as part of modifier stack evaluation.We do evaluate the bounding box as part of modifier stack already. It might make it easier to avoid non-thread safe access.
But as Hans identified already, making
BKE_object_dimensions_get
thread-safe (not only from multiple threads accessing data point of view, but also from the function itself accessing possibly stale data) is the solution to this crash.Not sure how far Hans for into the refactors.
Hans Goudey referenced this issue2023-10-10 00:18:44 +02:00
I finished the bounds fix in #113465, but I realized that's not enough to fix the bug after testing it.
It looks like the evaluated mesh is still totally freed:
vert_data->totlayer
is-1
and the rest of the struct is cleared.I'm worried that means a deeper change is necessary here, and I'm not sure how this ever worked before.
Just to move some information we've exchanged in the chat to a more permanent place.
What happens is that the
BKE_mesh_boundbox_get
accessesob->data
, and after that another thread frees derived meshes for that object, which makes its previousob->data
invalid.I am not sure it ever really worked before because even the old code was accessing
ob->data
, so might have some timings changed with different threading primitives used. I only tested current state of the main branch, and did not go into much older revisions.I am not currently sure what would be the best solution of the threading conflict, but some ideas:
Object_Runtime::bb
a value, always eagerly initialize it in the modifier evaluationobject->data
in theBKE_object_dimensions_get
,BKE_object_free_derived_caches
,BKE_object_eval_assign_data
with the same mutex lock. So worst caseBKE_object_dimensions_get
accesses the "input" mesh, and not the evaluated one (which is what one would expect when there is dependency cycle which prevents proper evaluation order).Finally managed to get Blender 3.3 with ASAN compiled locally.
So as the intuitive suspecion suggested, this is not really a regression as the crash can be reproduced there as well:
While it is still an important issue to be solved, it is not technically high-priority. So we can look into proper solutions, without worry of keeping them as safe as possible for 4.0 release.