[BusyBox] bzip status report...

Rob Landley rob at landley.net
Tue Nov 11 06:37:49 UTC 2003


Well, I found out something interesting.

My rewrite is up to the point of happily creating recognizable, but corrupt, 
bzip files.  That's not the interesting part.

The attached file out.bz2 is the interesting part.  It was an attempt to 
compress 100000 bytes of /dev/zero.  My decompression code recognizes it as 
having a bad crc and dies (although actually the CRC is correct but the data 
isn't).  jseward's bunzip2 code gets stuck in a loop spitting out null 
characters to the output file.  (I killed it after it had spit out 500 megs.  
Not bad for a 44 byte input archive.  Insert your own joke about religion, 
politics, or astronomy here.)

While I'm at it, here's a snapshot of my current code, attached largely for 
entertainment value.  I'm in the "vindictively tracking down and squashing 
bugs by following their trail through the desert for days" stage.  This code 
doesn't actually produce working archives yet (although it thinks it does), 
and it takes 1.7 seconds to compress 500k while the original takes 1.5 (and 
that's without the debug printfs slowing it down).  And the code is still 
pretty ugly, and I haven't even touched the block sorting stuff yet 
(everything in "crap.c").  And for all I know it's throwing off stray 
radiation and interfering with the orbit of the moon.  You have been warned.

BUT, it compiles to 13k ("gcc -Os bzip.c crap.c && strip a.out", 13.5 with the 
debug printfs).  And as I said, I haven't touched the block sorting code yet, 
which is over 6k of the resulting executable...

Rob

(Yes, I do this for fun.  I can't explain it and I'm not going to try...)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: out.bz2
Type: application/x-bzip2
Size: 44 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20031111/02ed289b/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzip.c
Type: text/x-csrc
Size: 14294 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20031111/02ed289b/attachment.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crap.c
Type: text/x-csrc
Size: 29817 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20031111/02ed289b/attachment-0001.c 


More information about the busybox mailing list