[BusyBox] Re: "rpm" fails with SIGSEGV
Rob Landley
rob at landley.net
Wed Nov 12 11:58:09 UTC 2003
On Wednesday 12 November 2003 04:56, Laurence Anderson wrote:
> > so i renamed it simply to apache.rpm. even with that name,
> > i could "rpm -qpi" and "rpm -qpl". but when i tried to install, i
> > immediately got SIGSEGV.
>
> Just testing rpm for myself, the extraction code doesn't seem to work too
> well...
>
> First problem I have identified is that the new read_gz code won't
> necessarly return the requested amount of data; archive_xread_all &
> archive_xread_all_eof don't handle this, unlike bb_xread_all which does.
> Attched some kind of solution. This works a bit better, but fails after a
> few files complaining about invalid magic... however the cpio applet works
> fine (which uses exactly the same code)... maybe something todo with the
> file being compressed?
Huh. I don't use RPM myself if I can avoid it, but...
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...)
By the way, I've seen a pipe return 4k chunks (one page). I don't know why,
but I've seen this before. And it doesn't seem to actually violate any spec,
so you just stick a for loop in the wrapper.
archive_xread_all isn't the right wrapper though. I'd fix the plain
archive_xread to always return the full amount of data that was asked for
even if the pipes are screwed up. (A read of length 0 indicates EOF, but a
short read does NOT indicate EOF. Unix portability issue, I'm told. Yes, I
asked...)
Rob
More information about the busybox
mailing list