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

Websockets: Restarting server project causes rpcp error spam that hangs the process (clients cannot connect). #33336

Closed
Tracked by #39196
realkotob opened this issue Nov 4, 2019 · 9 comments

Comments

@realkotob
Copy link
Contributor

realkotob commented Nov 4, 2019

Godot version:
3.2alpha3

OS/device including version:
Ubuntu 18 server

Issue description:

When I Ctrl + Z out of the process and restart the project again from the command line, the console is flooded with errors and clients are unable to connect. The process does not crash, but it keeps flooding errors and becomes unusable.

Restarting the OS works, so I think it must be some uncleared connection issue?

Flooded Error:

ERROR: rpcp: Condition ' network_peer->get_connection_status() != NetworkedMultiplayerPeer::CONNECTION_CONNECTED ' is true.
   At: core/io/multiplayer_api.cpp:628.

I could not reproduce this locally because I use Win10 to develop and test in the editor, so this only happened to me when connecting to an external Ubuntu IP and launching server from cli.

Steps to reproduce:
Start server, connect from client, turn off (disconnect) client, and then finally turn off server. When the server is re-started it will hang.

P.S. I might have forgot to change the server IP in Client/gamestate.gd, it needs to point to 127.1.1.1 instead of my server.

Minimal reproduction project:
Client.zip
Server.zip

@realkotob realkotob changed the title Websockets: Restarting server causes rpcp error spam that hangs the process. Websockets: Restarting server causes rpcp error spam that hangs the process (clients cannot connect). Nov 4, 2019
@realkotob realkotob changed the title Websockets: Restarting server causes rpcp error spam that hangs the process (clients cannot connect). Websockets: Restarting server project causes rpcp error spam that hangs the process (clients cannot connect). Nov 4, 2019
@capnm
Copy link
Contributor

capnm commented Nov 5, 2019

@Faless The attached code seems to be buggy in many aspects, but the reproducible client crash I'm getting could uncover some referencing issues. Does not occur when you start the client via the editor.

I wonder how this could happen:

ERROR: get_language: Index p_idx=4 out of size (_language_count=3)
   At: core/script_language.cpp:136.
Thread 1 "godot3" received signal SIGSEGV, Segmentation fault.
0x00000000048ef513 in ~Object () at core/object.cpp:1979
1979					ScriptServer::get_language(i)->free_instance_binding_data(_script_instance_bindings[i]);
(gdb) l
1974		_predelete_ok = 2;
1975	
1976		if (!ScriptServer::are_languages_finished()) {
1977			for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {
1978				if (_script_instance_bindings[i]) {
1979					ScriptServer::get_language(i)->free_instance_binding_data(_script_instance_bindings[i]);
1980				}
1981			}
1982		}
1983	}
(gdb) 
i33279/Client$ godot3 
Godot Engine v3.2.alpha.custom_build.dc114fa2e - https://godotengine.org
OpenGL ES 3.0 Renderer: AMD Radeon HD 7700 Series (VERDE, DRM 3.27.0, 5.0.0-20-generic, LLVM 10.0.0)
 
WARNING: _update_root_rect: Font oversampling does not work in 'Viewport' stretch mode, only '2D'.
   At: scene/main/scene_tree.cpp:1252.
ERROR: _get_socket_error: Socket error: 111
   At: drivers/unix/net_socket_posix.cpp:211.
ERROR: connect_to_host: Connection to remote host failed!
   At: drivers/unix/net_socket_posix.cpp:429.
ERROR: connect: Signal 'connected_to_server' is already connected to given method '_connected_ok' in that object.
   At: core/object.cpp:1464.
ERROR: connect: Signal 'connection_failed' is already connected to given method '_connected_fail' in that object.
   At: core/object.cpp:1464.
ERROR: connect: Signal 'server_disconnected' is already connected to given method '_server_disconnected' in that object.
   At: core/object.cpp:1464.
ERROR: _get_socket_error: Socket error: 111
   At: drivers/unix/net_socket_posix.cpp:211.
ERROR: connect_to_host: Connection to remote host failed!
   At: drivers/unix/net_socket_posix.cpp:429.
ERROR: connect: Signal 'connected_to_server' is already connected to given method '_connected_ok' in that object.
   At: core/object.cpp:1464.
ERROR: connect: Signal 'connection_failed' is already connected to given method '_connected_fail' in that object.
   At: core/object.cpp:1464.
ERROR: connect: Signal 'server_disconnected' is already connected to given method '_server_disconnected' in that object.
   At: core/object.cpp:1464.
ERROR: _get_socket_error: Socket error: 111
   At: drivers/unix/net_socket_posix.cpp:211.
ERROR: connect_to_host: Connection to remote host failed!
   At: drivers/unix/net_socket_posix.cpp:429.
ERROR: connect: Signal 'connected_to_server' is already connected to given method '_connected_ok' in that object.
   At: core/object.cpp:1464.
ERROR: connect: Signal 'connection_failed' is already connected to given method '_connected_fail' in that object.
   At: core/object.cpp:1464.
ERROR: connect: Signal 'server_disconnected' is already connected to given method '_server_disconnected' in that object.
   At: core/object.cpp:1464.
