If object is reference for 2 shrinkwraps, entering it`s edit mode crashes Blender. #78285
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#78285
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?
Bisecting points to
0945a79ed1
System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 445.87
Blender Version
Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-06-24 21:51, hash:
ec776f18ff
Worked: blender-2.90.0-ab8a6914317f-windows64.zip
Short description of error
Create a file using the steps shown below or download the .blend file. Select the sphere and enter edit mode and Blender should crash. You may need to enter edit mode a few times for this bug to occur.
2020-06-26_05-29-42.mp4
untitled1.blend
Original steps:
There is two shrinkwraps on two fingers. And if both enabled in viewport, I have crash, when I try to enter edit mode for hand.
Yes, tested with factory settings too, the same.
untitled.blend
2020-06-26_05-12-19.mp4
Added subscriber: @Vyach
#78546 was marked as duplicate of this issue
Okay. I reproduced it with simple file.
2020-06-26_05-29-42.mp4
untitled1.blend
Bugged file, Blender crashes: entering edit mode to object, that is reference for 2 shrinkwrapsto If object is reference for 2 shrinkwraps, entering it`s edit mode crashes Blender.Added subscriber: @Alaska
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm.
Linux-5.4.0-7634-generic-x86_64-with-debian-bullseye
GTX 1050Ti
2.90.0
646ef49e197d
In some cases you'll have to enter edit mode multiple times for the crash to occur.
Will bisect now (
e079bf6996
still produces errors for me).Added subscriber: @ideasman42
Bisecting points to
0945a79ed1
CC @ideasman42
Added subscribers: @BassamKurdali, @iss
Added subscribers: @Sergey, @brecht, @mont29
reading a bit this code, it looks to me like a critically thread-unsafe one!
BKE_mesh_runtime_looptri_ensure
use a specific, global (!!!) RW mutex. AND it only uses it to generate the data, the return a pointer to said data, on which there is absolutely no way to guarantee it won't be freed by another thread while being used?BKE_bvhtree_from_mesh_get
& co get and partially use the runtime mutex of the mesh.BKE_mesh_wrapper_ensure_mdata
is not protected at all. While being called fro threads. Like...IMHO all those should use exclusively the mesh's runtime mutex (RW mutexes give very little benefit in general anyway). @brecht, @Sergey, what do you think?
Again one point where having re-entrant mutexes would have been nice, btw... keeping a proper sane usage of that runtime mutex is likely going to be challenging.
PS: note that
0945a79ed1
is not the only cause of the issue here, still get crash when it is reverted.It is preferable to use the per-mesh mutex when possible.
However if a thread is going to create looptri data and then free it, then the mesh should not have been modified at all? The data can be stored in an array separate from the mesh and each thread can make their own copy and free it aftwards.
If the intent is to do lazy creation and keep it afterwards, then you need a mutex.
I find re-entrant mutexes very hard to understand, I would not use them at all.
General rule is to not modify someone's else data. Without this you will either run into issues like this, or will reduce occupancy of threads during evaluation.
The idea was always to extend datamask reported by modifiers to also extend it to what they need from operands. This will allow the "target" mesh to make sure looptri, bvh and what not is evaluated in the thread local to the corresponding mesh, without having threads wait on data.
For the freeing part i am confused. If data is supposed to be temp, then it should not be stored in the object at all. This is what Brecht already pointed out i think.
Safest fix would be:
Longer term fix: communicate datamask to other objects via the dependency graph, prepare lazily initialzed data ahead of the time.
This issue was referenced by
e2e87efea2
This issue was referenced by
ade7603379
This issue was referenced by
4e6975ffd6
Changed status from 'Confirmed' to: 'Resolved'