Dragging in the timeline causes Blender to freeze #76553
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76553
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?
System Information
Operating system: Linux 5.4.0-7626-generic #30~1588169883~20.04~bbe668a-Ubuntu SMP
Graphics card: Quadro RTX 8000
(this happens on a variety of artist workstations, though)
Blender Version
Broken:
d8a3f3595a
Worked:
a18ad3c3b6
The artists at Blender Studio seem to have issues with Blender randomly hanging since last friday. It seems to be this commit that causes it: https://developer.blender.org/rBd8a3f3595af0fb3ca5937e41c2728fd750d986ef
The file to reproduce it: gabby.V2.blend
playing back animation or dragging the timeline should cause blender to freeze immediately.
Added subscriber: @eyecandy
Added subscriber: @Jeroen-Bakker
Able to reproduce, wasn't instant but after 30 seconds it froze on my system
Added subscriber: @ZedDB
Changed status from 'Needs Triage' to: 'Confirmed'
I can confirm the freeze on my end. If I open up the file and start playback, it will freeze after a few frames.
@Jeroen-Bakker I guess this should be high prio, right?
Ah, I guess we submitted nearly at the same time :P
Added subscriber: @SimonThommes
Added subscriber: @antoniov
Also confirmed in Windows 10 RTX2080TI
I try to pause the loop and the editor stops here:
task.h
Seems like a pthread read lock isn't freed making all write locks wait forever when building bvh trees.
https://developer.blender.org/P1377
I will continue to work on it on Monday (if it is still open) @eyecandy the current work-a-round IMO is to use b283.
Added subscriber: @brecht
Here's a backtrace from a thread that shows the problem.
There's a dependency graph task here, doing a parallel range within the mutex lock, which causes a dependency graph task to be executed recursively.
Task isolation might be a solution:
https://software.intel.com/en-us/node/684814
Using task isolation will likely have some performance impact, but hopefully it's negligible with the right choice of implementation.
The tricky part is that mutex locking in one part of the code causes problems in other parts of the code quite far away from it. It is hard to tell if a function call from within a mutex locked region uses parallelization or not, and then ensure that assumption remains correct as the code changes.
I can see a few ways of doing this:
BLI_task_pool_work_and_wait
andBLI_task_parallel_range
. The downside of this is that any other usage of TBB will not be handled automatically. For example OpenVDB uses TBB, and any OpenVDB processing in a mutex locked region will need code for task isolation.This issue was referenced by
08ac4d3d71
I'm testing this locally for the daily rendering/lighting routine and so far it seems to stop Blender from freezing like it's been doing all week. nice!
Added subscriber: @JacquesLucke
Based on the Brecht's backtrace I wonder if the following would be a better long-term solution to this particular problem.
It seems, we lock
cache_rwlock
whenever a new bvh tree is build (e.g. inbvhtree_from_mesh_looptri_ex
). So we can only ever build a single bvh tree in parallel whenBKE_bvhtree_from_mesh_get
is used. I don't see why it has to be this way. It feels like it should be possible to change the locking mechanism so that multiple bvh trees can be build in parallel. Once we have that, the deadlock shown in Brecht's backtrace should never happen.This is how I think it might work. Not sure how to do that more precisely. I haven't done any thread synchronization for quite a while. All of the locking logic could probably be abstracted way by some nice cache data structure.
In general we should probably never do a lot of work within a critical section, which is is exactly what is done in the current implementation.
@JacquesLucke I agree that kind of setup would be better. But we need to check all mutex locking code for this, task isolation is the safer option until then.
This kind of lazy initialization need an abstraction, to hide the complicated logic. There may also be a way in TBB to make any waiting threads help building the BVH tree.
Changed status from 'Confirmed' to: 'Resolved'