godot: tree_exited signal callbacks are run in the editor even when the script is not "tool", can cause editor crash

Godot version: 3.1-stable_X11.64

OS/device including version: Solus 3.9999 Gnome Nvidia GTX 1050TI

Issue description:

Randomly when I switch between scenes Godot crashes, the only thing on the terminal when this happens is:

ERROR: _load: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: scene/resources/dynamic_font.cpp:149.
ERROR: _get_modified_time: Failed to get modified time for: 
   At: drivers/unix/file_access_unix.cpp:292.
ERROR: _load: No loader found for resource: res://
   At: core/io/resource_loader.cpp:285.
malloc(): smallbin double linked list corrupted

I am using GLES2

Minimal reproduction project:

It’s not minimal but can give enough context mooncheeser source.zip

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 3
  • Comments: 17 (17 by maintainers)

Most upvoted comments

A reproducible backtrace with your recipe;) https://github.com/godotengine/godot/issues/27125#issuecomment-473578498

godot3 -e
OpenGL ES 3.0 Renderer: AMD Radeon HD 7700 Series (CAPE VERDE, DRM 3.23.0, 4.15.0-46-generic, LLVM 7.0.0)
ERROR: emit_signal: Error calling method from signal 'node_added': 'CanvasItemEditor::_tree_changed': Cannot convert argument 1 from Object to Object.
   At: core/object.cpp:1238.
ERROR: add_node: Condition ' !p_node->is_inside_tree() ' is true.
   At: editor/editor_data.cpp:994.
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7fdb28596f20] (??:0)
[2] godot3() [0x24a9927] (./core/hash_map.h:330)
[3] godot3() [0x2503f95] (./core/variant.h:421)
[4] godot3() [0x103238d] (./core/cowdata.h:369)
[5] godot3() [0x1035899] (editor/scene_tree_editor.cpp:446)
[6] godot3() [0x10361a8] (./core/variant.h:421)
[7] godot3() [0xe440ce] (editor/editor_node.h:636)
[8] godot3() [0xe457eb] (editor/editor_node.cpp:2920)
[9] godot3() [0x4e1dc3] (./core/variant.h:421)
[10] godot3() [0x250775c] (core/object.cpp:942 (discriminator 1))
[11] godot3() [0x2583197] (./core/variant.h:421)
[12] godot3() [0x2583659] (core/undo_redo.cpp:333)
[13] godot3() [0x2583740] (core/undo_redo.cpp:256)
[14] godot3() [0xe2b7e3] (editor/editor_node.cpp:4200)
[15] godot3() [0x4e1dc3] (./core/variant.h:421)
[16] godot3() [0x250775c] (core/object.cpp:942 (discriminator 1))
[17] godot3() [0x2513554] (./core/variant.h:421)
[18] godot3() [0x2514775] (core/object.cpp:1285)
[19] godot3() [0x18214c6] (scene/gui/tabs.cpp:418 (discriminator 4))
[20] godot3() [0x18221d9] (scene/gui/tabs.cpp:215)
[21] godot3() [0x6d48e7] (./core/reference.h:267)
[22] godot3() [0x250851b] (./core/variant.h:421)
[23] godot3() [0x2506446] (core/object.cpp:883)
[24] godot3() [0x16ad809] (./core/variant.h:421)
[25] godot3() [0x16afb88] (./core/reference.h:285)
[26] godot3() [0x16b108d] (./core/reference.h:285)
[27] godot3() [0x16b122c] (./core/reference.h:285)
[28] godot3() [0x6d48e7] (./core/reference.h:267)
[29] godot3() [0x250775c] (core/object.cpp:942 (discriminator 1))
[30] godot3() [0x25063ae] (core/object.cpp:868)
[31] godot3() [0x167ea5f] (./core/variant.h:421)
[32] godot3() [0x1681db5] (scene/main/scene_tree.cpp:418 (discriminator 6))
[33] godot3() [0x4513f6] (./core/reference.h:285)
[34] godot3() [0x44df4d] (./core/list.h:291)
[35] godot3() [0x44133b] (platform/x11/os_x11.cpp:2462)
[36] godot3() [0x4436e0] (platform/x11/os_x11.cpp:3004)
[37] godot3(main+0xd8) [0x434e08] (platform/x11/godot_x11.cpp:55)
[38] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fdb28579b97] (??:0)
[39] godot3() [0x436dea] (??:?)
-- END OF BACKTRACE --
Aborted

I think I found the trigger for this crash, can you guys test the following @bojidar-bg and @capnm

  1. Create a new scene, pick any Node type as root
  2. Add a child
  3. Use the interface to connect the child’s tree_exited signal to the root’s queue_free method
  4. Save the scene
  5. Open a new scene
  6. Try to switch back