Joe.Z
Joe.Z

Reputation: 2745

can I tell if a pocess was killed or it crashed itself by stack dump?

I got a dumping stack when the process was killed.

(gdb)
Thread 2 (Thread 0xf6ec6b90 (LWP 10941)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xf7a47525 in *__GI___poll (fds=0xf7fb1558, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xf7f9138a in timer_thread_entry (arg=0x0)
    at ../../../ux/com_ux/libux/com/UXtimer2.c:509
#3  0xf797be7b in start_thread (arg=0xf6ec6b90) at pthread_create.c:298
#4  0xf7a4ff9e in clone () from /lib/libc.so.6

Thread 1 (Thread 0xf796d8d0 (LWP 10686)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xf7a517d9 in __libc_msgrcv (msqid=1736749, msgp=0xff99cb78, msgsz=2160,
    msgtyp=0, msgflg=0) at ../sysdeps/unix/sysv/linux/msgrcv.c:59
#2  0xf7f6f647 in _CT_getmsg (mode=0, msgp=0xff99cb78, pmaxtime=0xff99cb6c,
    pdata=0xf7faf180, ux_type=0) at ../../../ux/com_ux/libux/com/UXipc.c:2550
#3  0xf7f6fec5 in CT_getmsg_v2 (mode=0, msgp=0xff99cb78, maxtime=10000,
    ux_type=0) at ../../../ux/com_ux/libux/com/UXipc.c:2237
#4  0x0804afe9 in main (argc=1, argv=0xff99d4b4)
    at ../../../../main/CT_main.cpp:271
#0  0xffffe410 in __kernel_vsyscall ()
  1. why are there two threads? How they are linked together?
  2. By this dumping, can it show the process was crashed itself, or killed by other.
  3. In "0xf7a47525 in *GI_poll (fds=0xf7fb1558, nfds=1, timeout=-1)", what did "timeout=-1" mean?
  4. how poll system call involved here?

thank you very much!

Upvotes: 1

Views: 159

Answers (1)

Nikolai
Nikolai

Reputation: 1335

  1. Somewhere in main program function clone() was called to create separate thread - apparently for socket handling.
  2. Most probably the process crashed in msgrcv() function because of its arguments. If crash dump created because of signal you will see signal handler in stack trace.
  3. timeout = -1 means an infinite timeout.
  4. It was not involved - the thread was blocked in it.

Upvotes: 3

Related Questions