Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_user_signal with empty array causes crash #90629

Closed
zaevi opened this issue Apr 13, 2024 · 4 comments · Fixed by #90631
Closed

add_user_signal with empty array causes crash #90629

zaevi opened this issue Apr 13, 2024 · 4 comments · Fixed by #90631

Comments

@zaevi
Copy link
Contributor

zaevi commented Apr 13, 2024

Tested versions

  • latest - v4.3.dev.mono.custom_build [029aade]

System information

Win11

Issue description

Calling add_user_signal with empty array (by default) causes engine crash:

CrashHandlerException: Program crashed
Engine version: Godot Engine v4.3.dev.mono.custom_build (029aadef563fb69cf49aa9795b62f27171f8c3f4)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] Variant::operator Dictionary (C:\Users\zaevi\source\Godot\godot-source\core\variant\variant.cpp:2126)
[1] Object::_add_user_signal (C:\Users\zaevi\source\Godot\godot-source\core\object\object.cpp:1238)
[2] call_with_variant_args_helper<Object,String const &,Array const &,0,1> (C:\Users\zaevi\source\Godot\godot-source\co)
[3] call_with_variant_args_dv<Object,String const &,Array const &> (C:\Users\zaevi\source\Godot\godot-source\core\varia)
[4] MethodBindT<Object,String const &,Array const &>::call (C:\Users\zaevi\source\Godot\godot-source\core\object\method)
[5] GDScriptFunction::call (C:\Users\zaevi\source\Godot\godot-source\modules\gdscript\gdscript_vm.cpp:1830)
[6] GDScriptInstance::callp (C:\Users\zaevi\source\Godot\godot-source\modules\gdscript\gdscript.cpp:1970)
[7] Node::_gdvirtual__ready_call<0> (C:\Users\zaevi\source\Godot\godot-source\scene\main\node.h:354)
[8] Node::_notification (C:\Users\zaevi\source\Godot\godot-source\scene\main\node.cpp:214)
[9] Node::_notificationv (C:\Users\zaevi\source\Godot\godot-source\scene\main\node.h:49)
[10] CanvasItem::_notificationv (C:\Users\zaevi\source\Godot\godot-source\scene\main\canvas_item.h:45)
[11] Control::_notificationv (C:\Users\zaevi\source\Godot\godot-source\scene\gui\control.h:48)
[12] Object::notification (C:\Users\zaevi\source\Godot\godot-source\core\object\object.cpp:902)
[13] Node::_propagate_ready (C:\Users\zaevi\source\Godot\godot-source\scene\main\node.cpp:269)
[14] Node::_propagate_ready (C:\Users\zaevi\source\Godot\godot-source\scene\main\node.cpp:260)
[15] Node::_set_tree (C:\Users\zaevi\source\Godot\godot-source\scene\main\node.cpp:3181)
[16] SceneTree::initialize (C:\Users\zaevi\source\Godot\godot-source\scene\main\scene_tree.cpp:452)
[17] OS_Windows::run (C:\Users\zaevi\source\Godot\godot-source\platform\windows\os_windows.cpp:1632)
[18] widechar_main (C:\Users\zaevi\source\Godot\godot-source\platform\windows\godot_windows.cpp:181)
[19] _main (C:\Users\zaevi\source\Godot\godot-source\platform\windows\godot_windows.cpp:206)
[20] main (C:\Users\zaevi\source\Godot\godot-source\platform\windows\godot_windows.cpp:220)
[21] WinMain (C:\Users\zaevi\source\Godot\godot-source\platform\windows\godot_windows.cpp:234)
[22] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[23] <couldn't map PC to fn name>

Steps to reproduce

func _ready():	
	add_user_signal("my_signal", [{name="arg1"}]) # ok
	add_user_signal("my_signal2") # crash

Minimal reproduction project (MRP)

N/A

@zaevi
Copy link
Contributor Author

zaevi commented Apr 13, 2024

image
It's weird that the iteration is executing even if the array is empty. Might related to #86518.

@AThousandShips

This comment was marked as outdated.

@AThousandShips
Copy link
Member

Can confirm, will dig some into the code

@AThousandShips
Copy link
Member

Found it, was a typo in the code, my bad, will push a fix momentarily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants