Python API: "NodeLink" object in 'insert_link' callback of bpy.types.Node causes crash when reading some properties. #101335

Open
opened 2022-09-24 18:55:07 +02:00 by Joseph Brandenburg · 4 comments

System Information
Operating system: Linux-5.15.65-1-MANJARO-x86_64-with-glibc2.36 64 Bits
Graphics card: NVIDIA GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 515.65.01

Blender Version
Broken: version: 3.3.0, branch: master, commit date: 2022-09-06 15:39, hash: 0759f671ce
Worked: (newest version of Blender that worked as expected)

Short description of error
Trying to dereference the properties of the sockets in the link crashes Blender.

Exception thrown: read access violation.
ntree was nullptr.
>	blender.exe!nodeFindNode(bNodeTree * ntree, bNodeSocket * sock, bNode * * r_node, int * r_sockindex) Line 2038	C++

 	blender.exe!rna_NodeSocket_node_get(PointerRNA * ptr) Line 2803	C
 	blender.exe!NodeSocket_node_get(PointerRNA * ptr) Line 46896	C
 	blender.exe!RNA_property_pointer_get(PointerRNA * ptr, PropertyRNA * prop) Line 3516	C
 	blender.exe!pyrna_prop_to_py(PointerRNA * ptr, PropertyRNA * prop) Line 1429	C
 	blender.exe!pyrna_struct_getattro(BPy_StructRNA * self, _object * pyname) Line 4287	C
 	python310_d.dll!PyObject_GetAttr(_object * v, _object * name) Line 922	C
 	python310_d.dll!_PyEval_EvalFrameDefault(_ts * tstate, _frame * f, int throwflag) Line 3593	C
 	[Inline Frame] python310_d.dll!_PyEval_EvalFrame(_ts *) Line 46	C
 	python310_d.dll!_PyEval_Vector(_ts * tstate, PyFrameConstructor * con, _object * locals, _object * const * args, unsigned __int64 argcount, _object * kwnames) Line 5072	C
 	python310_d.dll!_PyFunction_Vectorcall(_object * func, _object * const * stack, unsigned __int64 nargsf, _object * kwnames) Line 342	C
 	python310_d.dll!PyVectorcall_Call(_object * callable, _object * tuple, _object * kwargs) Line 255	C
 	python310_d.dll!_PyObject_Call(_ts * tstate, _object * callable, _object * args, _object * kwargs) Line 290	C
 	python310_d.dll!PyObject_Call(_object * callable, _object * args, _object * kwargs) Line 318	C
 	blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 8690	C
 	blender.exe!rna_Node_insert_link(bNodeTree * ntree, bNode * node, bNodeLink * link) Line 1751	C
 	blender.exe!blender::ed::space_node::node_link_exit(bContext & C, wmOperator & op, const bool apply_links) Line 899	C++
 	blender.exe!blender::ed::space_node::node_link_modal(bContext * C, wmOperator * op, const wmEvent * event) Line 1055	C++
 	blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const char * kmi_idname) Line 2380	C++
 	blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3283	C++
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3333	C++
 	blender.exe!wm_event_do_handlers(bContext * C) Line 3924	C++
 	blender.exe!WM_main(bContext * C) Line 643	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 579	C
 	[External Code]	

Exact steps for others to reproduce the error

**System Information** Operating system: Linux-5.15.65-1-MANJARO-x86_64-with-glibc2.36 64 Bits Graphics card: NVIDIA GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 515.65.01 **Blender Version** Broken: version: 3.3.0, branch: master, commit date: 2022-09-06 15:39, hash: `0759f671ce` Worked: (newest version of Blender that worked as expected) **Short description of error** Trying to dereference the properties of the sockets in the link crashes Blender. ``` Exception thrown: read access violation. ntree was nullptr. ``` ``` > blender.exe!nodeFindNode(bNodeTree * ntree, bNodeSocket * sock, bNode * * r_node, int * r_sockindex) Line 2038 C++ blender.exe!rna_NodeSocket_node_get(PointerRNA * ptr) Line 2803 C blender.exe!NodeSocket_node_get(PointerRNA * ptr) Line 46896 C blender.exe!RNA_property_pointer_get(PointerRNA * ptr, PropertyRNA * prop) Line 3516 C blender.exe!pyrna_prop_to_py(PointerRNA * ptr, PropertyRNA * prop) Line 1429 C blender.exe!pyrna_struct_getattro(BPy_StructRNA * self, _object * pyname) Line 4287 C python310_d.dll!PyObject_GetAttr(_object * v, _object * name) Line 922 C python310_d.dll!_PyEval_EvalFrameDefault(_ts * tstate, _frame * f, int throwflag) Line 3593 C [Inline Frame] python310_d.dll!_PyEval_EvalFrame(_ts *) Line 46 C python310_d.dll!_PyEval_Vector(_ts * tstate, PyFrameConstructor * con, _object * locals, _object * const * args, unsigned __int64 argcount, _object * kwnames) Line 5072 C python310_d.dll!_PyFunction_Vectorcall(_object * func, _object * const * stack, unsigned __int64 nargsf, _object * kwnames) Line 342 C python310_d.dll!PyVectorcall_Call(_object * callable, _object * tuple, _object * kwargs) Line 255 C python310_d.dll!_PyObject_Call(_ts * tstate, _object * callable, _object * args, _object * kwargs) Line 290 C python310_d.dll!PyObject_Call(_object * callable, _object * args, _object * kwargs) Line 318 C blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 8690 C blender.exe!rna_Node_insert_link(bNodeTree * ntree, bNode * node, bNodeLink * link) Line 1751 C blender.exe!blender::ed::space_node::node_link_exit(bContext & C, wmOperator & op, const bool apply_links) Line 899 C++ blender.exe!blender::ed::space_node::node_link_modal(bContext * C, wmOperator * op, const wmEvent * event) Line 1055 C++ blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const char * kmi_idname) Line 2380 C++ blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3283 C++ blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3333 C++ blender.exe!wm_event_do_handlers(bContext * C) Line 3924 C++ blender.exe!WM_main(bContext * C) Line 643 C blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 579 C [External Code] ``` **Exact steps for others to reproduce the error** - Open attached .blend file - run the script, - Create `New` Node Tree - add two nodes - connect them. Blender will crash to desktop. [custom_nodes_simple_bug_finder.blend](https://archive.blender.org/developer/F13563701/custom_nodes_simple_bug_finder.blend)

Added subscriber: @Josephbburg

Added subscriber: @Josephbburg

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Thanks for the report, I can confirm the problem.
It's not very clear to me what in the script causes the problem, but even if the error is in the script, the crash shouldn't be expected.
I tested it on 3.2 and saw the same issue, so it's not a regression.

Thanks for the report, I can confirm the problem. It's not very clear to me what in the script causes the problem, but even if the error is in the script, the crash shouldn't be expected. I tested it on 3.2 and saw the same issue, so it's not a regression.
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:43:43 +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
2 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#101335
No description provided.