-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Comments
cc @ellenhp |
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. |
When I run host, then after few seconds in sanitizer build I have crash related to buffer overflow
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
|
That's probably not a memory corruption given that it's just a read operation, but it should definitely be fixed too. |
Looks that here camera is null godot/scene/3d/audio_stream_player_3d.cpp Lines 385 to 387 in 43cc6dd
I got this crash, but for now I don't have reproduction steps
|
@ellenhp I found minimal code which crashes with exactly same backtrace
|
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 ❤️ |
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.
In
camera is null here, as it has just been cleared. Repro project: https://github.com/godotengine/godot/files/7550741/StreamRandomPitchCrash.zip |
So maybe my players dying thing was also caused by the current camera being freed? |
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. |
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
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
The text was updated successfully, but these errors were encountered: