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

Server deadlock on client connection #4596

Closed
DorpsGek opened this issue Apr 18, 2011 · 5 comments
Closed

Server deadlock on client connection #4596

DorpsGek opened this issue Apr 18, 2011 · 5 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Zydeco opened the ticket and wrote:

My server locked up when a client connected, I don't know the details because I wasn't there, but the last line on the log was when it paused the game for the client to connect.
I attached to it with gdb and got a backtrace, but I forgot to see if there were any more threads, I may remember if it happens again:

# 0 0xb78d6430 in __kernel_vsyscall ()
# 1 0xb77cd829 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
# 2 0xb77c8f3b in _L_lock_752 () from /lib/tls/i686/cmov/libpthread.so.0
# 3 0xb77c8d51 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
# 4 0x0823248f in ServerNetworkGameSocketHandler::SendMap() ()
# 5 0x082327fa in ServerNetworkGameSocketHandler::Send() ()
# 6 0x08280508 in GameLoop() ()
# 7 0x08376230 in VideoDriver_Dedicated::MainLoop() ()
# 8 0x08280120 in ttd_main(int, char**) ()
# 9 0x0828e658 in main ()

Attachments

Reported version: 1.1.0
Operating system: Linux


This issue was imported from FlySpray: https://bugs.openttd.org/task/4596
@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed

In r22371


This comment was imported from FlySpray: https://bugs.openttd.org/task/4596

@DorpsGek
Copy link
Member Author

Zydeco wrote:

Had the same problem on 1.1.1-RC1 on the same machine, this time I checked and there was only one thread, with a similar stacktrace:

# 0 0xb7789430 in __kernel_vsyscall ()
# 1 0xb7680829 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
# 2 0xb767bf3b in _L_lock_752 () from /lib/tls/i686/cmov/libpthread.so.0
# 3 0xb767bd51 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
# 4 0x08375532 in ThreadMutex_pthread::BeginCritical() ()
# 5 0x0824c82f in ServerNetworkGameSocketHandler::SendMap() ()
# 6 0x0824cc1a in ServerNetworkGameSocketHandler::Send() ()
# 7 0x082a4168 in GameLoop() ()
# 8 0x083c73a0 in VideoDriver_Dedicated::MainLoop() ()
# 9 0x082a3d80 in ttd_main(int, char**) ()
# 10 0x082b4128 in main ()

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4596#comment9960

@DorpsGek
Copy link
Member Author

Rubidium wrote:

And what would be the exact stack trace of the other thread?


This comment was imported from FlySpray: https://bugs.openttd.org/task/4596#comment9962

@DorpsGek
Copy link
Member Author

Zydeco wrote:

There was only one thread, I meant the stacktrace was similar to the one on 1.1.0, it just adds ThreadMutex_pthread::BeginCritical()


This comment was imported from FlySpray: https://bugs.openttd.org/task/4596#comment9963

@DorpsGek
Copy link
Member Author

Rubidium wrote:

As far as I am aware there can't be a single thread. If it deadlocks, then it must have another thread having the lock as otherwise the it's reentrant.

Also looking at the code I can't find anything that's wrong, e.g. all locks that are taken are freed within all flows of the functions that take a lock.

How easily can you reproduce this? Does it happen almost instantly, or only sporadically? In any case, please using a debug-level 3 binary so we get a backtrace with line numbers which might give us more clues about the place where the lock is being taken.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4596#comment9978

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Network labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant