|
Home > Archive > Unix Programming > July 2007 > SIGSTOP ignored?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| blah243@gmail.com 2007-07-13, 7:21 pm |
| Hello, I am debugging something and would like a process to suspend
temporarily. I wrote a script to send a SIGSTOP signal to that process
when another process is present. However, after receiving SIGSTOP, the
process I want to suspend keeps executing. I know that process get the
SIGSTOP from strace:
[pid 6850] 07:18:58.562518 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid 6850] 07:18:58.562749 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid 6850] 07:18:58.562970 wait4(-1, NULL, 0, NULL) = 6900
[pid 6850] 07:18:58.566868 open("/tmp/data-6850", O_RDONLY) = 3
[pid 6850] 07:18:58.567065 fstat(3, {st_mode=S_IFREG|0644,
st_size=5, ...}) = 0
[pid 6850] 07:18:58.567218 mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af684160000
[pid 6850] 07:18:58.567315 fstat(3, {st_mode=S_IFREG|0644,
st_size=5, ...}) = 0
[pid 6850] 07:18:58.567450 lseek(3, 0, SEEK_SET) = 0
[pid 6850] 07:18:58.569768 read(3, "6904\n", 5) = 5
[pid 6850] 07:18:58.570754 lseek(3, 5, SEEK_SET) = 5
[pid 6850] 07:18:58.570906 close(3) = 0
[pid 6850] 07:18:58.571067 munmap(0x2af684160000, 4096) = 0
Does anybody know how this could be possible? SIGSTOP should not be
ignored, caught, or blocked.
Thanks.
| |
| Stephane CHAZELAS 2007-07-14, 7:21 am |
| 2007-07-14, 00:12(-00), blah243@gmail.com:
> Hello, I am debugging something and would like a process to suspend
> temporarily. I wrote a script to send a SIGSTOP signal to that process
> when another process is present. However, after receiving SIGSTOP, the
> process I want to suspend keeps executing. I know that process get the
> SIGSTOP from strace:
>
> [pid 6850] 07:18:58.562518 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
> [pid 6850] 07:18:58.562749 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[...]
SIGSTOP can't be trapped/ignored, here the behavior you observe
is due to strace and the way it works. If you're interested, you
can have a look at the ptrace(2) man page, that's what strace
uses to trace a command.
--
Stéphane
| |
| Roger Leigh 2007-07-14, 7:21 am |
| | |
|
| Roger Leigh wrote:
> blah243 wrote:
>
>
> Is there a SIGSTOP signal handler? Or, is it set to SIG_IGN?
"That's un-possible!"
http://www.opengroup.org/onlinepubs.../sigaction.html
The system will not allow the action for the signals SIGKILL or SIGSTOP
to be set to SIG_IGN.
The system will not allow a process to catch the signals SIGKILL and
SIGSTOP.
|
|
|
|
|