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

Engine crash after freeing a player scene in a multiplayer game - suspecting AudioStreamPlayer3D #52853

Closed
unfa opened this issue Sep 19, 2021 · 10 comments · Fixed by #55544
Closed

Comments

@unfa
Copy link

unfa commented Sep 19, 2021

Godot version

b1063a7

System information

Manajro Linux KDE

Issue description

The engine crash occurs in a multiplayer game when a players scene is being freed.
The crash seems to be related to the AudioPlayer3D node (judging by the backtraces it produces), but also does not occur if there are not peers connected (single-player game).

We have a suspiction that there may be some issue with audio listeners (camera) and audio playback.
Each Player scene in this game contains a FPP camera, so freeing that scenes removes a camera node from the node tree. However in a single player game, there's still a camera being freed and it does not cause a crash...

The game map itself has also a "lobby" camera that's a fallback when no other cameras are present in the scene tree.

Demonstration, details and reproduction:
https://youtu.be/fBbXkikbQ9Q

DESTROY_PLAYER called on 911894122 by 0 regarding 911894122
before free
ERROR: Attempted to free invalid ID: 22028887261205
   at: _free_internal (drivers/vulkan/rendering_device_vulkan.cpp:8436)
ERROR: Attempted to free invalid ID: 22101901705246
   at: _free_internal (drivers/vulkan/rendering_device_vulkan.cpp:8436)
ERROR: Attempted to free invalid ID: 22007412424721
   at: _free_internal (drivers/vulkan/rendering_device_vulkan.cpp:8436)
ERROR: Attempted to free invalid ID: 22093311770652
   at: _free_internal (drivers/vulkan/rendering_device_vulkan.cpp:8436)
ERROR: Attempted to free invalid ID: 22020297326611
   at: _free_internal (drivers/vulkan/rendering_device_vulkan.cpp:8436)
ERROR: Attempted to free invalid ID: 22097606737949
   at: _free_internal (drivers/vulkan/rendering_device_vulkan.cpp:8436)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.dev.calinou (b1063a7c02c313719fed660feba544dbcd1dac89)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x3cda0) [0x7fe9d742cda0] (??:0)
