[Bug] EE becomes unresponsive if you cancel master server registration
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 869
- Forks
- 222
- Avg merge
- 18h 33m
- Merged PRs (30d)
- 1
Description
Issue
If you attempt to register an EE server with the master server, then cancel to return to the ServerCreationScreen, EE becomes unresponsive until it gets a response from the master server.
Steps to reproduce
The master server is timing out right now, making this easily reproducible now but potentially not when the master server is working.
- Launch EE as a server registered with the master server, either from the UI or with Preferences File options like
headless_internet=1. - While waiting for the master server to respond, either cancel in the UI or attempt to SIGINT/ctrl-c to quit the headless server.
Expected behavior
EE kills the request to the master server and is immediately responsive in the UI or exits as a headless server.
Observed behavior
EE is unresponsive until it gets a response from the master server, including 504 timeouts.
Headless backtrace if killed while stalled:
Thread 1 "EmptyEpsilon" received signal SIGABRT, Aborted.
Downloading 1.79 K source file /usr/src/debug/glibc-2.41-11.fc42.x86_64/nptl/../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S
__syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
56 ret
(gdb) bt
#0 __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
#1 0x00007ffff767c75c in __internal_syscall_cancel (a1=<optimized out>, a2=<optimized out>, a3=<optimized out>,
a4=<optimized out>, a5=a5@entry=0, a6=a6@entry=4294967295, nr=202) at cancellation.c:49
#2 0x00007ffff767cdcc in __futex_abstimed_wait_common64 (private=128, futex_word=0x7fffabfff990,
expected=<optimized out>, op=<optimized out>, abstime=0x0, cancel=true) at futex-internal.c:57
#3 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x7fffabfff990, expected=<optimized out>,
clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128, cancel=cancel@entry=true)
at futex-internal.c:87
#4 0x00007ffff767ce2f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffabfff990,
expected=<optimized out>, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128)
at futex-internal.c:139
#5 0x00007ffff7681c8c in __pthread_clockjoin_ex (threadid=140736079066816, thread_return=0x0, clockid=0, abstime=0x0,
block=<optimized out>) at pthread_join_common.c:108
#6 0x00007ffff784e45b in __gthread_join (__threadid=<optimized out>, __value_ptr=0x0)
at /usr/src/debug/gcc-15.2.1-1.fc42.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/x86_64-redhat-linux/bits/gthr-default.h:715
#7 std::thread::join (this=0x2781950) at ../../../../../libstdc++-v3/src/c++11/thread.cc:134
#8 0x00000000004996cc in GameServer::~GameServer ()
at /home/oznogon/git/emptyepsilon-compile/SeriousProton/src/multiplayer_server.cpp:73
#9 0x00000000005264e0 in EpsilonServer::~EpsilonServer ()
at /home/oznogon/git/emptyepsilon-compile/EmptyEpsilon/src/epsilonServer.h:10
#10 EpsilonServer::~EpsilonServer () at /home/oznogon/git/emptyepsilon-compile/EmptyEpsilon/src/epsilonServer.h:10
#11 0x000000000045e9e7 in P<GameServer>::release () at /home/oznogon/git/emptyepsilon-compile/SeriousProton/src/P.h:155
#12 P<GameServer>::check_release () at /home/oznogon/git/emptyepsilon-compile/SeriousProton/src/P.h:146
#13 P<GameServer>::operator bool () at /home/oznogon/git/emptyepsilon-compile/SeriousProton/src/P.h:123
#14 Engine::runMainLoop () at /home/oznogon/git/emptyepsilon-compile/SeriousProton/src/engine.cpp:199
#15 0x00000000004460bb in main () at /home/oznogon/git/emptyepsilon-compile/EmptyEpsilon/src/main.cpp:427
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read SeriousProton/src/multiplayer_server.cpp, especially GameServer::~GameServer, then follow Engine::runMainLoop in SeriousProton/src/engine.cpp and the registration path described in the issue. Reproduce with a timing-out master server; done means cancel or exit returns immediately without waiting for the master-server request or blocking during cleanup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100