You are not logged in.
Pages: 1
Hello all,
From strace's man page, we get:
Signals are printed as a signal symbol and a signal string. An excerpt from stracing and interrupting the command ``sleep 666'' is:
sigsuspend([] <unfinished ...>
--- SIGINT (Interrupt) ---
+++ killed by SIGINT +++
However when I run the code, this what I get (I pressed Ctrl-C after double pressing <Enter>):
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2109216, ...}) = 0
mmap(NULL, 2109216, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f270e17a000
close(3) = 0
nanosleep({666, 0},
^C <unfinished ...>
Ideas? More generally, how can I discover which signal is a program receiving (without modifying the source).
Thanks in advance.
Last edited by gauthma (2011-10-23 00:57:58)
Offline
You're invoking the program in the context of strace rather than running the program and attaching strace to the PID.
$ sleep 60
In another term, launch strace and then go back to the first and ^c.
$ strace -p $(pgrep sleep)
Process 26801 attached - interrupt to quit
restart_syscall(<... resuming interrupted call ...>) = ? ERESTART_RESTARTBLOCK (To be restarted)
--- {si_signo=SIGINT, si_code=SI_KERNEL, si_value={int=1, ptr=0x1}} (Interrupt) ---
Process 26801 detached
Offline
Yes, that was it. Thank you very much for the help!
Offline
Pages: 1