[FIXED] r279 - stop/restart doesn't work
#4
Well, Linux is the difficult one for me, but i'll try. I have only experience with ubuntu server, so your distro might differ.
First compile MCServer in the debug mode (default for the GNUmakefile; "make clean" before switching; instructions are in the COMPILING file). Then get MCServer to the situation that you describe - deadlocked while stopping. Then on another console:
1, Find out the MCServer PID, using "ps uxaw | grep MCS". It should list the processes containing MCS in their cmdline, so find the MCServer one and the PID is the number in the second column.
2, Start gdb with parameters path-to-MCServer PID ("gdb ./MCServer 8093"). GDB spits out a few lines of info, "Reading symbols from ~/MCServer...done." should be one of them. If it says "(no debugging symbols found)" in the MCServer line, then you didn't compile for debugging - retry (you need to make clean)
3, GDB now is waiting for your commands. Try "info threads" first to see all the threads; normally MCServer uses 5 - 7 threads.
4, For each thread in the table, use two commands, first "thread N" (where N is the thread number, first in the table), then "bt". This should print out a table of where the thread is executing.
5, Post all the output here, I'll have a look.

For me, this is what I get:
Code:
(gdb) info threads
  5 Thread 0xb75e0b70 (LWP 8094)  0xb7899430 in __kernel_vsyscall ()
  4 Thread 0xb6ddfb70 (LWP 8095)  0xb7899430 in __kernel_vsyscall ()
  3 Thread 0xb65deb70 (LWP 8096)  0xb7899430 in __kernel_vsyscall ()
  2 Thread 0xb53feb70 (LWP 8098)  0xb7899430 in __kernel_vsyscall ()
* 1 Thread 0xb75e2b30 (LWP 8093)  0xb7899430 in __kernel_vsyscall ()
(gdb) thread 1
[Switching to thread 1 (Thread 0xb75e2b30 (LWP 8093))]#0  0xb7899430 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7899430 in __kernel_vsyscall ()
#1  0xb7749245 in sem_wait@@GLIBC_2.1 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x08157873 in cEvents::Wait (this=0x8f10db8) at WebServer/cEvents.cpp:99
#3  0x0815c96a in webserver::Stop (this=0x8f10d88) at WebServer/WebServer.cpp:402
#4  0x080b5998 in ~cWebAdmin (this=0x8f10b60, __in_chrg=<value optimized out>) at source/cWebAdmin.cpp:69
#5  0x080a60f5 in cRoot::Start (this=0xbfe20808) at source/cRoot.cpp:145
#6  0x080cb500 in main (argc=1, argv=0xbfe20954) at source/main.cpp:79
(gdb) thread 2
[Switching to thread 2 (Thread 0xb53feb70 (LWP 8098))]#0  0xb7899430 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7899430 in __kernel_vsyscall ()
#1  0xb774a168 in accept () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x080ae9ed in cSocket::Accept (this=0x8f12548) at source/cSocket.cpp:240
#3  0x080a9997 in cServer::StartListenClient (this=0x8f12a48) at source/cServer.cpp:259
#4  0x080a8db7 in cServer::ServerListenThread (a_Args=0x8f12a48) at source/cServer.cpp:95
#5  0x080b37cb in cThread::MyThread (a_Param=0xb5c119b0) at source/cThread.cpp:114
#6  0xb774296e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#7  0xb76b0a4e in clone () from /lib/tls/i686/cmov/libc.so.6
(gdb) thread 3
[Switching to thread 3 (Thread 0xb65deb70 (LWP 8096))]#0  0xb7899430 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7899430 in __kernel_vsyscall ()
#1  0xb7749245 in sem_wait@@GLIBC_2.1 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x08128e27 in cEvent::Wait (this=0x8f142bc) at source/cEvent.cpp:93
#3  0x0811b182 in cChunkGenerator::Execute (this=0x8f14290) at source/cChunkGenerator.cpp:120
#4  0x0813ad20 in cIsThread::thrExecute (iParam=0x8f14290) at source/cIsThread.h:60
#5  0xb774296e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb76b0a4e in clone () from /lib/tls/i686/cmov/libc.so.6
(gdb) thread 4
[Switching to thread 4 (Thread 0xb6ddfb70 (LWP 8095))]#0  0xb7899430 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7899430 in __kernel_vsyscall ()
#1  0xb7749245 in sem_wait@@GLIBC_2.1 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x08128e27 in cEvent::Wait (this=0x8f1421c) at source/cEvent.cpp:93
#3  0x080944fb in cWorldStorage::Execute (this=0x8f141e0) at source/WorldStorage.cpp:247
#4  0x0813ad20 in cIsThread::thrExecute (iParam=0x8f141e0) at source/cIsThread.h:60
#5  0xb774296e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb76b0a4e in clone () from /lib/tls/i686/cmov/libc.so.6
(gdb) thread 5
[Switching to thread 5 (Thread 0xb75e0b70 (LWP 8094))]#0  0xb7899430 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7899430 in __kernel_vsyscall ()
#1  0xb774a168 in accept () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x0815840d in SocketServer::Accept (this=0x8f10d98) at WebServer/Socket.cpp:228
#3  0x0815c988 in webserver::Begin (this=0x8f10d88) at WebServer/WebServer.cpp:410
#4  0x080b7836 in cWebAdmin::ListenThread (lpParam=0x8f10b60) at source/cWebAdmin.cpp:322
#5  0xb774296e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb76b0a4e in clone () from /lib/tls/i686/cmov/libc.so.6
(gdb)

6, To quit gdb, use "q" command; it will ask if it's okay to detach from the MCServer process, answer "y".
Reply
Thanks given by:


Messages In This Thread
RE: r279 - stop/restart doesn't work - by xoft - 02-17-2012, 05:21 AM
RE: r279 - stop/restart doesn't work - by tbar - 02-17-2012, 05:59 PM
RE: r279 - stop/restart doesn't work - by xoft - 02-17-2012, 06:51 PM
RE: r279 - stop/restart doesn't work - by tbar - 02-17-2012, 08:05 PM
RE: r279 - stop/restart doesn't work - by xoft - 02-17-2012, 09:01 PM
RE: r279 - stop/restart doesn't work - by xoft - 02-17-2012, 11:11 PM
RE: r279 - stop/restart doesn't work - by tbar - 02-18-2012, 08:41 PM



Users browsing this thread: 1 Guest(s)