bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] [Fwd: Bug#532570: tar - relies on standard SIGPIPE behaviour]


From: Bdale Garbee
Subject: [Bug-tar] [Fwd: Bug#532570: tar - relies on standard SIGPIPE behaviour]
Date: Wed, 10 Jun 2009 07:31:19 -0600

Please comment on the attached patch from Bastian Blank regarding
SIGPIPE behavior proposed for inclusion in my Debian packaging of tar.

Bdale

--- Begin Message --- Subject: Bug#532570: tar - relies on standard SIGPIPE behaviour Date: Wed, 10 Jun 2009 11:09:32 +0200 User-agent: Mutt/1.5.18 (2008-05-17)
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 --- Subject: Bug#532570: tar - relies on standard SIGPIPE behaviour Date: Wed, 10 Jun 2009 12:08:57 +0200 User-agent: Mutt/1.5.18 (2008-05-17)
tags 532570 patch
thanks

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

Bastian

Attachment: diff
Description: Text document

Attachment: signature.asc
Description: Digital signature


--- End Message ---

reply via email to

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