[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the
From: |
Stefano Lattarini |
Subject: |
Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself |
Date: |
Mon, 12 Sep 2011 18:19:49 +0200 |
User-agent: |
KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) |
Hi Paul.
On Monday 12 September 2011, Paul Eggert wrote:
> On 09/12/11 05:01, Stefano Lattarini wrote:
> > I'd like to know if anyone has an idea of
> > what's going on exactly, and how (and if) I can work around it.
>
> I'd guess it's tail recursion elimination: if the last thing
> a Korn shell does is run another program, it bypasses the
> fork and does an exec directly.
>
I don't understand how this is relevant here. The behaviour you're
describing does not apply in our situation (there is still an `echo'
command after the `perl' command where the SIGINT originates). The
problem is that the SIGINT is not being received only by the perl
process (as expected), but also by the Korn shell itself!
This example might show the problem more clearly:
$ cat foo.sh
#!/bin/ksh
trap 'echo killed by SIGINIT; exit 99' 2
perl -e 'kill 2, $$; print "hello\n"'
/bin/echo dead code
$ /bin/ksh foo.sh; echo $?
killed by SIGINIT
99
This is clearly a bug (and an horrible one if you ask me).
> Also, I'd guess that POSIX allows this behavior.
>
> Even if POSIX doesn't allow it, it's a nice optimization,
> and should be encouraged
>
But this is completely orthogonal to the issue under discussion.
Regards,
Stefano
- On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Stefano Lattarini, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Paul Eggert, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself,
Stefano Lattarini <=
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Paul Eggert, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Stefano Lattarini, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Paul Eggert, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Stefano Lattarini, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Paul Eggert, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Stefano Lattarini, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Stefano Lattarini, 2011/09/12
- Re: On solaris, a SIGINT sent to a child process of Korn Shell kills the shell itself, Stefano Lattarini, 2011/09/12