autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.68-94-g


From: Stefano Lattarini
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.68-94-gf609165
Date: Thu, 06 Oct 2011 08:36:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=f60916593d64a8ce41c75b1be00811a9175dda63

The branch, master has been updated
       via  f60916593d64a8ce41c75b1be00811a9175dda63 (commit)
       via  124d6e9d9632e66a1ca0f4e77dc471e08b3f9818 (commit)
      from  00f569ae0c38b5e2997bc6194f68d4d7a9a23577 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f60916593d64a8ce41c75b1be00811a9175dda63
Author: Stefano Lattarini <address@hidden>
Date:   Thu Sep 29 10:46:54 2011 +0200

    docs: some fixlets in section about shell signal handling
    
    * doc/autoconf.texi (Signal handling): Rename ...
    (Signal Handling): ... to this, for consistency with other node
    names.  Fix some typos and grammaros.  Add more URL references
    in comments.

commit 124d6e9d9632e66a1ca0f4e77dc471e08b3f9818
Author: Stefano Lattarini <address@hidden>
Date:   Thu Sep 29 10:36:18 2011 +0200

    docs: korn shells can have $? > 256 for signal-terminated children
    
    Some Korn shells, when a child process dies due to signal number
    n, can leave in $? an exit status of 256+n, instead of the more
    common 128+n.  See also Austin Group issue 0000051:
      <http://www.austingroupbugs.net/view.php?id=51>
    
    * doc/autoconf.texi (Signal handling): Document the described Korn
    Shell behaviour, and some of its possible shortcomings.
    
    Suggestion by Eric Blake.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |   19 +++++++++++++
 doc/autoconf.texi |   77 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 89 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index be019f5..b74208f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2011-10-06  Stefano Lattarini  <address@hidden>
+
+       docs: some fixlets in section about shell signal handling
+       * doc/autoconf.texi (Signal handling): Rename ...
+       (Signal Handling): ... to this, for consistency with other node
+       names.  Fix some typos and grammaros.  Add more URL references
+       in comments.
+
+2011-10-06  Stefano Lattarini  <address@hidden>
+
+       docs: korn shells can have $? > 256 for signal-terminated children
+       Some Korn shells, when a child process dies due to signal number
+       n, can leave in $? an exit status of 256+n, instead of the more
+       common 128+n.  See also Austin Group issue 0000051:
+         <http://www.austingroupbugs.net/view.php?id=51>
+       * doc/autoconf.texi (Signal handling): Document the described Korn
+       Shell behaviour, and some of its possible shortcomings.
+       Suggestion by Eric Blake.
+
 2011-09-26  Eric Blake  <address@hidden>
 
        docs: relax documentation license by dropping cover text
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 91bb50a..56ce990 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -503,7 +503,7 @@ Portable Shell Programming
 * Shellology::                  A zoology of shells
 * Here-Documents::              Quirks and tricks
 * File Descriptors::            FDs and redirections
-* Signal handling::             Shells, signals, and headaches
+* Signal Handling::             Shells, signals, and headaches
 * File System Conventions::     File names
 * Shell Pattern Matching::      Pattern matching
 * Shell Substitutions::         Variable and command expansions
@@ -15067,7 +15067,7 @@ subset described above, is fairly portable nowadays.  
Also please see
 * Shellology::                  A zoology of shells
 * Here-Documents::              Quirks and tricks
 * File Descriptors::            FDs and redirections
-* Signal handling::             Shells, signals, and headaches
+* Signal Handling::             Shells, signals, and headaches
 * File System Conventions::     File names
 * Shell Pattern Matching::      Pattern matching
 * Shell Substitutions::         Variable and command expansions
@@ -15520,8 +15520,8 @@ ksh[1]: exec: 10: not found
 @end example
 
 @c <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
address@hidden Signal handling
address@hidden Signal handling
address@hidden Signal Handling
address@hidden Signal Handling
 @cindex Signal handling in the shell
 @cindex Signals, shells and
 
@@ -15529,7 +15529,7 @@ Portable handling of signals within the shell is 
another major source of
 headaches.  This is worsened by the fact that various different, mutually
 incompatible approaches are possible in this area, each with its
 distinctive merits and demerits.  A detailed description of these possible
