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

4.3 dev6 C# Clearing a dictionary, then creating a new one on an exported property in the inspector crashes the editor #92340

Closed
TravisZovko opened this issue May 24, 2024 · 1 comment · Fixed by #92351

Comments

@TravisZovko
Copy link

Tested versions

  • Reproducible in v4.3.dev6.mono.official [89850d5]
  • Not reproducible in v4.2.2.stable.mono.official [15073af]

System information

Godot v4.3.dev6.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated Radeon RX 590 Series (Advanced Micro Devices, Inc.; 31.0.21912.14) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

Issue description

I have a scene with a Node with an attached C# script that exports a Godot.Collections.Dictionary.
In the inspector for that Node, if I create a new Dictionary in the exported property, then delete it, then create a new dictionary, the editor crashes. This crash does not occur in 4.2.

Steps to reproduce

  • Create a Node and attach a C# script which exports a Dictionary, like so:
public partial class NodeWithExportedDictionary : Node
{
	[Export]
	public Godot.Collections.Dictionary<Vector2I, string> MyDict { get; set; }

	[Export]
	public Godot.Collections.Dictionary MyOtherDict { get; set; }
}
  • In the inspector, click on the spot marked 'Dictionary (nil) to add a new dictionary.
  • Erase the Dictionary by clicking the 'revert to default' arrow next to the property.
  • Click to add a new dictionary again. The editor crashes after a second when I do this on my machine.

Minimal reproduction project (MRP)

DictionaryExportBug.zip

@raulsntos
Copy link
Member

I can reproduce in v4.3.dev.mono.custom_build [ffc41fb]. Here's a stacktrace:

