Summary: | app-shells/bash-4.0_p28: wait with trap SIGCHLD has different behaviour from bash-3.2 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alex Efros <powerman-asdf> |
Component: | New packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED UPSTREAM | ||
Severity: | major | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Alex Efros
2009-09-25 05:03:55 UTC
I've also reported this using bashbug, and got some replies: ---cut--- From: Chet Ramey <chet.ramey@case.edu> > Bash Version: 4.0 > Patch Level: 28 > Release Status: release > > Description: > Looks like 'wait' command in bash-4 is broken: if used together > with 'trap myhandler SIGCHLD' the 'wait' (without params) exit > just after receiving first child exit, instead of waiting for all > childs exit. Posix requires this behavior. "When the shell is waiting, by means of the wait utility, for asynchronous commands to complete, the reception of a signal for which a trap has been set shall cause the wait utility to return immediately with an exit status >128, immediately after which the trap associated with that signal shall be taken." This was reported as a bug against bash-3.2. Chet ---cut--- ---cut--- From: Chet Ramey <chet.ramey@case.edu> > > This was reported as a bug against bash-3.2. > > Cool. Is there any hint/doc/faq/how-to implement old behaviour, i.e. wait > until all children of current bash process will exit? I imagine a loop on wait until it returns because there are no unwaited-for children. You can detect the "interrupted" exit status and behave accordingly. I'll probably make this posix-mode-specific behavior or add an option for it in the next version. > P.S. I've not seen this information in 'help wait' or 'man bash' - is this > current 'correct' behaviour is documented? No. I'm not able to put everything from the Posix spec into a man page. Chet ---cut--- you can read the POSIX specs: http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html |