[2] Node::get_viewport() const (/builds/Calinou/godot-builds-ci/godot/./scene/main/node.h:454)
[3] AudioStreamPlayer3D::_update_panning() (/builds/Calinou/godot-builds-ci/godot/scene/3d/audio_stream_player_3d.cpp:386 (discriminator 3))
[4] AudioStreamPlayer3D::_listener_changed_cb(void*) (/builds/Calinou/godot-builds-ci/godot/scene/3d/audio_stream_player_3d.h:90)
[5] AudioServer::notify_listener_changed() (/builds/Calinou/godot-builds-ci/godot/servers/audio_server.cpp:1323 (discriminator 6))
[6] Viewport::_update_audio_listener_3d() (/builds/Calinou/godot-builds-ci/godot/scene/main/viewport.cpp:3071)
[7] Viewport::_camera_3d_set(Camera3D*) (/builds/Calinou/godot-builds-ci/godot/scene/main/viewport.cpp:3172)
[8] Camera3D::clear_current(bool) (/builds/Calinou/godot-builds-ci/godot/scene/3d/camera_3d.cpp:235)
[9] Camera3D::_notification(int) (/builds/Calinou/godot-builds-ci/godot/scene/3d/camera_3d.cpp:121)
[10] Camera3D::_notificationv(int, bool) (/builds/Calinou/godot-builds-ci/godot/scene/3d/camera_3d.h:38 (discriminator 14))
[11] Object::notification(int, bool) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:843)
[12] Node3D::_notification(int) (/builds/Calinou/godot-builds-ci/godot/scene/3d/node_3d.cpp:155)
[13] Node3D::_notificationv(int, bool) (/builds/Calinou/godot-builds-ci/godot/./scene/3d/node_3d.h:51 (discriminator 14))
[14] Camera3D::_notificationv(int, bool) (/builds/Calinou/godot-builds-ci/godot/scene/3d/camera_3d.h:38)
[15] Object::notification(int, bool) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:843)
[16] Node::_propagate_exit_tree() (/builds/Calinou/godot-builds-ci/godot/scene/main/node.cpp:271)
[17] Node::_propagate_exit_tree() (/builds/Calinou/godot-builds-ci/godot/scene/main/node.cpp:260 (discriminator 2))
[18] Node::_propagate_exit_tree() (/builds/Calinou/godot-builds-ci/godot/scene/main/node.cpp:260 (discriminator 2))
[19] Node::_set_tree(SceneTree*) (/builds/Calinou/godot-builds-ci/godot/scene/main/node.cpp:2447)
[20] Node::remove_child(Node*) (/builds/Calinou/godot-builds-ci/godot/scene/main/node.cpp:1216)
[21] Node::_notification(int) (/builds/Calinou/godot-builds-ci/godot/scene/main/node.cpp:170)
[22] Node::_notificationv(int, bool) (/builds/Calinou/godot-builds-ci/godot/./scene/main/node.h:48 (discriminator 14))
[23] Node3D::_notificationv(int, bool) (/builds/Calinou/godot-builds-ci/godot/./scene/3d/node_3d.h:51)
[24] CollisionObject3D::_notificationv(int, bool) (/builds/Calinou/godot-builds-ci/godot/./scene/3d/collision_object_3d.h:38)
[25] PhysicsBody3D::_notificationv(int, bool) (/builds/Calinou/godot-builds-ci/godot/scene/3d/physics_body_3d.h:43)
[26] CharacterBody3D::_notificationv(int, bool) (/builds/Calinou/godot-builds-ci/godot/scene/3d/physics_body_3d.h:307)
[27] Object::notification(int, bool) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:843)
[28] Object::_predelete() (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:355)
[29] predelete_handler(Object*) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:1906)
[30] void memdelete<Object>(Object*) (/builds/Calinou/godot-builds-ci/godot/./core/os/memory.h:105)
[31] Object::call(StringName const&, Variant const**, int, Callable::CallError&) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:803)
[32] Variant::call(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/builds/Calinou/godot-builds-ci/godot/core/variant/variant_call.cpp:1017)
[33] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/builds/Calinou/godot-builds-ci/godot/modules/gdscript/gdscript_vm.cpp:1489)
[34] GDScriptInstance::call(StringName const&, Variant const**, int, Callable::CallError&) (/builds/Calinou/godot-builds-ci/godot/modules/gdscript/gdscript.cpp:1501)
[35] Object::call(StringName const&, Variant const**, int, Callable::CallError&) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:811 (discriminator 1))
[36] Variant::call(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/builds/Calinou/godot-builds-ci/godot/core/variant/variant_call.cpp:1017)
[37] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/builds/Calinou/godot-builds-ci/godot/modules/gdscript/gdscript_vm.cpp:1489)
[38] GDScriptInstance::call(StringName const&, Variant const**, int, Callable::CallError&) (/builds/Calinou/godot-builds-ci/godot/modules/gdscript/gdscript.cpp:1501)
[39] Object::call(StringName const&, Variant const**, int, Callable::CallError&) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:811 (discriminator 1))
[40] Callable::call(Variant const**, int, Variant&, Callable::CallError&) const (/builds/Calinou/godot-builds-ci/godot/core/variant/callable.cpp:62)
[41] Object::emit_signal(StringName const&, Variant const**, int) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:1100)
[42] Object::emit_signal(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) (/builds/Calinou/godot-builds-ci/godot/core/object/object.cpp:1155)
[43] BaseButton::_pressed() (/builds/Calinou/godot-builds-ci/godot/scene/gui/base_button.cpp:126 (discriminator 2))
[44] BaseButton::on_action_event(Ref<InputEvent>) (/builds/Calinou/godot-builds-ci/godot/scene/gui/base_button.cpp:168)
[45] BaseButton::gui_input(Ref<InputEvent> const&) (/builds/Calinou/godot-builds-ci/godot/scene/gui/base_button.cpp:67 (discriminator 3))
[46] Control::_call_gui_input(Ref<InputEvent> const&) (/builds/Calinou/godot-builds-ci/godot/scene/gui/control.cpp:821)
[47] Viewport::_gui_call_input(Control*, Ref<InputEvent> const&) (/builds/Calinou/godot-builds-ci/godot/scene/main/viewport.cpp:1263)
[48] Viewport::_gui_input_event(Ref<InputEvent>) (/builds/Calinou/godot-builds-ci/godot/scene/main/viewport.cpp:1563 (discriminator 3))
[49] Viewport::push_input(Ref<InputEvent> const&, bool) (/builds/Calinou/godot-builds-ci/godot/scene/main/viewport.cpp:2677 (discriminator 3))
[50] Window::_window_input(Ref<InputEvent> const&) (/builds/Calinou/godot-builds-ci/godot/scene/main/window.cpp:920 (discriminator 2))
[51] void call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/builds/Calinou/godot-builds-ci/godot/./core/variant/binder_common.h:222 (discriminator 6))
[52] void call_with_variant_args<Window, Ref<InputEvent> const&>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, int, Callable::CallError&) (/builds/Calinou/godot-builds-ci/godot/./core/variant/binder_common.h:337)
[53] CallableCustomMethodPointer<Window, Ref<InputEvent> const&>::call(Variant const**, int, Variant&, Callable::CallError&) const (/builds/Calinou/godot-builds-ci/godot/./core/object/callable_method_pointer.h:96)
[54] Callable::call(Variant const**, int, Variant&, Callable::CallError&) const (/builds/Calinou/godot-builds-ci/godot/core/variant/callable.cpp:50)
[55] DisplayServerX11::_dispatch_input_event(Ref<InputEvent> const&) (/builds/Calinou/godot-builds-ci/godot/platform/linuxbsd/display_server_x11.cpp:2602)
[56] DisplayServerX11::_dispatch_input_events(Ref<InputEvent> const&) (/builds/Calinou/godot-builds-ci/godot/platform/linuxbsd/display_server_x11.cpp:2586)
[57] Input::_parse_input_event_impl(Ref<InputEvent> const&, bool) (/builds/Calinou/godot-builds-ci/godot/core/input/input.cpp:596)
[58] Input::parse_input_event(Ref<InputEvent> const&) (/builds/Calinou/godot-builds-ci/godot/core/input/input.cpp:834)
[59] DisplayServerX11::process_events() (/builds/Calinou/godot-builds-ci/godot/platform/linuxbsd/display_server_x11.cpp:3167 (discriminator 4))
[60] OS_LinuxBSD::run() (/builds/Calinou/godot-builds-ci/godot/platform/linuxbsd/os_linuxbsd.cpp:340)
[61] ../Godot/godot(main+0x15a) [0x21cd2cc] (/builds/Calinou/godot-builds-ci/godot/platform/linuxbsd/godot_linuxbsd.cpp:60)
[62] /usr/lib/libc.so.6(__libc_start_main+0xd5) [0x7fe9d7417b25] (??:0)
[63] ../Godot/godot(_start+0x29) [0x21cd0c9] (??:?)
-- END OF BACKTRACE --
================================================================