ERROR: _get_socket_error: Socket error: 111
   At: drivers/unix/net_socket_posix.cpp:211.
ERROR: connect_to_host: Connection to remote host failed!
   At: drivers/unix/net_socket_posix.cpp:429.
ERROR: get_language: Index p_idx=4 out of size (_language_count=3)
   At: core/script_language.cpp:136.
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f04c2bc6f20] (??:0)
[2] godot3() [0x48ef513] (core/object.cpp:1979)
[3] godot3() [0x2a16b88] (modules/websocket/wsl_client.cpp:353)
[4] godot3() [0x4bbd18b] (./core/os/memory.h:119)
[5] godot3() [0x3807e2e] (./core/reference.h:277)
[6] godot3() [0x48e1522] (core/object.cpp:?)
[7] godot3() [0x49b2c50] (core/variant_call.cpp:?)
[8] godot3() [0x24356a7] (modules/gdscript/gdscript_function.cpp:1082)
[9] godot3() [0x23c48bc] (modules/gdscript/gdscript.cpp:1164)
[10] godot3() [0x48e1441] (core/object.cpp:?)
[11] godot3() [0x48e3e64] (./core/variant.h:418)
[12] godot3() [0x48e1ea3] (core/object.cpp:1274)
[13] godot3() [0x37eb211] (./core/variant.h:418)
[14] godot3() [0x3801932] (./core/variant.h:416)
[15] godot3() [0x48e1522] (core/object.cpp:?)
[16] godot3() [0x48e3e64] (./core/variant.h:418)
[17] godot3() [0x48e1ea3] (core/object.cpp:1274)
[18] godot3() [0x4bc5001] (./core/variant.h:418)
[19] godot3() [0x4bd1aa2] (./core/variant.h:416)
[20] godot3() [0x48e1522] (core/object.cpp:?)
[21] godot3() [0x48e3e64] (./core/variant.h:418)
[22] godot3() [0x48e1ea3] (core/object.cpp:1274)
[23] godot3() [0x29fbe3e] (./core/variant.h:418)
[24] godot3() [0x2a1557c] (./core/cowdata.h:?)
[25] godot3() [0x4bbc482] (./core/reference.h:269)
[26] godot3() [0x37e3c32] (scene/main/scene_tree.cpp:519)
[27] godot3() [0x2072b31] (main/main.cpp:1974)
[28] godot3() [0x20429c2] (platform/x11/os_x11.cpp:3259)
[29] godot3(main+0x99) [0x2034189] (platform/x11/godot_x11.cpp:57)
[30] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f04c2ba9b97] (??:0)
[31] godot3() [0x203402a] (??:0)
-- END OF BACKTRACE --
Aborted

@realkotob
Copy link
Contributor Author

realkotob commented Nov 5, 2019

@capnm That's interesting I haven't seen this client crash, which platform is this running the client on? (I only tested the client on windows, and the reproducible issue here is with the server on linux)

Also excuse the stupid question, but is this reproducible crash from the steps I posted?

@capnm
Copy link
Contributor

capnm commented Nov 5, 2019

Also excuse the stupid question, but is this reproducible crash from the steps I posted?

No, I just ran your client from #33279 with godot master tip in the Linux terminal and accidentally posted it in this issue. I have to drink more coffee ;-)

@Faless
Copy link
Collaborator

Faless commented Nov 5, 2019 via email

@realkotob
Copy link
Contributor Author

realkotob commented Nov 5, 2019

@Faless Sadly work caught up with me so might not have time to test till the weekend, but I'll reply back and ping you with what happens. Thank you!

@capnm
Copy link
Contributor

capnm commented Nov 5, 2019

Potentially related to #33290
Can you try my patch in that issue and see if still crashes?

Yes, I can confirm that the patch applied on the current tip prevents the crash.
hacky.zip

@capnm
Copy link
Contributor

capnm commented Nov 5, 2019

@Faless I think at least the connection failures from peer.create_* shouldn't additionally spam the output, because the user can/should check the return value anyway.
E.g:

	var peer = NetworkedMultiplayerENet.new()
	var err = peer.create_server(PORT, MAX_PLAYERS)
	if err != OK:
		log_err("create server(PORT %d)" % [PORT], err)
ERROR: bind: Method/Function Failed, returning: ERR_UNAVAILABLE
   At: drivers/unix/net_socket_posix.cpp:300.
ERROR: create_server: Condition ' !host ' is true. returned: ERR_CANT_CREATE
   At: modules/enet/networked_multiplayer_enet.cpp:106.
Lobby create server(PORT 4242) ERROR[20].

https://docs.godotengine.org/en/latest/classes/class_@globalscope.html#enum-globalscope-error

@KoBeWi
Copy link
Member

KoBeWi commented Oct 20, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

@Faless
Copy link
Collaborator

Faless commented Nov 15, 2022

Closing since there has been no reply for a long time and this is likely no longer an issue (especially in current master after the rework in #66594).

@Faless Faless closed this as completed Nov 15, 2022
@akien-mga akien-mga added this to the 4.0 milestone Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants