Crash unloading addon defining NodeCustomGroup while rendering
Open, NormalPublic

Description

System Information

Arch Linux with AMD R9 285

Blender Version

Broken: 2.78 fb82948043

Short description of error

While rendering with a material using a NodeCustomGroup defined in an addon, unregistering the addon causes a crash.

Note that the attached "simplified" example (shader_test.py) works correctly! There's something going on with this complex shader that's causing a crash, and I unfortunately haven't been able to reduce it... Hopefully someone can do something with the crashlog.

Exact steps for others to reproduce the error

Load the attached ShaderNodeBsdfMetal.py, activate the "Conductive Fresnel Node" addon it defines, open the attached blend. Add a "Metal BSDF" node to the cube material, attach it to the output, then either hit F12 or shift-Z in the viewport. Deactivate "Conductive Fresnel Node" and witness the crash.

For the non-crash example, load the attached shader_test.py, activate the "Bug reproduction" addon it defines, replace the "Metal BSDF" node with a "Sample BSDF" (at the bottom of the list), attach it to the output, then hit F12 or shift-Z. Deactivate "Bug Reproduction" and witness the non-crash.

Details

Type
Bug
Bastien Montagne (mont29) triaged this task as Normal priority.May 31 2017, 9:53 AM

Would not consider this a bug really… It’s kind of obvious that if you remove some code/data parts defined in addon and used in render during a render, you expose yourself to issues… Just like you would if you tried to unregister an addon defining a given operator while running that operator. Later is not possible, can’t really see anyway to prevent the former though, except for making rendering fully blocking the UI.

Adding @Sergey Sharybin (sergey) & @Campbell Barton (campbellbarton) for second advice on this, they might have ideas to prevent that kind of 'user bug' to happen, but…

While normally I'd agree, there's something funky happening with the "complex" example that is causing unregistering to crash that isn't happening with the simple example.