Steps to reproduce

Reproduction project:

https://git.gieszer.link/unfa/liblast/src/commit/17527f7c8dead13995f121405dcb372d3d154a33

The game uses LFS for media files (and bundles Godot nightly builds for development).

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Sep 21, 2021

cc @ellenhp

@ellenhp
Copy link
Contributor

ellenhp commented Sep 21, 2021

Someone reported a crash in Rocket.Chat related to 3D audio listeners not being present in a scene with an AudioStreamPlayer3D, I bet that might be related to this. I haven't had a chance to look into it yet though.

@qarmin
Copy link
Contributor

qarmin commented Sep 21, 2021

When I run host, then after few seconds in sanitizer build I have crash related to buffer overflow

==33666==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address 0x7ffc881a0660 at pc 0x55a67fe07d49 bp 0x7ffc8819f6f0 sp 0x7ffc8819f6e0
READ of size 8 at 0x7ffc881a0660 thread T0
    #0 0x55a67fe07d48 in RigidDynamicBody3D::_body_inout(int, RID const&, ObjectID, int, int) scene/3d/physics_body_3d.cpp:426
    #1 0x55a67fe1160f in RigidDynamicBody3D::_body_state_changed(PhysicsDirectBodyState3D*) scene/3d/physics_body_3d.cpp:576
    #2 0x55a67fe0bec4 in RigidDynamicBody3D::_body_state_changed_callback(void*, PhysicsDirectBodyState3D*) scene/3d/physics_body_3d.cpp:481
    #3 0x55a68457eacf in Body3DSW::call_queries() servers/physics_3d/body_3d_sw.cpp:728
    #4 0x55a6833511cd in Space3DSW::call_queries() servers/physics_3d/space_3d_sw.cpp:1050
    #5 0x55a6830f03b1 in PhysicsServer3DSW::flush_queries() servers/physics_3d/physics_server_3d_sw.cpp:1638
    #6 0x55a683166334 in PhysicsServer3DWrapMT::flush_queries() servers/physics_3d/physics_server_3d_wrap_mt.cpp:90
    #7 0x55a66feabc59 in Main::iteration() main/main.cpp:2528
    #8 0x55a66fd49a3c in OS_LinuxBSD::run() platform/linuxbsd/os_linuxbsd.cpp:342
    #9 0x55a66fd380d3 in main platform/linuxbsd/godot_linuxbsd.cpp:58
    #10 0x7f897a4d7564 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28564)
    #11 0x55a66fd37c0d in _start (/usr/bin/godot4s+0x32290c0d)

in normal build I don't have such error, so it is possible that this invalid operation corrupt memory, and later entire app crash in different place
also at start I have this errors

