Godot version: 3.1.1
OS/device including version: Manjaro (kernel 5.2.11-1-MANJARO, fully updated today)
Issue description:
When running game a from the editor, whole game crashes (as in a game window closes, crash is not intercepted by the editor, so I don't know on which exactly it crashed) and in the console (the terminal from which editor was launched, there is nothing useful in the editor itself, only Debug Process Stopped) is seemingly random, every time different, backtrace:
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] /usr/lib/libc.so.6(+0x3a7e0) [0x7f932df5b7e0] (??:0)
[2] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x2443d75] (??:?)
[3] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x1020137] (<artificial>:?)
[4] [0x7f928cfca870] (??:0)
-- END OF BACKTRACE --
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] /usr/lib/libc.so.6(+0x3a7e0) [0x7f9c580bb7e0] (??:0)
[2] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x2434a20] (??:?)
[3] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x208aef5] (??:?)
[4] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0xdae05b] (??:?)
[5] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x8f96c7] (??:?)
[6] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0xd54d58] (<artificial>:?)
[7] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x219621f] (??:?)
[8] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x249e9ce] (??:?)
[9] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x909412] (??:?)
[10] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0xd54c80] (<artificial>:?)
[11] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x16d80df] (??:?)
[12] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x1da5ac8] (<artificial>:?)
[13] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x214b574] (??:?)
[14] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x166dfce] (<artificial>:?)
[15] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x167b98f] (??:?)
[16] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0xdfaf35] (??:?)
[17] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x7c541d] (??:?)
[18] /usr/lib/libc.so.6(__libc_start_main+0xf3) [0x7f9c580a7ee3] (??:0)
[19] /home/xxx/apps/Godot_v3.1.1-stable/Godot_v3.1.1-stable_x11.64() [0x7d2c1e] (??:?)
-- END OF BACKTRACE --
ERROR: _get_socket_error: Socket error: 104
At: drivers/unix/net_socket_posix.cpp:199.
Steps to reproduce:
I strongly suspect it has to do something with freeing resources. This crash happens shortly after level is restarted (old level node is freed and a new duplicate of a level is instantiated).
I added this check to avoid "ordinary" previously freed instance crash into editor:
func node_not_freed(node: Node2D) -> bool:
return get_tree().get_root().has_node(node.get_path())
if Utils.node_not_freed(waypoints):
target_position = waypoints.get_next_point_position()
Even if this is a result of user's fault (most probably is), it still should not crash the game entirely without showing it in the editor.
You can use is_instance_valid() to check whether the node is not freed.
You can use is_instance_valid() to check whether the node is not freed.
Thank you, good to know.
I figured out what was wrong with my setup:
After some changes in editor (renaming or moving nodes), NodePath properties got corrupted - e.g. instead ../Waypoints1 it became ../../../MovingPlatformLevel/Terrain/Waypoints1, after fixing it (selecting nodes again in properties in editor) all works (no need to check if waypoints were freed).
Nevertheless, I still believe this issue stands - the game should not silently crash without editor going into debug mode and showing on what it crashed.
Actually, a reproduction project could be helpful. Normally there's a proper error when you call something on a freed object, so not sure what happened in your case.

Yeah, I should have run editor with gdb attached when I was getting the crash :disappointed:, I am not sure if I have the problematic project state backed up (it was not only code of a script, the property of type NodePath were somehow broken and only in a second instantiation it crashed, even though both node paths should be correct [pointing at a same node]). I'll try recreate it.
I tried for like an hour and wasn't able to replicate the crash. My repro was probably too small, the crash occurred in a real game (async loading, much more nodes and much more demanding scripts/physics stuff). I am reasonably sure it crashed in has_node or get_path, but I have no idea how engine failed to mark waypoints variable in moving platform node as not freed and tried to access freed memory (at least that looks to me the signal 11 - segfaul). Probably no reason leaving this issue open, it doesn't seem to be easily replicable and I wasted enough time already...
Most helpful comment
You can use
is_instance_valid()to check whether the node is not freed.