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

signal weirdness



I got these results on Solaris 2.5.1 and SunOS 4.1.4, not tested
anywhere else.

Create a program called "segv", from this source or something equivalent:

main() { *(volatile char *)0 = 1; }

(I.e., the program will die with a SIGSEGV.)

Run the script:

trap 'echo SIGSEGV' SEGV
foo=$(segv)
echo finished
exit 0

When the segv program terminates, zsh acts as if it had received a
SIGSEGV (it executes the trap), despite the fact that it was its child
process that received it.  This doesn't happen if the signal is not
trapped.

The same happens if the command is run directly, rather than being
within $().

I'm not looking into this at the moment; I'm not familiar with the
signal code, and I have more urgent things to do.  I hope someone can
diagnose this.

-zefram



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