Package: bash
Version: 4.1-3
1. Start bash.
2. echo $$
3. In another xterm, run
strace -vvs500 -f -pPID -ot
where PID is from the above
4. In the first bash, say:
cat <(cat)
This currently results in the message
cat: -: Input/output error
but that's not what I'm complaining about here.
Look at the strace in the file t. You will see that the pid you're
tracing does this:
21789 read(0, "\r", 1) = 1
21789 write(2, "\n", 1) = 1
21789 rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
21789 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {c_iflags=0x400, c_oflags=0x5,
c_cflags=0xbf, c_lflags=0x8a31, c_line=0, c_cc[VMIN]=1, c_cc[VTIME]=0,
c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x00\x00\x00\x00"})
= 0
21789 ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {c_iflags=0x500, c_oflags=0x5,
c_cflags=0xbf, c_lflags=0x8a3b, c_line=0,
c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"})
= 0
21789 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {c_iflags=0x500, c_oflags=0x5,
c_cflags=0xbf, c_lflags=0x8a3b, c_line=0,
c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"})
= 0
21789 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
21789 rt_sigaction(SIGINT, {0x809c7c0, [], 0}, {0x80e2d40, [], 0}, 8) = 0
21789 rt_sigaction(SIGTERM, {SIG_IGN, [], 0}, {SIG_IGN, [], 0}, 8) = 0
21789 rt_sigaction(SIGQUIT, {SIG_IGN, [], 0}, {SIG_IGN, [], 0}, 8) = 0
21789 rt_sigaction(SIGALRM, {0x809c500, [HUP INT ILL TRAP ABRT BUS FPE USR1
SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], 0}, {0x80e2d40, [], 0}, 8) = 0
21789 rt_sigaction(SIGTSTP, {SIG_IGN, [], 0}, {SIG_IGN, [], 0}, 8) = 0
21789 rt_sigaction(SIGTTOU, {SIG_IGN, [], 0}, {SIG_IGN, [], 0}, 8) = 0
21789 rt_sigaction(SIGTTIN, {SIG_IGN, [], 0}, {SIG_IGN, [], 0}, 8) = 0
21789 rt_sigaction(SIGWINCH, {0x809c310, [], 0}, {0x80e2c20, [], SA_RESTART},
8) = 0
21789 rt_sigaction(SIGINT, {0x809c7c0, [], 0}, {0x809c7c0, [], 0}, 8) = 0
21789 time(NULL) = 1339510903
21789 pipe([3, 5]) = 0
21789 fcntl64(63, F_GETFD) = -1 EBADF (Bad file descriptor)
21789 dup2(3, 63) = 63
21789 close(3) = 0
21789 rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
21789 pipe([3, 6]) = 0
21789 clone(child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xf7588728)
= 21829
It puts those signals back shortly after the clone. So you see that
bash has temporarily ignored various signals. This is not correct.
If any of those signals arrive during this time, bash will wrongly
ignore the signal.
If the purpose is to ignore these signals in the child, they should be
blocked around the fork, and set to IGN in the child.
thanks,
Ian.
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]