modules/raycast/raycast_occlusion_cull.cpp:113:36: runtime error: reference binding to misaligned address 0x7f89243c4810 for type 'struct RayPacket', which requires 64 byte alignment
0x7f89243c4810: note: pointer points here
 be be be be  be be be be be be be be  be be be be be be be be  be be be be be be be be  be be be be
              ^ 
modules/raycast/raycast_occlusion_cull.cpp:132:24: runtime error: member access within misaligned address 0x7f89243ce310 for type 'struct RayPacket', which requires 64 byte alignment
0x7f89243ce310: note: pointer points here
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^ 

@ellenhp
Copy link
Contributor

ellenhp commented Sep 21, 2021

That's probably not a memory corruption given that it's just a read operation, but it should definitely be fixed too.

@qarmin
Copy link
Contributor

qarmin commented Sep 29, 2021

Looks that here camera is null

for (Camera3D *camera : cameras) {
Viewport *vp = camera->get_viewport();
if (!vp->is_audio_listener_3d()) {

I got this crash, but for now I don't have reproduction steps

scene/3d/audio_stream_player_3d.cpp:386:38: runtime error: member access within null pointer of type 'struct Camera3D'
scene/3d/audio_stream_player_3d.cpp:386:38: runtime error: member call on null pointer of type 'struct Node'
scene/3d/audio_stream_player_3d.cpp:386:38: runtime error: member access within null pointer of type 'struct Node'

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.dev.custom_build (bd573f8abac3122a4b2362a1e0224b79e8d9f2fc)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] ./godot.linuxbsd.tools.64s(+0x3009ad24) [0x55d31e6acd24] (??:0)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f9a5e6e0210] (??:0)
[3] AudioStreamPlayer3D::_update_panning() (??:0)
[4] AudioStreamPlayer3D::_listener_changed_cb(void*) (??:0)
[5] AudioServer::notify_listener_changed() (??:0)
[6] Viewport::_update_audio_listener_3d() (??:0)
[7] Viewport::_camera_3d_set(Camera3D*) (??:0)
[8] Camera3D::clear_current(bool) (??:0)
[9] void call_with_variant_args_helper<__UnexistingClass, bool, 0ul>(__UnexistingClass*, void (__UnexistingClass::*)(bool), Variant const**, Callable::CallError&, IndexSequence<0ul>) (??:0)
[10] void call_with_variant_args_dv<__UnexistingClass, bool>(__UnexistingClass*, void (__UnexistingClass::*)(bool), Variant const**, int, Callable::CallError&, Vector<Variant> const&) (??:0)
[11] MethodBindT<bool>::call(Object*, Variant const**, int, Callable::CallError&) (??:0)
[12] Object::call(StringName const&, Variant const**, int, Callable::CallError&) (??:0)
[13] Object::callv(StringName const&, Array const&) (??:0)
[14] void call_with_variant_args_ret_helper<__UnexistingClass, Variant, StringName const&, Array const&, 0ul, 1ul>(__UnexistingClass*, Variant (__UnexistingClass::*)(StringName const&, Array const&), Variant const**, Variant&, Callable::CallError&, IndexSequence<0ul, 1ul>) (??:0)
[15] void call_with_variant_args_ret_dv<__UnexistingClass, Variant, StringName const&, Array const&>(__UnexistingClass*, Variant (__UnexistingClass::*)(StringName const&, Array const&), Variant const**, int, Variant&, Callable::CallError&, Vector<Variant> const&) (??:0)
[16] MethodBindTR<Variant, StringName const&, Array const&>::call(Object*, Variant const**, int, Callable::CallError&) (??:0)
[17] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (??:0)
[18] GDScriptInstance::call(StringName const&, Variant const**, int, Callable::CallError&) (??:0)
[19] Object::call(StringName const&, Variant const**, int, Callable::CallError&) (??:0)
[20] Variant::call(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (??:0)
[21] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (??:0)
[22] GDScriptInstance::call(StringName const&, Variant const**, int, Callable::CallError&) (??:0)
[23] Node::_gdvirtual__process_call(double) (??:0)
[24] Node::_notification(int) (??:0)
[25] Node::_notificationv(int, bool) (??:0)
[26] Object::notification(int, bool) (??:0)
[27] SceneTree::_notify_group_pause(StringName const&, int) (??:0)
[28] SceneTree::process(double) (??:0)
[29] Main::iteration() (??:0)
[30] OS_LinuxBSD::run() (??:0)
[31] ./godot.linuxbsd.tools.64s(main+0x40e) [0x55d31e6aa647] (??:0)
[32] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f9a5e6c10b3] (??:0)
[33] ./godot.linuxbsd.tools.64s(_start+0x2e) [0x55d31e6aa17e] (??:0)
-- END OF BACKTRACE --
================================================================

