the behavior is definitley different
it may be a bug depending on the semantics expected
in some cases there are subtle differences between signals
delivered by the kernel vs. by the user (via kill or raise)
e.g.,
kill -SEGV $pid
will deliver SIGSEGV to $pid, but it doesn't necessarily mean
that $pid had a segmentation violation
in general, a shell signal/trap test that loops through all
signal numbers must take the semantics of some signals into account
e.g., SIGKILL cannot be trapped, SIGSTOP may stop the process, ...
re SIGCHLD, ksh93 compiled with SHOPT_BGX (now by default),
imposes specific semantics on SIGCHLD -- a one-one association
between a child process exit (or status change) and a
SIGCHLD trap delivery
without this semantic it is fairly difficult to code a
script that reliably keeps track of its children
granted, this is a change from previous ksh releases,
but in defense of the change, it went from
"unreliable to the point of being useless" to "reliably useful"
here is how ksh93 can be used to keep track of the exit status
of all child processes
echo $(
{
trap 'echo $?' CHLD
kill -CHLD $$
for i in 1 2 3 4 5 6 7 8 9
do { exit $i; } &
done
wait
} |
sort
)
this should print "1 2 3 4 5 6 7 8 9" every time
a similar loop in bash misses every single SIGCHLD on my linux.i386-64
you are correct that --monitor/--nomonitor has no effect
with SHOPT_BGX enabled
On Wed, 16 Dec 2009 11:56:21 +0100 Dr. Werner Fink wrote:
> the feature of the compile SHOPT_BGX option had caused a
> bug report here. The user had tested within a loop all
> available signals and raised a major bugzilla report due
> not working signal 17 (which is SIGCHLD on his systems).
> I'd like to ask if this new feauture could be enabled and
> disabled at runtime by a shell variable e.g. within the
> `.sh' parameter array or with an option name which could
> be enabled or disabled with `set -o' ... AFAICS the option
> monitor does not influence the behaviour (JM 93t+ 2009-12-04)
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers