Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: 3.0.6-pre-5 problem and loop killing



>
> Which of course is the one thing Sven hasn't tried patching yet ... but I'm
> not sure WHY zsh is going through the third branch.  All of Sven's patches
> have been to the second branch.
>
> What's odd is that over in the 6860 "Re: PATCH: loop killing" thread, zsh
> DOESN'T get the signal when it's supposed to.  Maybe Sven's got the cases
> in which zsh takes the second and third branches, reversed?
>

Looking a bit more closely on truss of the two cases reveal, that they are quite
different:

this is from xterm -e zsh (the case, when ^Z does not work):

bor@itsrm2:~%> fgrep 'fork
execve
SIGCLD' /tmp/foo
8323:   execve("/usr/bin/X11/xterm", 0x000000FFFFFEEC30, 0x000000FFFFFEEC40)
argc = 1
8323:   fork()                                          = 8324
8324:   fork()          (returning as child ...)        = 8323
8324:   sighold(SIGCLD)                                 = SIG_DFL
8324:   fork()                                          = 8326
8323:   signal(SIGCLD, 0x00000000004068E0)              = SIG_DFL
8326:   fork()          (returning as child ...)        = 8324
8326:   execve("/usr/lib/pt_chmod", 0x000000007FFEE07C, 0x000000007FFEEDD4)
argc = 2
8324:   sigrelse(SIGCLD)                                = SIG_DFL
8324:       Received signal #18, SIGCLD [default]
8324:         siginfo: SIGCLD CLD_EXITED pid=8326 uid=1 status=0x0000
8324:   signal(SIGCLD, SIG_DFL)                         = SIG_DFL
8324:   execve("/tools/bin/zsh", 0x000000007FFEE0CC, 0x000000000049CE90)  argc =
1
8324:   sigaction(SIGCLD, 0x000000007FFEEC60, 0x0000000000000000) = 0
8324:   fork()                                          = 8331
8331:   fork()          (returning as child ...)        = 8324
8331:   execve("/usr/bin/zcat", 0x0000000000502B28, 0x0000000000505780)  argc =
1
8324:       Received signal #18, SIGCLD, in sigsuspend() [caught]
8324:         siginfo: SIGCLD CLD_KILLED pid=8331 uid=0 status=0x0002
8323:       Received signal #18, SIGCLD, in poll() [caught]
8323:         siginfo: SIGCLD CLD_EXITED pid=8324 uid=61 status=0x0082
bor@itsrm2:~%>

Note, that zsh doe exactly one fork/execve for zcat

And here is the same for the simple case zsh started from other zsh:

bor@itsrm2:/tools/src/zsh-3.1.5-pws-23%>

fgrep 'fork
execve
SIGCLD' /tmp/zsh.1}
12558:  execve("/tools/bin/zsh", 0x000000FFFFFEECF0, 0x000000FFFFFEED00)  argc =
1
12558:  sigaction(SIGCLD, 0x000000007FFEED00, 0x0000000000000000) = 0
12558:  fork()                                          = 12559
12559:  fork()          (returning as child ...)        = 12558
12559:  execve("/usr/bin/zcat", 0x0000000000502D60, 0x00000000004FE5A0)  argc =
1
12558:      Received signal #18, SIGCLD, in sigsuspend() [caught]
12558:        siginfo: SIGCLD CLD_STOPPED pid=12559 uid=0 status=0x0018
12558:  fork()                                          = 12561
12561:  fork()          (returning as child ...)        = 12558
12558:      Received signal #18, SIGCLD [caught]
12558:        siginfo: SIGCLD CLD_STOPPED pid=12561 uid=0 status=0x0017
12558:      Received signal #18, SIGCLD, in sigsuspend() [caught]
12558:        siginfo: SIGCLD CLD_CONTINUED pid=12559 uid=0 status=0x0019
12558:      Received signal #18, SIGCLD, in sigsuspend() [caught]
12558:        siginfo: SIGCLD CLD_KILLED pid=12559 uid=0 status=0x0002
12558:      Received signal #18, SIGCLD [caught]
12558:        siginfo: SIGCLD CLD_CONTINUED pid=12561 uid=0 status=0x0019
12558:      Received signal #18, SIGCLD [caught]
12558:        siginfo: SIGCLD CLD_KILLED pid=12561 uid=0 status=0x0002
bor@itsrm2:/tools/src/zsh-3.1.5-pws-23%>

Here zsh forks once more. I have no idea, where lies the difference (apart from
these PGID/SID). Both are equally *not* login shells and source the same
scripts.

/andrej



Messages sorted by: Reverse Date, Date, Thread, Author