Thorsten Glaser <[email protected]> wrote:
|Steffen Daode Nurpmeso dixit:
|
|>i see a problem with mksh(1) R41c on NetBSD 6.99.16, which can
|>easily be produced by compiling lib/libedit/TEST/rl1.c: simply
|>start the program and interrupt it via C-c, and the kill(0,X)
|>seems to be propagated through the shell, i.e., the entire
|>ssh->mksh->rl1 session terminates.
|
|Hmm, this doesn't happen on MirBSD. I just checked out NetBSD®
|CVS HEAD src/lib/libedit, built it (without getpw*_r) and rl1,
|ssh'd to localhost, switched PS1 to see, ran ./rl1 and then
|pressed ^C. Only rl1 was terminated.
Well, the minimal code to reproduce is
#include <signal.h>
#include <unistd.h>
static void
onsig(int sig)
{
signal(SIGINT, SIG_DFL);
kill(0, SIGINT);
}
int
main(void)
{
signal(SIGINT, &onsig);
kill(getpid(), SIGINT);
return 0;
}
It doesn't happen with "@(#)MIRBSD KSH R40 2012/10/30" on MacOS X,
but it does happen on NetBSD 6.99.16 and with "@(#)MIRBSD KSH R41
2013/02/15" (which passes the test-suite without errors btw).
|So this is probably a TNF-local problem.
|
|This may (or may not) be related to the followin feature request:
|https://bugs.launchpad.net/mksh/+bug/1064726
This will be interesting to read tomorrow. All this is very
complicated and hopeless (i *hate* signals and jumps), but in the
end i really don't think that a login shell should terminate when
a child process receives SIGINT.
|If you suspect this is the case, you’re welcome to help develop
|and test a patch.
Uuh, mksh(1) is a complex and grown codebase, but maybe i'll be
able to overcome it :)
|>Besides -- thanks for mksh(1), i'm a rather happy user.
|
|Thanks, that’s always good to hear.
Yeaaah... the user experience would be even better if the website
would describe how to subscribe to miros-mksh@.
:)
|bye,
|//mirabilos
Ciao,
--steffen