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

MultiplayerSynchronizer fatally crashes when attempting to sync a PackedStringArray #64231

Closed
cridenour opened this issue Aug 10, 2022 · 4 comments · Fixed by #64843
Closed

Comments

@cridenour
Copy link
Contributor

cridenour commented Aug 10, 2022

Godot version

4.0.dev (11abff)

System information

Windows 10

Issue description

Backtrace below: seems related to a type. First failed on alpha13, so updated to master to further test.

CrashHandlerException: Program crashed
Engine version: Godot Engine v4.0.alpha.custom_build (11abffbf1282d457f966741f14aa5a5793f3c208)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
[0] MultiplayerAPI::encode_and_compress_variant (C:\Users\Chris\Development\godot\godot\scene\main\multiplayer_api.cpp:74)
[1] MultiplayerAPI::encode_and_compress_variants (C:\Users\Chris\Development\godot\godot\scene\main\multiplayer_api.cpp:248)
[2] SceneReplicationInterface::_make_spawn_packet (C:\Users\Chris\Development\godot\godot\modules\multiplayer\scene_replication_interface.cpp:298)
[3] SceneReplicationInterface::_update_spawn_visibility (C:\Users\Chris\Development\godot\godot\modules\multiplayer\scene_replication_interface.cpp:234)
[4] SceneReplicationInterface::on_peer_change (C:\Users\Chris\Development\godot\godot\modules\multiplayer\scene_replication_interface.cpp:56)
[5] SceneMultiplayer::_add_peer (C:\Users\Chris\Development\godot\godot\modules\multiplayer\scene_multiplayer.cpp:176)
[6] CallableCustomMethodPointer<SceneMultiplayer,int>::call (C:\Users\Chris\Development\godot\godot\core\object\callable_method_pointer.h:105)
[7] Callable::callp (C:\Users\Chris\Development\godot\godot\core\variant\callable.cpp:51)
[8] Object::emit_signalp (C:\Users\Chris\Development\godot\godot\core\object\object.cpp:991)
[9] Object::emit_signal<int> (C:\Users\Chris\Development\godot\godot\core\object\object.h:818)
[10] ENetMultiplayerPeer::_parse_server_event (C:\Users\Chris\Development\godot\godot\modules\enet\enet_multiplayer_peer.cpp:134)
[11] ENetMultiplayerPeer::poll (C:\Users\Chris\Development\godot\godot\modules\enet\enet_multiplayer_peer.cpp:337)
[12] SceneMultiplayer::poll (C:\Users\Chris\Development\godot\godot\modules\multiplayer\scene_multiplayer.cpp:61)
[13] SceneTree::process (C:\Users\Chris\Development\godot\godot\scene\main\scene_tree.cpp:442)
[14] Main::iteration (C:\Users\Chris\Development\godot\godot\main\main.cpp:2885)
[15] OS_Windows::run (C:\Users\Chris\Development\godot\godot\platform\windows\os_windows.cpp:907)
[16] widechar_main (C:\Users\Chris\Development\godot\godot\platform\windows\godot_windows.cpp:179)
[17] _main (C:\Users\Chris\Development\godot\godot\platform\windows\godot_windows.cpp:203)
[18] main (C:\Users\Chris\Development\godot\godot\platform\windows\godot_windows.cpp:215)
[19] __scrt_common_main_seh (d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[20] BaseThreadInitThunk
-- END OF BACKTRACE --

Steps to reproduce

A combination of Spawner and Synchronizer, and an unknown additional condition.

I've tried disabling the spawn variables on my synchronizer (via the checkbox) and it did not stop the issue.

I'm happy to run additional debugging but I'm unsure where to focus my efforts. Hoping for some guidance here.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Aug 10, 2022

@cridenour Please upload a minimal reproduction project to make this easier to troubleshoot.

@cridenour
Copy link
Contributor Author

@Calinou unfortunately been unable to recreate so far as I'm not sure what the underlying issue is. Basic multiplayer demos run fine, but something about my project is hard crashing between 12 and 13. Happy to put more work, just need some guidance. If nothing else I can bisect master commits until I find the change.

@Calinou
Copy link
Member

Calinou commented Aug 10, 2022

If nothing else I can bisect master commits until I find the change.

Please do if you have time 🙂

@cridenour
Copy link
Contributor Author

@Calinou got it! Quite a rabbit hole.

Starting with commit 3084a4 (which is #63219) my project starts to fail.

Here's the offending line in multiplayer_api: https://github.com/godotengine/godot/blob/master/scene/main/multiplayer_api.cpp#L74

Because 3 new variants were added (Vector4, Vector4i and Projection), this hard-coded sanity check fails. It looked out of date before this commit, but this commit moved PackedStringArray into Variant.Type = 34 which is causing the fatal crash.

PR submitted as #64263.

@cridenour cridenour changed the title MultiplayerSynchronizer fatal crash on client join MultiplayerSynchronizer fatally crashes when attempting to sync a PackedStringArray Aug 11, 2022
@Faless Faless added this to the 4.0 milestone Aug 24, 2022
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