Crash if you assign an empty name to the node group interface. #113860

Closed
opened 2023-10-17 19:22:27 +02:00 by ugorek · 3 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1650/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.23

Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-10-17 09:01, hash: 6b0769c448c8

Short description of error
Setting the interface name via API to "" will lead to an immediate crash.

Exact steps for others to reproduce the error
Get a group of nodes and execute the code:

bpy.data.node_groups["Geometry Nodes"].interface.items_tree[0].name = ""
**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1650/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.23 **Blender Version** Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-10-17 09:01, hash: `6b0769c448c8` **Short description of error** Setting the interface name via API to `""` will lead to an immediate crash. **Exact steps for others to reproduce the error** Get a group of nodes and execute the code: ```Py bpy.data.node_groups["Geometry Nodes"].interface.items_tree[0].name = "" ```
ugorek added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-10-17 19:22:27 +02:00
Iliya Katushenock added the
Interest
Nodes & Physics
Interest
Python API
labels 2023-10-17 19:25:46 +02:00
Member

Thanks for the report!


@LukasTonne The crash is in declaration_for_interface_socket and can be fixed like this:

dst->name = io_socket.name ? io_socket.name : "";

However, then an assert checking that the name is not null fails. I wonder if we should protect from an empty name at a higher level? Or maybe it would be nice to just allow it.

Thanks for the report! --- @LukasTonne The crash is in `declaration_for_interface_socket` and can be fixed like this: `dst->name = io_socket.name ? io_socket.name : "";` However, then an assert checking that the name is not null fails. I wonder if we should protect from an empty name at a higher level? Or maybe it would be nice to just allow it.
Hans Goudey added
Priority
High
Type
Bug
and removed
Priority
Normal
Type
Report
labels 2023-10-19 09:44:43 +02:00
Lukas Tönne self-assigned this 2023-10-19 10:00:36 +02:00
Member

Thanks @HooglyBoogly, i will apply that fix. Neither the socket nor interface socket name have to be unique and they can be empty, so i don't think there's any point in higher level checks. The UI just generates nullptrs for empty strings, which is incompatible with std::string assignment. Unfortunate, but it is what it is.

Thanks @HooglyBoogly, i will apply that fix. Neither the socket nor interface socket name have to be unique and they can be empty, so i don't think there's any point in higher level checks. The UI just generates nullptrs for empty strings, which is incompatible with std::string assignment. Unfortunate, but it is what it is.
Member

There are places in the code where name != nullptr is asserted and some more where dangerous assignment takes place. I guess i have to go over these and make sure nullptr is supported.

There are places in the code where `name != nullptr` is asserted and some more where dangerous assignment takes place. I guess i have to go over these and make sure nullptr is supported.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-10-19 11:48:23 +02: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
3 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#113860
No description provided.