* thread #1, name = 'godot.linuxbsd.', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x2f0)
  * frame #0: 0x000055555dc511d8 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Node::add_child(this=0x0000000000000000, p_child=0x000055557d576510, p_force_readable_name=false, p_internal=INTERNAL_MODE_DISABLED) at node.cpp:1557:2
    frame #1: 0x000055555c9c4af4 godot.linuxbsd.editor.dev.x86_64.llvm.mono`EditorPropertyDictionary::_create_new_property_slot(this=0x000055557cc4e2b0, p_idx=0) at editor_properties_array_dict.cpp:907:28
    frame #2: 0x000055555c9c5980 godot.linuxbsd.editor.dev.x86_64.llvm.mono`EditorPropertyDictionary::update_property(this=0x000055557cc4e2b0) at editor_properties_array_dict.cpp:999:5
    frame #3: 0x000055555c9c75dd godot.linuxbsd.editor.dev.x86_64.llvm.mono`EditorPropertyDictionary::_edit_pressed(this=0x000055557cc4e2b0) at editor_properties_array_dict.cpp:1114:2
    frame #4: 0x000055555cb64099 godot.linuxbsd.editor.dev.x86_64.llvm.mono`void call_with_variant_args_helper<EditorPropertyDictionary>(p_instance=0x000055557cc4e2b0, p_method=(godot.linuxbsd.editor.dev.x86_64.llvm.mono`EditorPropertyDictionary::_edit_pressed() at editor_properties_array_dict.cpp:1106), p_args=0x0000000000000000, r_error=0x00007fffffff7608, (null)=IndexSequence<> @ 0x00007fffffff7118) at binder_common.h:304:2
    frame #5: 0x000055555cb64009 godot.linuxbsd.editor.dev.x86_64.llvm.mono`void call_with_variant_args<EditorPropertyDictionary>(p_instance=0x000055557cc4e2b0, p_method=(godot.linuxbsd.editor.dev.x86_64.llvm.mono`EditorPropertyDictionary::_edit_pressed() at editor_properties_array_dict.cpp:1106), p_args=0x0000000000000000, p_argcount=0, r_error=0x00007fffffff7608) at binder_common.h:418:2
    frame #6: 0x000055555cb63ed5 godot.linuxbsd.editor.dev.x86_64.llvm.mono`CallableCustomMethodPointer<EditorPropertyDictionary>::call(this=0x0000555565628ce0, p_arguments=0x0000000000000000, p_argcount=0, r_return_value=0x00007fffffff75f0, r_call_error=0x00007fffffff7608) const at callable_method_pointer.h:103:3
    frame #7: 0x0000555560ab4386 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Callable::callp(this=0x00007fffffff74d0, p_arguments=0x0000000000000000, p_argcount=0, r_return_value=0x00007fffffff75f0, r_call_error=0x00007fffffff7608) const at callable.cpp:57:11
    frame #8: 0x0000555560ef0140 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Object::emit_signalp(this=0x000055557cc4efd0, p_name=0x0000555562cebe30, p_args=0x0000000000000000, p_argcount=0) at object.cpp:1219:13
    frame #9: 0x000055555dc825f1 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Node::emit_signalp(this=0x000055557cc4efd0, p_name=0x0000555562cebe30, p_args=0x0000000000000000, p_argcount=0) at node.cpp:3884:17
    frame #10: 0x000055555b7ba903 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Error Object::emit_signal<>(this=0x000055557cc4efd0, p_name=0x0000555562cebe30) at object.h:936:10
    frame #11: 0x000055555de5c676 godot.linuxbsd.editor.dev.x86_64.llvm.mono`BaseButton::_pressed(this=0x000055557cc4efd0) at base_button.cpp:137:2
    frame #12: 0x000055555de5c310 godot.linuxbsd.editor.dev.x86_64.llvm.mono`BaseButton::on_action_event(this=0x000055557cc4efd0, p_event=Ref<InputEvent> @ 0x00007fffffff7a08) at base_button.cpp:167:5
    frame #13: 0x000055555de5bfba godot.linuxbsd.editor.dev.x86_64.llvm.mono`BaseButton::gui_input(this=0x000055557cc4efd0, p_event=0x00007fffffff7bc8) at base_button.cpp:68:3
    frame #14: 0x000055555deebb82 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Control::_call_gui_input(this=0x000055557cc4efd0, p_event=0x00007fffffff7bc8) at control.cpp:1825:2
    frame #15: 0x000055555dcaf3d6 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Viewport::_gui_call_input(this=0x000055556433c770, p_control=0x000055557cc4efd0, p_input=0x00007fffffff8e08) at viewport.cpp:1557:14
    frame #16: 0x000055555dcb10e0 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Viewport::_gui_input_event(this=0x000055556433c770, p_event=Ref<InputEvent> @ 0x00007fffffff91b8) at viewport.cpp:1826:64
    frame #17: 0x000055555dcbc1d0 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Viewport::push_input(this=0x000055556433c770, p_event=0x00007fffffffb418, p_local_coords=false) at viewport.cpp:3248:3
    frame #18: 0x000055555dcbadcc godot.linuxbsd.editor.dev.x86_64.llvm.mono`Window::_window_input(this=0x000055556433c770, p_ev=0x00007fffffffb418) at window.cpp:1628:3
    frame #19: 0x000055555de38d6f godot.linuxbsd.editor.dev.x86_64.llvm.mono`void call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul>(p_instance=0x000055556433c770, p_method=(godot.linuxbsd.editor.dev.x86_64.llvm.mono`Window::_window_input(Ref<InputEvent> const&) at window.cpp:1580), p_args=0x00007fffffffb8a0, r_error=0x00007fffffffb888, (null)=IndexSequence<0UL> @ 0x00007fffffffb448) at binder_common.h:304:2
    frame #20: 0x000055555de38cb9 godot.linuxbsd.editor.dev.x86_64.llvm.mono`void call_with_variant_args<Window, Ref<InputEvent> const&>(p_instance=0x000055556433c770, p_method=(godot.linuxbsd.editor.dev.x86_64.llvm.mono`Window::_window_input(Ref<InputEvent> const&) at window.cpp:1580), p_args=0x00007fffffffb8a0, p_argcount=1, r_error=0x00007fffffffb888) at binder_common.h:418:2
    frame #21: 0x000055555de38b7d godot.linuxbsd.editor.dev.x86_64.llvm.mono`CallableCustomMethodPointer<Window, Ref<InputEvent> const&>::call(this=0x0000555573defd50, p_arguments=0x00007fffffffb8a0, p_argcount=1, r_return_value=0x00007fffffffba18, r_call_error=0x00007fffffffb888) const at callable_method_pointer.h:103:3
    frame #22: 0x0000555560ab4386 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Callable::callp(this=0x00007fffffffba38, p_arguments=0x00007fffffffb8a0, p_argcount=1, r_return_value=0x00007fffffffba18, r_call_error=0x00007fffffffb888) const at callable.cpp:57:11
    frame #23: 0x000055555ac59c54 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Variant Callable::call<Ref<InputEvent>>(this=0x00007fffffffba38, p_args=Ref<InputEvent> @ 0x00007fffffffba10) const at variant.h:875:2
    frame #24: 0x000055555ac48f4d godot.linuxbsd.editor.dev.x86_64.llvm.mono`DisplayServerX11::_dispatch_input_event(this=0x0000555562126b10, p_event=0x00007fffffffc548) at display_server_x11.cpp:4025:14
    frame #25: 0x000055555ac48bed godot.linuxbsd.editor.dev.x86_64.llvm.mono`DisplayServerX11::_dispatch_input_events(p_event=0x00007fffffffc548) at display_server_x11.cpp:4001:52
    frame #26: 0x0000555560a22f42 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Input::_parse_input_event_impl(this=0x0000555561c1f6a0, p_event=0x00007fffffffc548, p_is_emulated=false) at input.cpp:773:3
    frame #27: 0x0000555560a1ec34 godot.linuxbsd.editor.dev.x86_64.llvm.mono`Input::flush_buffered_events(this=0x0000555561c1f6a0) at input.cpp:1044:3
    frame #28: 0x000055555ac4e7d5 godot.linuxbsd.editor.dev.x86_64.llvm.mono`DisplayServerX11::process_events(this=0x0000555562126b10) at display_server_x11.cpp:5123:26
    frame #29: 0x000055555ac1995c godot.linuxbsd.editor.dev.x86_64.llvm.mono`OS_LinuxBSD::run(this=0x00007fffffffd508) at os_linuxbsd.cpp:958:35
    frame #30: 0x000055555ac0d995 godot.linuxbsd.editor.dev.x86_64.llvm.mono`main(argc=4, argv=0x00007fffffffdb28) at godot_linuxbsd.cpp:85:6
    frame #31: 0x00007ffff7c29d90 libc.so.6`__libc_start_call_main(main=(godot.linuxbsd.editor.dev.x86_64.llvm.mono`main at godot_linuxbsd.cpp:56), argc=4, argv=0x00007fffffffdb28) at libc_start_call_main.h:58:16
    frame #32: 0x00007ffff7c29e40 libc.so.6`__libc_start_main_impl(main=(godot.linuxbsd.editor.dev.x86_64.llvm.mono`main at godot_linuxbsd.cpp:56), argc=4, argv=0x00007fffffffdb28, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffdb18) at libc-start.c:392:3
    frame #33: 0x000055555ac0d6e5 godot.linuxbsd.editor.dev.x86_64.llvm.mono`_start + 37

It looks like the regression was introduced by 0331ecb. cc @ajreckof

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.

3 participants