Page MenuHome

Deadlock in PyGILState_Ensure during Shader Node, from Python Render
Closed, ArchivedPublic


Group: V 2.46 release
Resolution: Fixed
Category: Rendering (intern)

I'm tracking an issue for a customer where they are using a halftone shader node, available here:

On our render farm, we start a render by using python so that we can set output directories and the like first. What this means is that for nearly the entire lifetime of Blender's execution, the function BPY_txt_do_python_Text() is on the stack. This means of course that a lock created by PyGILState_Ensure() is also on the stack, and the corresponding PyGILState_Release() has not yet been called.

Normally, that's not a problem, until you have a scripted texture node in the mix. That's a problem because to call the scripted texture node, Blender goes through node_dynamic_exec_cb(), which also calls PyGILState_Ensure(). Unfortunately for it, the PyGILState is already ensured by the "main" python script, and deadlock occurs.

As a quick hack, I patched up node_dynamic_exec_cb() to eliminate calls to PyGILState_Ensure/_Release, and the deadlock goes away. Unfortunately, this basically means that people using shader nodes are restricted to single-threaded rendering. Is there a better alternative?

Event Timeline

Willian Padovani Germano (ianwill) changed the task status from Unknown Status to Unknown Status.Jul 27 2008, 12:08 AM

This task was automatically closed as archived as part of migration, because the project or tracker this task belonged to is no longer active.