https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290844

--- Comment #6 from Bryan Drewery <[email protected]> ---
I think this is relevant.

Timeout sends SIGCONT and the child gets interrupted and exits thinking it got
a timeout on select.

Sh's read code assumes that [EINTR] is due to timeout. So the real problem is
spurious [EINTR] on SIGCONT.

if (tv.tv_sec >= 0) {
        /*
         * Wait for something to become available.
         */
        FD_ZERO(&ifds);
        FD_SET(0, &ifds);
        status = select(1, &ifds, NULL, NULL, &tv);
        /*
         * If there's nothing ready, return an error.
         */
        if (status <= 0) {
                while (*ap != NULL)
                        setvar(*ap++, "", 0);
                sig = pendingsig;
                return (128 + (sig != 0 ? sig : SIGALRM));
        }
}

The ktrace part:

 22638 timeout  GIO   fd 2 wrote 39 bytes
       "sending signal CONT(19) to command 'sh'"
 22638 timeout  RET   write 39/0x27
 22638 timeout  CALL  write(0x2,0xdbac192f587,0x1)
 22638 timeout  GIO   fd 2 wrote 1 byte
       "
       "
 22638 timeout  RET   write 1
 22638 timeout  CALL  getpid
 22638 timeout  RET   getpid 22638/0x586e
 22638 timeout  CALL  procctl(P_PID,0x586e,PROC_REAP_KILL,0xdbabfbe4c40)
 22643 sh       RET   select -1 errno 4 Interrupted system call
 22643 sh       CALL  write(0x1,0x437a0ee54000,0x4)
 22638 timeout  RET   procctl 0
 22638 timeout  CALL  sigsuspend(0xdbabfbe4f18)
 22638 timeout  PSIG  SIGCHLD caught handler=0xdb29fa6d1c0 mask=0xfffefeff
code=CLD_CONTINUED
 22638 timeout  RET   sigsuspend -1 errno 4 Interrupted system call
 22638 timeout  CALL  sigreturn(0xdbabfbe4000)
 22638 timeout  RET   sigreturn JUSTRETURN
 22638 timeout  CALL 
wait6(P_ALL,-1,0xdbabfbe4c8c,0x11<WNOHANG|WEXITED>,0,0xdbabfbe4e30)
 22638 timeout  RET   wait6 0
 22638 timeout  CALL  sigsuspend(0xdbabfbe4f18)
 22643 sh       GIO   fd 1 wrote 4 bytes
       "142
       "
 22643 sh       RET   write 4
 22643 sh       CALL  _exit(0x1)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to