Crash: Opening a 3.3 project crashes 3.6/4.0 #114582

Closed
opened 2023-11-07 15:41:47 +01:00 by Raimund Klink · 10 comments
Contributor

System Information
Operating system: Windows-11-10.0.22631-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.01

Blender Version
Broken: version: 3.6.5, 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-11-06 20:53, hash: abe925d0c671
Worked: 3.3.12

Short description of error
Open the .blend with 3.6/4.0, it will crash immediately.

Exact steps for others to reproduce the error
Sadly I don't know what causes this, we got this .blend from a user because he couldn't upload it to our render farm.
I cleaned it up as much as I could.

**System Information** Operating system: Windows-11-10.0.22631-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.01 **Blender Version** Broken: version: 3.6.5, 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-11-06 20:53, hash: `abe925d0c671` Worked: 3.3.12 **Short description of error** Open the .blend with 3.6/4.0, it will crash immediately. **Exact steps for others to reproduce the error** Sadly I don't know what causes this, we got this .blend from a user because he couldn't upload it to our render farm. I cleaned it up as much as I could.
Raimund Klink added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2023-11-07 15:41:48 +01:00
Iliya Katushenock added the
Interest
Nodes & Physics
Interest
Compatibility
labels 2023-11-07 16:00:59 +01:00
@LukasTonne /
Member

The test file has a simulation zone in it, which does not load correctly and crashes (storage of the sim zone input node is null).

Simulation zones were introduced in 3.6, so i doubt the file is originally from 3.3. I could reproduce the same issue when adding a simulation zone in 3.6, loading the file in 3.3 and saving in that version. It will then crash in 3.6 and 4.0, for the same reason.

This is a limitation of forward versioning. The new sim zone input node type is set as "Undefined" when loading in 3.3, but saving it again will keep the node type identifier. This feature works well for custom nodes which may not be defined due to a missing library or similar, so trying to restore the node on loading makes sense. Custom nodes store all custom data in ID properties, which can be loaded and re-saved without full type knowledge. But for built-in nodes this behavior causes broken data when jumping back and forth between versions.

We might do a similar thing as with unknown built-in socket types (#114401), but i have to discuss this with core devs.

The test file has a simulation zone in it, which does not load correctly and crashes (`storage` of the sim zone input node is null). Simulation zones were introduced in 3.6, so i doubt the file is originally from 3.3. I could reproduce the same issue when adding a simulation zone in 3.6, loading the file in 3.3 and saving in that version. It will then crash in 3.6 and 4.0, for the same reason. This is a limitation of forward versioning. The new sim zone input node type is set as "Undefined" when loading in 3.3, but saving it again will keep the node type identifier. This feature works well for custom nodes which may not be defined due to a missing library or similar, so trying to restore the node on loading makes sense. Custom nodes store all custom data in ID properties, which can be loaded and re-saved without full type knowledge. But for built-in nodes this behavior causes broken data when jumping back and forth between versions. We might do a similar thing as with unknown built-in socket types (#114401), but i have to discuss this with core devs.
Member

@JacquesLucke @brecht
Any opinion on this matter? Should we remove unknown built-in nodes from on loading in 3.x to prevent saving invalid data, or is switching versions like this simply unsupported?

@JacquesLucke @brecht Any opinion on this matter? Should we remove unknown built-in nodes from on loading in 3.x to prevent saving invalid data, or is switching versions like this simply unsupported?

I think we should not crash one way or the other.

Perhaps we can just remove nodes that need storage but are missing it? Where bNodeType.storagename is non-empty and bNode.storage is null.

I think we should not crash one way or the other. Perhaps we can just remove nodes that need storage but are missing it? Where `bNodeType.storagename` is non-empty and `bNode.storage` is null.
Member

Perhaps we can just remove nodes that need storage but are missing it?

I would suggest to just discard any unknown built-in node types (custom nodes are left untouched).

In #114401 i initially also just discarded sockets that use default_value and tried to keep the rest working (there are a few socket types that don't use default_value). But that assumes that such built-in sockets can still be fully serialized without knowing their type. We changed it to simply discard any unknown builtin socket type, whether it uses default_value or not, since we cannot guarantee that such data can be deserialized and serialized again properly.

> Perhaps we can just remove nodes that need storage but are missing it? I would suggest to just discard any unknown built-in node types (custom nodes are left untouched). In #114401 i initially also just discarded sockets that use `default_value` and tried to keep the rest working (there are a few socket types that don't use `default_value`). But that assumes that such built-in sockets can still be fully serialized without knowing their type. We changed it to simply discard any unknown builtin socket type, whether it uses `default_value` or not, since we cannot guarantee that such data can be deserialized and serialized again properly.

I think it's good to have some node visible the node graph to indicate that there used to be something there. I don't think keeping the node type is important, but keeping the node name and position can be helpful for a user to see that something went wrong and/or manually fix things.

I think it's good to have some node visible the node graph to indicate that there used to be something there. I don't think keeping the node type is important, but keeping the node name and position can be helpful for a user to see that something went wrong and/or manually fix things.
Member

That's true, but the issue i ran into with the sockets was that handling an unknown type is not something the various node systems necessarily support. We'll need to make sure that unknown node/socket types (at least the special NodeTypeUndefined) is handled properly by renderers, compositors, geonodes, etc. instead of just crashing. No point in being able to do a round trip if the file just crashes in 4.0 eventually. This should be a supported graceful failure case, but i don't think there are any actual tests since it doesn't come up during regular use.

That's true, but the issue i ran into with the sockets was that handling an unknown type is not something the various node systems necessarily support. We'll need to make sure that unknown node/socket types (at least the special `NodeTypeUndefined`) is handled properly by renderers, compositors, geonodes, etc. instead of just crashing. No point in being able to do a round trip if the file just crashes in 4.0 eventually. This _should_ be a supported graceful failure case, but i don't think there are any actual tests since it doesn't come up during regular use.
Member

On second thought: It should be easier to do this with nodes than with sockets. The NodeTypeUndefined is already handled, so if i replace unknown nodes with that type it should work. Socket types don't have an equivalent "undefined" type that is universally supported.

On second thought: It should be easier to do this with nodes than with sockets. The `NodeTypeUndefined` is already handled, so if i replace unknown nodes with that type it should work. Socket types don't have an equivalent "undefined" type that is universally supported.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-11-13 16:20:56 +01:00
Blender Bot added
Status
Confirmed
and removed
Status
Resolved
labels 2023-11-13 18:57:02 +01:00

I had to revert the fix for this, since it breaks versioning. It would check if the type exists before versioning runs, but versioning might change it to a new type.

I had to revert the fix for this, since it breaks versioning. It would check if the type exists before versioning runs, but versioning might change it to a new type.

I think the code from the PR can move from ntree_blend_read_data to ntree_blend_read_after_liblink. This is also where it sets node->typeinfo, so that means at this point the node->type is expected to be correct. I also checked that versioning code for changes to node->type is all happening before lib linking, and not after lib linking.

I think the code from the PR can move from `ntree_blend_read_data` to `ntree_blend_read_after_liblink`. This is also where it sets `node->typeinfo`, so that means at this point the `node->type` is expected to be correct. I also checked that versioning code for changes to `node->type` is all happening before lib linking, and not after lib linking.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-01-09 18:28:14 +01:00
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#114582
No description provided.