[BusyBox] Re: "rpm" fails with SIGSEGV

Rob Landley rob at landley.net
Wed Nov 12 21:03:42 UTC 2003


On Wednesday 12 November 2003 10:54, Laurence Anderson wrote:
> On Wednesday 12 November 2003 12:47 pm, you wrote:
> > On Wed, 12 Nov 2003 05:58:09 -0600
> >
> > Rob Landley <rob at landley.net> wrote:
> > > Is this the new "fork and use a pipe" code?  (Glenn said he saw a bug
> > > like this.  I'm happy to try tracking it down if we can get a
> > > reproducible test case.  This is on a standard intel setup?  What
> > > kernel, what libc, etc...)
> >
> > The fork and pipe is only used in get_header_tar_bz2, i did a test and
> > reverted get_header_tar_gz to use fork and pipe and it was embarasingly
> > slow.
>
> The rpm code uses the read_gz interface, and is getting short reads (from
> archive_xreal_all_eof), what do you think of the patch?
>
> Out of interest, what was the reason for going back to the pipe & fork
> method?

bzip's interface changed, and behind the scenes in order to give you a fake 
filehandle we have to jump through hoops about as complex as the pipe and 
fork method anyway.  (Even doing it the old way, we're not giving you a 
generic filehandle that could work in a read call, we're just making it look 
like we are.  What we really want is a pointer to a structure holding the 
current decompression state, and if the only cookie you've got to store for 
us is an int, we have to do something ugly no matter which option we choose.)

Also, there's really no reason for pipe and fork to be noticeably slower than 
doing it any other way.  That's how the original tar does it.  Incestuous 
relationships between pieces of code are something to be minimized...

> Laurence

Rob



More information about the busybox mailing list