[BusyBox] Bug in tar

Glenn McGrath bug1 at optushome.com.au
Sat Jan 20 02:45:33 UTC 2001


Francois-R Boyer wrote:
> 
> What I can tell is that if you leave it the way it is (with the "signal(SIGCHLD,
> child_died);") it often does a segmentation fault.  If you remove that line, it works
> (the program terminates) with all the files I've tested, and I've tested also with
> corrupted files.  But with corrupted files, no error message is displayed.
> 
> If you want to handle correctly signals, have message displayed and terminate process
> in the right order, you must:
>   Continue decompression even if the pipe is broken, so that the correct "invalid
> compressed data..." error is displayed.
>   Wait for unzip to terminate before we exit tar, so that the error message is
> displayed before the command prompt.
> 
> How to do that:
> 
>   in gunzip.c/write_buf:
>     if (n == (unsigned) (-1)) {
>         if(errno == EPIPE) return;    /* add this line, to ignore broken pipe error */
> 
>         write_error_msg();
>     }
> 

What about handling a broken pipe when called from gunzip itself rather
than from tar ?


Glenn





More information about the busybox mailing list