@qarmin
Copy link
Contributor

qarmin commented Oct 8, 2021

@ellenhp I found minimal code which crashes with exactly same backtrace

func _process(delta) -> void:
	var temp_variable74 = AudioStreamPlayer3D.new()
	add_child(temp_variable74)
	temp_variable74.set_stream(AudioStreamRandomPitch.new())
	temp_variable74.seek(-11.146479845047)
	temp_variable74.queue_free()
	var temp_variable96 = Camera3D.new()
	add_child(temp_variable96)
	temp_variable96.clear_current(false)

@ellenhp
Copy link
Contributor

ellenhp commented Oct 8, 2021

Oh gosh I forgot I never fixed this. Expect a fix this weekend. If I forget again you can break down my front door and demand one. :)

To be clear that was a joke pls don't break down my door everyone ❤️

@jitspoe
Copy link
Contributor

jitspoe commented Nov 18, 2021

While attempting to reproduce the random pitch crash in master, I ran into this crash when closing the program. Basically, the camera is set to null, and the callback to update the listener tries to use the null camera.

>	godot.windows.opt.tools.64.exe!AudioStreamPlayer3D::_update_panning() Line 394	C++
 	godot.windows.opt.tools.64.exe!AudioStreamPlayer3D::_listener_changed_cb(void * self) Line 90	C++
 	godot.windows.opt.tools.64.exe!AudioServer::notify_listener_changed() Line 1325	C++
 	[Inline Frame] godot.windows.opt.tools.64.exe!Viewport::_update_audio_listener_3d() Line 3088	C++
 	godot.windows.opt.tools.64.exe!Viewport::_camera_3d_set(Camera3D * p_camera) Line 3192	C++
 	[Inline Frame] godot.windows.opt.tools.64.exe!Camera3D::clear_current(bool) Line 235	C++
 	godot.windows.opt.tools.64.exe!Camera3D::_notification(int p_what) Line 122	C++
 	godot.windows.opt.tools.64.exe!Camera3D::_notificationv(int p_notification, bool p_reversed) Line 38	C++
 	godot.windows.opt.tools.64.exe!Object::notification(int p_notification, bool p_reversed) Line 848	C++
 	godot.windows.opt.tools.64.exe!Node3D::_notification(int p_what) Line 150	C++
 	[Inline Frame] godot.windows.opt.tools.64.exe!Node3D::_notificationv(int) Line 51	C++
 	godot.windows.opt.tools.64.exe!Camera3D::_notificationv(int p_notification, bool p_reversed) Line 38	C++
 	godot.windows.opt.tools.64.exe!Object::notification(int p_notification, bool p_reversed) Line 848	C++
 	godot.windows.opt.tools.64.exe!Node::_propagate_exit_tree() Line 267	C++
 	godot.windows.opt.tools.64.exe!Node::_propagate_exit_tree() Line 256	C++
 	godot.windows.opt.tools.64.exe!Node::_propagate_exit_tree() Line 256	C++
 	godot.windows.opt.tools.64.exe!Node::_set_tree(SceneTree * p_tree) Line 2489	C++
 	godot.windows.opt.tools.64.exe!SceneTree::finalize() Line 568	C++
 	godot.windows.opt.tools.64.exe!widechar_main(int argc, wchar_t * * argv) Line 163	C++
 	godot.windows.opt.tools.64.exe!_main() Line 187	C++
 	godot.windows.opt.tools.64.exe!main(int argc, char * * argv) Line 199	C++

In AudioStreamPlayer3D::_update_panning():

	for (Camera3D *camera : cameras) {
		Viewport *vp = camera->get_viewport();
		if (!vp->is_audio_listener_3d()) {
			continue;
		}

camera is null here, as it has just been cleared.

Repro project: https://github.com/godotengine/godot/files/7550741/StreamRandomPitchCrash.zip

@unfa
Copy link
Author

unfa commented Nov 18, 2021

So maybe my players dying thing was also caused by the current camera being freed?
Maybe if I explicitly switched camera before freeing the scene it would not crash?

@jitspoe
Copy link
Contributor

jitspoe commented Nov 18, 2021

So maybe my players dying thing was also caused by the current camera being freed? Maybe if I explicitly switched camera before freeing the scene it would not crash?

Yeah, looks like the call stack is the same after _propagate_exit_tree, so removing a camera from the tree via exiting the application or other means probably causes the crash. Swapping the active camera before removing one could be a work around.

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.

6 participants