Crash after deleting material leaves invalid pointer in node editor #76559
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76559
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.3.0-51-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.59
Blender Version
Broken: version: 2.83 (sub 15), branch: master, commit date: 2020-05-05 22:28, hash:
c036ef1369
Worked: 2.83 (sub 11), branch: master, commit date: 2020-03-31 23:07, hash:
da3cb514e5
Worked: Blender 2.83 (sub 12) (hash
71b1ee940b
built 2020-04-06 14:49:34)Short description of error
Blender will segfault after loading a collection from a library file under some conditions. The minimal example I found was when removing materials from a file then checking for available cuda devices followed by a load.
Segfault occurs on all example files tested including saving the blender startup file. In the case of the attached script it has been saved as 'untitled.blend'
load_test.py
Exact steps for others to reproduce the error
blender --background --python load_test.py
[Based on the default startup]
Backtrace of segfault
THANKS
As always, really appreciate your work. This isn't blocking for us right now because we can eliminate the offending material removal line; but I thought it would be helpful to report as a bug ahead of an LTS release.
Added subscriber: @nkundtz
Segfault from Removing materials + CUDA + loading a collectionto Crash after deleting material leaves invalid pointer in node editorAdded subscribers: @mont29, @brecht
Changed status from 'Needs Triage' to: 'Confirmed'
@mont29, I believe the issue that the material datablock gets deleted, then in the node editor
snode->id
is updated butsnode->nodetree
pointing to the embedded node tree ofsnode->id
is not.snode->nodetree
has a dual purpose that is quite weak. It can either point to the embedded nodetree ofsnode->id
, or to a node group. And depending on that the user counting is different. For the embedded case, lib query should not iterate over it I think, there's nothing useful that can be done with that pointer without also knowingsnode->id
.This seems to work, but it's unclear to me if updating pointers here is OK.
Maybe a better solution would be to set
snode->nodetree
andpath->nodetree
always toNULL
for the embedded nodetree case, and instead have an accessor for every place that needs to read it.Uuuuuhhhh.... I'd really rather avoid that kind of super-hacky things in that code, it's kind of violating the whole design (though it would probably work fine in all current usecases)...
I'll try just removing the 'embedded' flag, since this is actually wrong here (those nodetrees are not owned by, embedded in the editor). If that does not works, and on the longer run in any case, I think we should rather have accessors for those indeed, assuming that NULL pointer == use embedded tree from id...
This issue was referenced by
4e1a6b48e7
Changed status from 'Confirmed' to: 'Resolved'
Added subscriber: @dharkness