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

Segfault when MultiplayerSynchronizer node has different authority on different peers #68436

Closed
celeste-sinead opened this issue Nov 9, 2022 · 3 comments
Assignees
Milestone

Comments

@celeste-sinead
Copy link

celeste-sinead commented Nov 9, 2022

Godot version

v4.0.beta.custom_build.e6751549c

System information

Ubuntu 22.04, linux 5.15.0-52-generic

Issue description

If MultiplayerSynchronizer instances with the same path have different multiplayer authorities set on different peers, peers will crash with segmentation faults.

Backtrace:

Thread 1 "godot" received signal SIGSEGV, Segmentation fault.
decode_uint32 (p_arr=0x7fff92c8cc1c <error: Cannot access memory at address 0x7fff92c8cc1c>) at ./core/io/marshalls.h:166
166			uint32_t b = *p_arr;
(gdb) bt
#0  decode_uint32 (p_arr=0x7fff92c8cc1c <error: Cannot access memory at address 0x7fff92c8cc1c>) at ./core/io/marshalls.h:166
#1  SceneReplicationInterface::on_sync_receive (this=<optimized out>, p_from=<optimized out>, p_buffer=<optimized out>, p_buffer_len=<optimized out>) at modules/multiplayer/scene_replication_interface.cpp:655
#2  0x00005555567fe3f3 in SceneMultiplayer::poll (this=0x7fffa80106f0) at modules/multiplayer/scene_multiplayer.cpp:81
#3  0x000055555812bfa9 in SceneTree::process (this=0x555560288d60, p_time=0.018055555555555554) at scene/main/scene_tree.cpp:453
#4  0x0000555555ffbc73 in Main::iteration () at main/main.cpp:3170
#5  0x0000555555fb9d81 in OS_LinuxBSD::run (this=this@entry=0x7fffffffda20) at platform/linuxbsd/os_linuxbsd.cpp:776
#6  0x0000555555fab2de in main (argc=<optimized out>, argv=0x7fffffffdf68) at platform/linuxbsd/godot_linuxbsd.cpp:73

Steps to reproduce

  1. Add a MutliplayerSynchronizer to a scene. Configure it to sync any variable.
  2. Call set_multiplayer_authority(multiplayer.get_unique_id()) on the synchronizer node at some point (the repro project does it in _ready but I don't think it particularly matters).
  3. Connect at least 2 peers.
  4. Should segfault ~immediately. Which peer appears to be random.

Minimal reproduction project

sync_segfault.zip

@akien-mga
Copy link
Member

Is this still reproducible in 4.0 RC 2 or later?

@celeste-sinead
Copy link
Author

I can still reproduce this on RC2 (v4.0.rc.custom_build.d2699dc7a) using the attached minimal reproduction project.

@Faless
Copy link
Collaborator

Faless commented Feb 21, 2023

I can still reproduce this on RC2 (v4.0.rc.custom_build.d2699dc7a) using the attached minimal reproduction project.

The issue was fixed via #73216 which didn't make it in time for RC2 but will be in RC3.

@Faless Faless closed this as completed Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants