frequent repeatable crashes when rendering some files #40033

Closed
opened 2014-05-05 18:18:36 +02:00 by bassam kurdali · 21 comments
Member

System Information
LInux 64bit (fedora 20) Intel CPU, nvidia GPU

Blender Version
Broken: 2.70.? f93bc76,
Worked: 2.70a

Short description of error
Specific Files crash on render

Exact steps for others to reproduce the error
Download the file
Load it (even with factory settings and no autorun python scripts)
press F12
crash!

**System Information** LInux 64bit (fedora 20) Intel CPU, nvidia GPU **Blender Version** Broken: 2.70.? f93bc76, Worked: 2.70a **Short description of error** Specific Files crash on render **Exact steps for others to reproduce the error** Download the [file ](http://urchn.org/tube/a1s48light_packed.blend) Load it (even with factory settings and no autorun python scripts) press F12 crash!
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @BassamKurdali

Added subscriber: @BassamKurdali

Added subscribers: @LukasTonne, @brecht

Added subscribers: @LukasTonne, @brecht

I can confirm the problem, this file contains an invalid UV Map node in STunnelConcrete_local_fake, and that node type did not exist yet in 2.70a.

What I suspect happened is that this file was saved in a recent git version, and then saved with 2.70a or some other earlier version that did not support the UV Map node. When you do that it seems to crash.

@LukasTonne: node->storage is NULL after this, not sure how best to handle this. Here is a trick to make such nodes with invalid storage undefined, but I'm not sure it's a valid assumption that any node that defines a storage name also needs to have the storage pointer actually set.

P56: (An Untitled Masterwork)

diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 38dd36b..97bcdc0 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -172,6 +172,11 @@ static void ntree_set_typeinfo(bNodeTree *ntree, bNodeTreeType *typeinfo)
 
 static void node_set_typeinfo(const struct bContext *C, bNodeTree *ntree, bNode *node, bNodeType *typeinfo)
 {
+	/* for nodes saved in older versions storage can get lost, make undefined then */
+	if (node->flag & NODE_INIT)
+		if (typeinfo && typeinfo->storagename- [x] && !node->storage)
+			typeinfo = NULL;
+
 	if (typeinfo) {
 		node->typeinfo = typeinfo;
 		

I can confirm the problem, this file contains an invalid UV Map node in STunnelConcrete_local_fake, and that node type did not exist yet in 2.70a. What I suspect happened is that this file was saved in a recent git version, and then saved with 2.70a or some other earlier version that did not support the UV Map node. When you do that it seems to crash. @LukasTonne: `node->storage` is `NULL` after this, not sure how best to handle this. Here is a trick to make such nodes with invalid storage undefined, but I'm not sure it's a valid assumption that any node that defines a storage name also needs to have the storage pointer actually set. [P56: (An Untitled Masterwork)](https://archive.blender.org/developer/P56.txt) ``` diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 38dd36b..97bcdc0 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -172,6 +172,11 @@ static void ntree_set_typeinfo(bNodeTree *ntree, bNodeTreeType *typeinfo) static void node_set_typeinfo(const struct bContext *C, bNodeTree *ntree, bNode *node, bNodeType *typeinfo) { + /* for nodes saved in older versions storage can get lost, make undefined then */ + if (node->flag & NODE_INIT) + if (typeinfo && typeinfo->storagename- [x] && !node->storage) + typeinfo = NULL; + if (typeinfo) { node->typeinfo = typeinfo; ```
Member

Hrrrm, this is nasty. @brecht's observation is correct: This happens when re-saving undefined node types, which are then expected to have full data after loading in more recent versions.

I added some code to prevent loss of undefined nodes when loading files. This happened before pynodes too, but in those days it always meant a version regression, so was fairly safe to simply remove such nodes.

With pynodes an undefined node type can also mean that you defined that node in a script which hasn't been run yet or had some error. In that case you wouldn't want to blatantly remove all the nodes and links, but rather keep a dummy around until the problem is fixed and the types become known.

The difference between the two is the use of bNode->storage data, which only works for classic DNA hardcoded nodes, it cannot be restored for undefined nodes (in principle we could keep a single memory block around, but that would only work in the simplest cases and easily cause trouble with potential future do_versions).

I agree with @brecht's solution, make such nodes undefined so the user can recover from mistakes manually and fix node setups at least. The only other option i think would be deleting such nodes as we did before pynodes, but that is more destructive for no real reason.

Hrrrm, this is nasty. @brecht's observation is correct: This happens when re-saving undefined node types, which are then expected to have full data after loading in more recent versions. I added some code to prevent loss of undefined nodes when loading files. This happened before pynodes too, but in those days it __always__ meant a version regression, so was fairly safe to simply remove such nodes. With pynodes an undefined node type can also mean that you defined that node in a script which hasn't been run yet or had some error. In that case you wouldn't want to blatantly remove all the nodes and links, but rather keep a dummy around until the problem is fixed and the types become known. The difference between the two is the use of bNode->storage data, which only works for classic DNA hardcoded nodes, it cannot be restored for undefined nodes (in principle we could keep a single memory block around, but that would only work in the simplest cases and easily cause trouble with potential future do_versions). I agree with @brecht's solution, make such nodes undefined so the user can recover from mistakes manually and fix node setups at least. The only other option i think would be deleting such nodes as we did before pynodes, but that is more destructive for no real reason.
Author
Member

thanks both of you! at least this helps me fix the file and go forward.
not sure why the file was opened in an old version - was probably me hoping between computers.

thanks both of you! at least this helps me fix the file and go forward. not sure why the file was opened in an old version - was probably me hoping between computers.
Author
Member

Cool! removed/fixed: for the record, here were my steps:
1- open the file in 2.70a, remove the node, save out a second version (just in case other compatibility changes would be affected)
2- open the file in master, create a cube with a blank material, link material from cube to the original object with the bad node
3- save and reload the file: now the zero user dangerous material doesn't get saved, so the material browser won't crash blender
4- append the fixed material from step 1 and apply it to the object.

Cool! removed/fixed: for the record, here were my steps: 1- open the file in 2.70a, remove the node, save out a second version (just in case other compatibility changes would be affected) 2- open the file in master, create a cube with a blank material, link material from cube to the original object with the bad node 3- save and reload the file: now the zero user dangerous material doesn't get saved, so the material browser won't crash blender 4- append the fixed material from step 1 and apply it to the object.

This issue was referenced by blender/blender-addons-contrib@79c345acc2

This issue was referenced by blender/blender-addons-contrib@79c345acc21b2b82dfdfe6cf4c8606a07c90e434

This issue was referenced by 79c345acc2

This issue was referenced by 79c345acc21b2b82dfdfe6cf4c8606a07c90e434
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit 79c345acc2.

Closed by commit 79c345acc2.
Author
Member

Hey Brecht, Lukas,
Can you reopen the bug?
the same file crashes again, since the following commit:
https://developer.blender.org/rB8b8d5a441f5815e83f83bacf8023e2cc3fbb2a04
somehow Image use alpha causes the file to crash. (with no changes in the file)
reverting to a commit or two earlier (I think it is a freestyle commit) causes the file not to crash again.
cheers,
Bassam

Hey Brecht, Lukas, Can you reopen the bug? the same file crashes again, since the following commit: https://developer.blender.org/rB8b8d5a441f5815e83f83bacf8023e2cc3fbb2a04 somehow Image use alpha causes the file to crash. (with no changes in the file) reverting to a commit or two earlier (I think it is a freestyle commit) causes the file not to crash again. cheers, Bassam

@BassamKurdali: that crash should be fixed now in {edd78fb3085e}.

@BassamKurdali: that crash should be fixed now in {edd78fb3085e}.
Author
Member

In addition, a bunch of math nodes
are now showing up as undefined
in the material local_tunnel_emit
there are a bunch of simple math nodes
they are all undefined{F87610}

undefined.png

In addition, a bunch of math nodes are now showing up as undefined in the material local_tunnel_emit there are a bunch of simple math nodes they are all undefined{[F87610](https://archive.blender.org/developer/F87610/old_nodes.png)} ![undefined.png](https://archive.blender.org/developer/F87611/undefined.png)

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'
Lukas Tönne was assigned by Brecht Van Lommel 2014-05-07 19:43:56 +02:00

This issue was referenced by blender/blender-addons-contrib@3a8f1d5d8b

This issue was referenced by blender/blender-addons-contrib@3a8f1d5d8b8a95e9b3750d941fda1f8fcb549518

This issue was referenced by 3a8f1d5d8b

This issue was referenced by 3a8f1d5d8b8a95e9b3750d941fda1f8fcb549518

Ok, that problem should be fixed now as well.

Ok, that problem should be fixed now as well.
Author
Member

yay!!! brecht and lukas you rule :)

yay!!! brecht and lukas you rule :)
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

@brecht Thanks for all the fixes! Will close the task again now, can reopen in the unlikely event that there is still a problem.

@brecht Thanks for all the fixes! Will close the task again now, can reopen in the unlikely event that there is still a problem.
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#40033
No description provided.