Blender sometimes crashes when loading a file with unregistered nodes #81419
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#81419
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: Windows 10 64 Bit
Graphics card: Nvidia Geforce GTX 750 Ti
Blender Version
Broken: 2.83.7 release
Short description of error
Sometimes when opening a file with unregistered custom nodes, Blender will crash with an
EXCEPTION_ACCESS_VIOLATION
error.Stack trace from Visual Studio:
The exception in line 2033 of node.c says that there is an access violation when reading at position
0xFFFFFFFFFFFFFFFF
.node->typeinfo
does exist (is not null), butfreefunc
(and actually most of the other attributes) point to0xdddd...
. Because of that, I think that this bug might be caused by a similar issue as described in #72833.I'm not sure if a core dump helps you, it's quite large (1GB + another GB for the .pdb file) so if you need it I can look for a way to make it available to you. I'm not a C or C++ dev so I don't know what is helpful.
EDIT: I think this crash is caused by opening files files with nodes that were registered while the file was originaly saved but not anymore.
Exact steps for others to reproduce the error
It's a bit complicated because it doesn't happen all the time. The particular file(s) where I observed this issue use nodes from an addon (Armory3D) which supports per-project custom nodes which get registered via a
on_load_post()
handler (so there is a delay between opening the file and registering the nodes). I'm not entirely sure, but it seems like the crash occurs when the nodes are registered again. The crash even occurs when unregistering the nodes before saving the file.Because of that complicated setup (addon required + project setup + custom node package) I will go without an example file. If you aren't able to find the cause without one, please tell me so that I can prepare a minimal project setup for you.
Thank you very much!
Original issue: https://github.com/armory3d/armory/issues/1890
Added subscriber: @timodriaan
Added subscriber: @OmarEmaraDev
Changed status from 'Needs Triage' to: 'Needs User Info'
We require simple instructions to investigate such issue, debugging a large add-on like this is too time consuming. I see you managed to to narrow the issue down in your upstream report. Can you create a minimal script and a blend file that reproduces this issue?
Yes, I'm on it, but I'm not sure if it will be successful since there is a lot going on in the addon code that might interfere. It's still a bit uncertain where exactly the issue is caused, but I will try my best and will write again soon once I know more. I still suspect that the issue is similar to https://developer.blender.org/T72833, so it might make sense to investigate that for the time being.
Please let me know if the core dump mentioned in my original post is of any interest. Please also let me know if it isn't, so that I can finally delete it :) However I don't think I have the .pdb anymore. I also have a few screenshots of the VS debugging session at that time that I can share with you (including stack traces and some variable values at the time of encountering the exception breakpoint), however they lack a bit of context and were mostly meant for me to rember stuff I wanted to include in this report.
I doubt a core dump will be useful, so feel free to delete it. I can't replicate #72833 myself now and it is already confirmed for two years with no solution, so it would be better if we can reproduce it independently.
I tried it again and can't seem to reproduce the crash anymore, even though it's difficult to tell with certainty due to the random nature of the crashes. I also spent a few hours on creating a minimal example script, without success.
So we can probably consider this fixed. I asked in the original issue if someone else is still able to reproduce it, but if not or if there is no answer in the next few days I would say this bug report can be closed.
Thanks for your patience :)
No new answers in the linked original issue and I still can't reproduce anymore, so I think this bug report can be closed now :) Thanks again!
Changed status from 'Needs User Info' to: 'Archived'
Unfortunately I found an old file where I can still reproduce the crashes, so there still seems to be a problem when loading files with custom nodes.
Because I'm still not able to provide a small example addon where the crashes are reproducable, the best I can do is to provide you with the project files that lead to the crash if you install the original addon. It hopefully doesn't take more than five or ten minutes to set everything up:
ArmorySDK-2022-3.zip
from https:*armory.itch.io/armory3d and unzip it (or do a recursive clone of https:*github.com/armory3d/armsdk/tree/22.03, but it's slower)armory.py
file from the extracted folder as an add-on. As long as you work with the addon, keep the extracted folder at the same location.CustomNodesCrash.blend
from the following project (extract and leave the folder structure intact):Changed status from 'Archived' to: 'Needs Triage'
Changed status from 'Needs Triage' to: 'Needs User Info'
I can replicate the crash as described, but I feel like this might be due to a corrupt file which was saved when there was a bug at some point.
The question is, can we create a file from scratch that reproduces this issue?
I'm not able to reproduce it otherwise, unfortunately. So maybe it's only the file, yes.
However other users of the addon are still reporting that using nodes that are loaded and registered after a file was opened still lead to random crashes in 2.93.8, but not necessarily directly after loading the file but rather when interacting with the node tree (in various ways). Here's a crash log from a user, maybe this can help?
Perfect_Stealth.crash.txt
There are some Python exceptions at the top that I will try to fix, but I think they are rather unrelated to the crash. The actual python backtrace at the very bottom of the crash report comes from this line:
41f0ee249f/blender/arm/logicnode/arm_nodes.py (L690)
. It is executed when the user adds a node to the tree. Interestingly the C/C++ stack trace looks very similar to the one at the very top of this bug report, so it might be the same issue after all.The file that was causing the above crash was created in the last month, so it shouldn't be an incompatibility in this case.
Thanks again for your patience, I'm sorry that I can't provide you with better information.
Changed status from 'Needs User Info' to: 'Needs Triage'
Added subscriber: @lichtwerk
Cannot reproduce here
Added subscribers: @JacquesLucke, @mont29
@JacquesLucke @mont29 While we can replicate this, we still haven't been able to create simplified reproduction steps yet, but could you take a quick look at the stack trace and see if anything immediately comes to mind?
ASAN report: P2888
Based on a first look at the problem, the root issue seems to be that
node_free_type
current cannot update all nodes that have a pointer to the node type. This is also mentioned in a comment. It does not update nodes in cow copies in the depsgraph currently.This has to be redesigned a bit, but I'm not 100% sure how yet. Maybe we could just tag unregistered node types instead of actually freeing them.
The problem is probably not that there are unregistered nodes, but that you unregister nodes that are still used. Based on a quick look at the addon, it seems like you reregister some/all nodes when loading a file, is that correct? Why?
Added subscriber: @HooglyBoogly
Great that you were able to pinpoint it!
Yes, that's correct. Because Blender only allows to install addons as single .py files or from a .zip file, the addon is split into a "core" script and the SDK with the actual addon code which is loaded by the core script. We allow users to use per-project SDKs to keep the used dependecies fixed for a given project and allow them to modify it to their needs, so the nodes potentially need to be re-registered when opening files because the file might use a different SDK with a different version of the registered nodes. However I'm not the original author of that code, so I can't tell you with complete certainty, maybe there are more reasons for it. The whole thing can probably be optimized because there currently are no checks whatsoever whether this is actually required, but we probably can't get rid of it completely.
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
@JacquesLucke : do you consider this confirmed?
Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
Yeah, it's a bug. The problem is described in #81419#1337435. Would still be nice to get a simplified file to reproduce this though.