-approaches, as well as of their the pros and cons, can be found in
+approaches, as well as of their pros and cons, can be found in
 @uref{http://www.cons.org/cracauer/sigint.html, this article}.
 
 Solaris 10 @command{/bin/sh} automatically traps most signals by default;
@@ -15562,7 +15562,7 @@ signal 15:
 
 This gets even worse if one is using the POSIX `wait' interface to get
 details about the shell process terminations: it will result in the shell
-exiting normally, rather than by receiving a signal.
+having exited normally, rather than by receiving a signal.
 
 @example
 $ @kbd{cat > foo.c <<'END'}
@@ -15589,7 +15589,7 @@ Terminated by signal: yes
 Exited normally: no
 @end example
 
-Some shells seem to handle @code{SIGQUIT} specially: they ignore it even
+Various shells seem to handle @code{SIGQUIT} specially: they ignore it even
 if it is not blocked, and even if the shell is not running interactively
 (in fact, even if the shell has no attached tty); among these shells
 are at least Bash (from version 2 onwards), Zsh 4.3.12, Solaris 10
@@ -15599,6 +15599,7 @@ these shells.  OTOH, some other shells doesn't 
special-case the handling
 of @code{SIGQUIT}; among these shells are at least @code{pdksh} 5.2.14,
 Solaris 10 and NetBSD 5.1 @code{/bin/sh}, and the Almquist Shell 0.5.5.1.
 
address@hidden See: 
<http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
 Some shells (especially Korn shells and derivatives) might try to
 propagate to themselves a signal that has killed a child process; this is
 not a bug, but a conscious design choice (although its overall value might
@@ -15610,6 +15611,68 @@ and @code{/usr/xpg4/bin/sh} will proceed to exit with 
status 130 (i.e.,
 128 + 2). In any case, if there is an active trap associated with
 @code{SIGINT}, those shells will correctly execute it.
 
address@hidden See: <http://www.austingroupbugs.net/view.php?id=51>
+Some Korn shells, when a child process die due receiving a signal with
+signal number @var{n}, can leave in @samp{$?} an exit status of
address@hidden instead of the more common address@hidden  Observe the
+difference between AT&T @code{ksh93} (2011) and @code{bash} 4.1.5 on
+Debian:
+
address@hidden
+$ @kbd{/bin/ksh -c 'sh -c "kill -1 \$\$"; echo $?'}
+/bin/ksh: line 1: 7837: Hangup
+257
+$ @kbd{/bin/bash -c 'sh -c "kill -1 \$\$"; echo $?'}
+/bin/bash: line 1:  7861 Hangup        (sh -c "kill -1 \$\$")
+129
address@hidden example
+
address@hidden
+This @command{ksh} behavior is allowed by POSIX, if implemented with
+due care; see this @uref{http://www.austingroupbugs.net/view.php?id=51,
+Austin Group discussion} for more background.  However, if it is not
+implemented with proper care, such a behavior might cause problems
+in some corner cases.  To see why, assume we have a ``wrapper'' script
+like this:
+
address@hidden
+#!/bin/sh
+# Ignore some signals in the shell only, not in its child processes.
+trap : 1 2 13 15
+wrapped_command "$@@"
+ret=$?
+other_command
+exit $ret
address@hidden example
+
address@hidden
+If @command{wrapped_command} is interrupted by a @code{SIGHUP} (which
+has signal number 1), @code{ret} will be set to 257.  Unless the
address@hidden shell builtin is smart enough to understand that such
+a value can only have originated from a signal, and adjust the final
+wait status of the shell appropriately, the value 257 will just get
+truncated to 1 by the closing @code{exit} call, so that a caller of
+the script will have no way to determine that termination by a signal
+was involved.  Observe the different behavior of AT&T @code{ksh93}
+(2011) and @code{bash} 4.1.5 on Debian:
+
address@hidden
+$ @kbd{cat foo.sh}
+#!/bin/sh
+sh -c 'kill -1 $$'
+ret=$?
+echo $ret
+exit $ret
+$ @kbd{/bin/ksh foo.sh; echo $?}
+foo.sh: line 2: 12479: Hangup
+257
+1
+$ @kbd{/bin/bash foo.sh; echo $?}
+foo.sh: line 2: 12487 Hangup        (sh -c 'kill -1 $$')
+129
+129
address@hidden example
+
 @node File System Conventions
 @section File System Conventions
 @cindex File system conventions


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

[Prev in Thread] Current Thread [Next in Thread]