Your message dated Wed, 10 Jun 2009 07:31:19 -0600
with message-id <1244640679.32208.68.ca...@rover>
has caused the   report #532570,
regarding tar - relies on standard SIGPIPE behaviour
to be marked as having been forwarded to the upstream software
author(s) bug-...@gnu.org

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
532570: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532570
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Please comment on the attached patch from Bastian Blank regarding
SIGPIPE behavior proposed for inclusion in my Debian packaging of tar.

Bdale

--- Begin Message ---
Package: tar
Version: 1.22-1
Severity: grave

tar is not longer able to read tar files with some garbage at the end
under some condition. If it is called from the shell, the resulting
SIGPIPE kills the called bzip2 process and tar swallows the error:

| close(3)                                = 0
| waitpid(18165, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGPIPE}], 0) = 18165
| --- SIGCHLD (Child exited) @ 0 (0) ---
| [...]
| exit_group(0)                           = ?

In the other case I call it via a python script. The python interpreter
collects SIGPIPE by default and the setting is persistent in the child
processes. So the SIGPIPE is now collected by bzip2 and converted
into an error:

| write(1, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 
-1 EPIPE (Broken pipe)
| --- SIGPIPE (Broken pipe) @ 0 (0) ---
| [...]
| exit_group(1)                           = ?

| close(3)                                = 0
| waitpid(18105, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0) = 18105
| --- SIGCHLD (Child exited) @ 0 (0) ---
| [...]
| exit_group(2)                           = ?

| bzip2: I/O or other error, bailing out.  Possible reason follows.
| bzip2: Broken pipe
|         Input file = (stdin), output file = (stdout)
| tar: Child returned status 1
| tar: Exiting with failure status due to previous errors

It seems that tar now relies on the behaviour that SIGPIPE kills the
child and therfor needs to properly set it up.

Bastian

-- 
You're too beautiful to ignore.  Too much woman.
                -- Kirk to Yeoman Rand, "The Enemy Within", stardate unknown

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
tags 532570 patch
thanks

Patch. I cleaned the autoconf cruft from it, please fix that.

Bastian
diff -u tar-1.22/debian/changelog tar-1.22/debian/changelog
--- tar-1.22/debian/changelog
+++ tar-1.22/debian/changelog
@@ -1,3 +1,10 @@
+tar (1.22-1.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Set SIGPIPE to default action.
+
+ -- Bastian Blank <wa...@debian.org>  Wed, 10 Jun 2009 11:12:47 +0200
+
 tar (1.22-1) unstable; urgency=low
 
   * new upstream version
--- tar-1.22.orig/src/system.c
+++ tar-1.22/src/system.c
@@ -470,6 +470,10 @@
 
   program_name = _("tar (child)");
 
+  /* We need the default SIGPIPE behaviour in our subprocesses */
+
+  signal (SIGPIPE, SIG_DFL);
+
   xdup2 (parent_pipe[PWRITE], STDOUT_FILENO);
   xclose (parent_pipe[PREAD]);
 

Attachment: signature.asc
Description: Digital signature


--- End Message ---

--- End Message ---

Reply via email to