signal problem...

Raul Miller (rdm@tad.micro.umn.edu)
21 Mar 1996 04:11:33 GMT


For some reason, SIGSTOP isn't stopping.

Linux kernel 1.3.75
libc 5.2.18
gcc 2.7.2

#define _USE_BSD
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <signal.h>

main() {
int fds[2];
int pid;
int status;
pipe(fds);
if (pid=fork()) {
write(fds[1], "\031\1", 2);
printf("%d\n", wait3(&status, WUNTRACED, 0));
} else {
close(fds[1]);
dup2(fds[0], 0);
kill(getpid(), SIGSTOP);
write(1, "...\n", 4);
}
}

compiled -static for a clean strace (but works the same either way):

personality(0) = 0
pipe([4, 5]) = 0
fork() = 15184
[pid 15183] write(5, "\31\1", 2) = 2
[pid 15183] wait4(-1, <unfinished ...>
[pid 15184] close(5) = 0
[pid 15184] dup2(4, 0) = 0
[pid 15184] getpid() = 15184
[pid 15184] kill(15184, SIGSTOP) = 0
[pid 15184] --- SIGSTOP (Stopped (signal)) ---
[pid 15184] write(1, "...\n", 4...
) = 4
[pid 15184] _exit(4) = ?
<... wait4 resumed> [WIFEXITED(s) && WEXITSTATUS(s) == 4], WUNTRACED, NULL) = 15184
fstat(1, {st_mode=S_IFCHR|0666, st_rdev=makedev(4, 193), ...}) = 0
brk(0) = 0x8011b24
brk(0x8014b24) = 0x8014b24
brk(0x8015000) = 0x8015000
brk(0x8016000) = 0x8016000
ioctl(1, TCGETS, {B38400 opost isig icanon -echo ...}) = 0
write(1, "15184\n", 615184
) = 6
_exit(6) = ?

-- 
Raul