Crash unloading addon defining NodeCustomGroup while rendering #51676

Closed
opened 2017-05-31 09:20:57 +02:00 by Corey Richardson · 11 comments

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.

crash_repro.blend

ShaderNodeBsdfMetal.py

shader_test.py

crash_repro.crash.txt

**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. [crash_repro.blend](https://archive.blender.org/developer/F613870/crash_repro.blend) [ShaderNodeBsdfMetal.py](https://archive.blender.org/developer/F613869/ShaderNodeBsdfMetal.py) [shader_test.py](https://archive.blender.org/developer/F613868/shader_test.py) [crash_repro.crash.txt](https://archive.blender.org/developer/F613871/crash_repro.crash.txt)

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @CoreyRichardson

Added subscriber: @CoreyRichardson

Added subscribers: @Sergey, @ideasman42, @mont29

Added subscribers: @Sergey, @ideasman42, @mont29

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 & @ideasman42 for second advice on this, they might have ideas to prevent that kind of 'user bug' to happen, but…

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 & @ideasman42 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.

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.

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'

@CoreyRichardson I cannot reproduce this issue, the attached Python code produces this error:

Traceback (most recent call last):
  File "/home/sybren/workspace/blender-git/tracker/T51676-crash-unload-while-rendering/crash_repro.blend/ShaderNodeBsdfMetal.py", line 775, in <module>
  File "/home/sybren/workspace/blender-git/tracker/T51676-crash-unload-while-rendering/crash_repro.blend/ShaderNodeBsdfMetal.py", line 766, in register
  File "/home/sybren/workspace/blender-git/tracker/T51676-crash-unload-while-rendering/crash_repro.blend/ShaderNodeBsdfMetal.py", line 749, in register_MetalBSDF_menus
  File "/home/sybren/workspace/blender-git/tracker/T51676-crash-unload-while-rendering/crash_repro.blend/ShaderNodeBsdfMetal.py", line 721, in filtered_menu
NameError: name 'ShaderNewNodeCategory' is not defined
Error: Python script failed, check the message in the system console

Given that you have a simplified situation that is working, and a more complex situation that crashes, please take the time to remove bits and pieces of the complex example until it doesn't crash any more, then add back pieces until it does crash. Once you have the bit that is required to reproduce the crash, you can probably remove other bits around it. Keep going until you have the absolute bare minimum to reproduce the crash. This will give important information as to the underlying cause.

@CoreyRichardson I cannot reproduce this issue, the attached Python code produces this error: ``` Traceback (most recent call last): File "/home/sybren/workspace/blender-git/tracker/T51676-crash-unload-while-rendering/crash_repro.blend/ShaderNodeBsdfMetal.py", line 775, in <module> File "/home/sybren/workspace/blender-git/tracker/T51676-crash-unload-while-rendering/crash_repro.blend/ShaderNodeBsdfMetal.py", line 766, in register File "/home/sybren/workspace/blender-git/tracker/T51676-crash-unload-while-rendering/crash_repro.blend/ShaderNodeBsdfMetal.py", line 749, in register_MetalBSDF_menus File "/home/sybren/workspace/blender-git/tracker/T51676-crash-unload-while-rendering/crash_repro.blend/ShaderNodeBsdfMetal.py", line 721, in filtered_menu NameError: name 'ShaderNewNodeCategory' is not defined Error: Python script failed, check the message in the system console ``` Given that you have a simplified situation that is working, and a more complex situation that crashes, please take the time to remove bits and pieces of the complex example until it doesn't crash any more, then add back pieces until it does crash. Once you have the bit that is required to reproduce the crash, you can probably remove other bits around it. Keep going until you have the absolute bare minimum to reproduce the crash. This will give important information as to the underlying cause.
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Needs User Info' to: 'Resolved'

Changed status from 'Needs User Info' to: 'Resolved'
Aaron Carlisle self-assigned this 2020-02-10 17:32:33 +01:00
Member

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.

Thanks again for the report. If the problem persists please open a new report with the required information.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed. Thanks again for the report. If the problem persists please open a new report with the required information.
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
4 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#51676
No description provided.