bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] problem with sys_drain_input_pipe() removal


From: Mike Frysinger
Subject: [Bug-tar] problem with sys_drain_input_pipe() removal
Date: Mon, 29 Dec 2008 05:01:25 -0500
User-agent: KMail/1.10.3 (Linux/2.6.28; KDE/4.1.3; x86_64; ; )

recently (2008-11-25), this change was committed:
2008-11-25  Sergey Poznyakoff  <address@hidden>
        Do not try to drain the input pipe before closing the
        archive.

        * src/buffer.c (close_archive): Remove call to
        sys_drain_input_pipe. Pass hit_eof as the second
        argument to sys_wait_for_child.
        * src/common.h (sys_drain_input_pipe): Remove
        (sys_wait_for_child): Declare second argument.
        * src/system.c (sys_drain_input_pipe): Remove.
        (sys_wait_for_child): Take two arguments. The second one helps to
        decide whether to tolerate child termination on SIGPIPE.

unfortunately, this causes problems with simple operations.  for example, 
download this tarball:
ftp://ftp.gnome.org/pub/gnome/sources/glibmm/2.18/glibmm-2.18.1.tar.bz2

and then attempt to unpack it by doing:
$ bzip2 -dc glibmm-2.18.1.tar.bz2 | tar xof -

you wont get any error from tar and everything will be extracted correctly, 
but bzip2 itself will die with SIGPIPE as can be seen in both strace:
write(1, "glibmm-2.18.1/\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) ---
+++ killed by SIGPIPE +++
and by bash itself:
$ echo address@hidden
141 0

you may say "well just check the exit status of tar and go with that", but 
that doesnt work for cases where the decompressor crashes/exits/whatever early 
on and tar gets a short archive.  you may also say "well change how you evoke 
tar", but that isnt trivial to do as we support a wide range of tar versions 
(not just GNU, and not any GNU specific version).
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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