Deadlock happens when stopping rendered viewport (Blender Internal) #37604

Closed
opened 2013-11-24 20:18:32 +01:00 by Shinsuke Irie · 11 comments
Member

System Information
Ubuntu 13.10 amd64 + GeForce GTX 670

Blender Version
Broken: git 178bd849bf 2013-11-24 17:21, also 2.69 is broken

Short description of error

Switching the viewport from "Rendered" to the other sometimes causes a deadlock, espacially using Freestyle tends to lead to the problem.

Backtrace: blender_rendered_view_deadlock.txt

I've made backtraces several times and found that this deadlock always occurs at WM_jobs_kill_type() in ED_view3d_shade_update().
Note that this happens even when not using Freestyle. pthread_cond_wait() or pthread_cond_timewait() in a subthread conflicts with the pthread_join() in the main thread.

**System Information** Ubuntu 13.10 amd64 + GeForce GTX 670 **Blender Version** Broken: git 178bd849bf6f 2013-11-24 17:21, also 2.69 is broken **Short description of error** Switching the viewport from "Rendered" to the other sometimes causes a deadlock, espacially using Freestyle tends to lead to the problem. Backtrace: [blender_rendered_view_deadlock.txt](https://archive.blender.org/developer/F32338/blender_rendered_view_deadlock.txt) I've made backtraces several times and found that this deadlock always occurs at WM_jobs_kill_type() in ED_view3d_shade_update(). Note that this happens even when not using Freestyle. pthread_cond_wait() or pthread_cond_timewait() in a subthread conflicts with the pthread_join() in the main thread.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @IRIEShinsuke

Added subscriber: @IRIEShinsuke

Added subscriber: @brecht

Added subscriber: @brecht

I think may be related to the python global interpreter lock, both the UI and freestyle using python. In cycles this is worked around by adding Py_BEGIN_ALLOW_THREADS / Py_END_ALLOW_THREADS in some places.

I think may be related to the python global interpreter lock, both the UI and freestyle using python. In cycles this is worked around by adding Py_BEGIN_ALLOW_THREADS / Py_END_ALLOW_THREADS in some places.
Author
Member

Thanks, I'm now testing Py_BEGIN_ALLOW_THREADS + Py_END_ALLOW_THREADS, but there is another case not related to the Python global interpreter lock and the deadlock still happens. BLI_ticket_mutex_lock() in sub thread also causes the deadlock.

Backtrace: blender_rendered_view_deadlock2.txt

Thanks, I'm now testing Py_BEGIN_ALLOW_THREADS + Py_END_ALLOW_THREADS, but there is another case not related to the Python global interpreter lock and the deadlock still happens. BLI_ticket_mutex_lock() in sub thread also causes the deadlock. Backtrace: [blender_rendered_view_deadlock2.txt](https://archive.blender.org/developer/F32569/blender_rendered_view_deadlock2.txt)

Added subscriber: @Sergey

Added subscriber: @Sergey

Would be nice to be able to reproduce the deadlock. How do i do this?

Would be nice to be able to reproduce the deadlock. How do i do this?
Author
Member

Step to reproduce:

  1. Make a scene using Freestyle
  2. Start the rendered view (Shift+Z)
  3. Stop the rendered view (Shift+Z) when the 3D view header shows "Freestyle: Stroke rendering"

This causes the deadlock related to the Python global interpreter lock, so probably can be resolved using Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS.

However, I still don't find out how to reproduce another deadlock related to BLI_ticket_mutex_lock(). This is quite rare case.

Step to reproduce: 1. Make a scene using Freestyle 2. Start the rendered view (Shift+Z) 3. Stop the rendered view (Shift+Z) when the 3D view header shows "Freestyle: Stroke rendering" This causes the deadlock related to the Python global interpreter lock, so probably can be resolved using Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS. However, I still don't find out how to reproduce another deadlock related to BLI_ticket_mutex_lock(). This is quite rare case.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sergey Sharybin self-assigned this 2014-02-04 11:06:06 +01:00

@IRIEShinsuke, the thing is if you couldn't reproduce the issue you're hitting in rare cases it's very unlikely other will manage to do it. We couldn't actually spend hours trying to reproduce the issue..

That'd help a lot if you investigate the circumstances of the dead-lock. You've got much more chances becasue you alrady hit the issue!

For until then i'm archiving the report.

@IRIEShinsuke, the thing is if you couldn't reproduce the issue you're hitting in rare cases it's very unlikely other will manage to do it. We couldn't actually spend hours trying to reproduce the issue.. That'd help a lot if you investigate the circumstances of the dead-lock. You've got much more chances becasue you alrady hit the issue! For until then i'm archiving the report.
Author
Member

Ah OK, the remaining dead-lock is quite rare, so we can archive this.

Ah OK, the remaining dead-lock is quite rare, so we can archive this.
Sign in to join this conversation.
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
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#37604
No description provided.