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

Game crashes when calling peer.disconnect_peer #444

Open
bugbountyguy opened this issue May 1, 2024 · 5 comments
Open

Game crashes when calling peer.disconnect_peer #444

bugbountyguy opened this issue May 1, 2024 · 5 comments
Assignees
Labels
bug Related to any general issue with GodotSteam multiplayer-peer Related to Multiplayer Peer

Comments

@bugbountyguy
Copy link

bugbountyguy commented May 1, 2024

Describe the bug
When I get the lobby chat update, and the player is leaving the lobby, I'm manually calling peer.disconnect_peer, as I want the player to be removed from the game altogether, immediately, rather than waiting for the RPC disconnect to happen after 5-10 seconds. Upon doing so, the game crashes completely, with the following stacktrace (only found it when doing a build):

[14] /home/user/godot_builds/libgodotsteam.debug.x86_64.so(+0x1915bd) [0x7f52ea6f55bd] (??:0)
[15] /home/user/godot_builds/libgodotsteam.debug.x86_64.so(+0x29025) [0x7f52ea58d025] (??:0)
[16] /home/user/godot_builds/libsteam_api.so(+0x1ad12) [0x7f52ea52fd12] (??:0)
[17] /home/user/godot_builds/libsteam_api.so(+0x1bb35) [0x7f52ea530b35] (??:0)
[18] /home/user/godot_builds/libsteam_api.so(SteamAPI_RunCallbacks+0x90) [0x7f52ea5329f0] (??:0)

To Reproduce
Steps to reproduce the behavior:

  1. Add peer.disconnect_peer in the lobby update when a player leaves the lobby
  2. Watch the game crash!

Expected behavior
The RPC connection should work without any issues, and game should go on

Desktop (please complete the following information):

  • OS: Linux Mint

Version of Godot:
v4.2.2 (crashes happened on v4.2.1 too)

Version of GodotSteam:
Can't confirm, but I think 4.6.3 based on the timeline for when I updated it (day or two after 4.2.2 came out). GDExtension

Additional context
Based on the stacktrace, I'm assuming it's the callbacks method? I tried to do Steam.closeP2PSessionWithUser(change_id) but that did not work. My callbacks is simply:

func _process(_delta: float) -> void:
	Steam.run_callbacks()

I also tried to do a 0.5-1.0s timeout on calling the disconnect_peer, but it still did not resolve it.

Edit: Second callout, I am using steam-multiplayer-peer from here https://github.com/expressobits/steam-multiplayer-peer - and I did just notice at the top of the stack this:

[2] /home/user/godot_builds/libsteam-multiplayer-peer.linux.template_debug.x86_64.so(+0xa9d1) [0x7aa53febb9d1] (??:0)
[3] /home/user/godot_builds/libsteam-multiplayer-peer.linux.template_debug.x86_64.so(+0xff61) [0x7aa53fec0f61] (??:0)

Not 100% sure which library it would be at fault in this case. But now thinking about it, maybe I'm misdirecting the bug report (maybe I need to put one over there) 🤔

@Gramps Gramps added bug Related to any general issue with GodotSteam multiplayer-peer Related to Multiplayer Peer labels May 1, 2024
@Gramps
Copy link
Member

Gramps commented May 1, 2024

Hey there! Hmm, if you're using SteamMultiplayerPeer, this issue might be better placed there unless it is GodotSteam itself doing this. Have you tried the pre-compiled version to see if the behavior persists? I don't think it would make any difference but worth a shot to see.

@bugbountyguy
Copy link
Author

Hi @Gramps

I did decide to post there after all after trying this for longer: expressobits/steam-multiplayer-peer#12 - hopefully the developer's still active :)

I did try the pre-compiled version to see what would happen and it does look like it still had the same issue. Really leaning towards some unhandled null pointer or something happening during the disconnect_peer. As that library uses GodotSteam, I'm wondering if it's not handling me doing a forced disconnect peer vs. a timeout (when a player crashes).

If the developer over there replies or confirms it's with that library sometime soon, or you feel it's definitely not GodotSteam, we can close this... I spent a few hours before posting here, and like talking to a rubber ducky, came to realize I was probably looking at the wrong thing as being the source of what's broken lol.

Not sure if you have a project using both RPCs + GodotSteam like I do to test it out with.

@Gramps
Copy link
Member

Gramps commented May 2, 2024

He should be still active on the project. He gets pinged in our Discord from time to time too.

I'm still not super-familiar with the multiplayer peer stuff so don't quite feel confident in weighing in on it but will dig around and see what I can find! Perhaps sometime in the Discord knows something too.

@bugbountyguy
Copy link
Author

Oh nice, awesome.

I did look to joining the discord, but looks like I can't send a message without having a phone number on my discord account. Interestingly it let me send reactions to the rules channel and your welcome message, and now I can't do anything but lurk lol. Maybe Discord not liking new accounts or something. So I'll lurk around for now to see if any discussion comes from it. I see a few others mentioning issues with disconnect_peer (in fact, very recently) so it's nice to see it wasn't just me!

@Gramps
Copy link
Member

Gramps commented May 3, 2024

Weird, I don't remember having that set and will have to find and unset that. Maybe Sapphire or someone else did. Discord doesn't even recognize my phone number as valid so I can't join or do things in servers that have that setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Related to any general issue with GodotSteam multiplayer-peer Related to Multiplayer Peer
Projects
None yet
Development

No branches or pull requests

3 participants