Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 239472 - dev-libs/zziplib-0.13.49 [-r1] generates Bus error on sparc, blocking texlive upgrade.
Summary: dev-libs/zziplib-0.13.49 [-r1] generates Bus error on sparc, blocking texlive...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: High normal (vote)
Assignee: SpanKY
Depends on:
Blocks: 237202
  Show dependency tree
Reported: 2008-10-03 19:37 UTC by Ferris McCormick (RETIRED)
Modified: 2008-12-31 22:44 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

zziplib-0.13.49-aligned-access.patch (zziplib-0.13.49-aligned-access.patch,3.44 KB, patch)
2008-10-03 21:36 UTC, Friedrich Oslage (RETIRED)
Details | Diff
zziplib-0.13.49-aligned-access.patch (zziplib-0.13.49-aligned-access.patch,1.25 KB, patch)
2008-11-17 19:12 UTC, Friedrich Oslage (RETIRED)
Details | Diff
alternative patch for 0.13.50 (zziplib-0.13.50.patch,3.29 KB, patch)
2008-12-31 18:01 UTC, Friedrich Oslage (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ferris McCormick (RETIRED) gentoo-dev 2008-10-03 19:37:06 UTC
dev-libs/zziplib-0.13.49 [-r1] are currently marked -sparc.  Building them with FEATURES=test generates a bus error (use of misaligned data item) about here (zip.c + 290)
trailer->zz_entries = zzip_disk_trailer_localentries (orig);
according to gdb.

Program being tested is lt-zziptest  (It works out to 

Now, the real program for this, zzcat, does work, so the problem might be in the tests themselves, but it's hard to say.

Unfortunately, this problem is holding up sparc for texlive keywording, because texlive needs luatex, and luatex wants zziplib.  If the problem is in the test drivers and not in the actual installed package, we can live with that, but then the tests should be fixed at some point.  I'll investigate as time permits because of the texlive (luatex) issues.
Comment 1 Friedrich Oslage (RETIRED) gentoo-dev 2008-10-03 21:36:41 UTC
Created attachment 167114 [details, diff]

They somehow managed to cast their pointers in a way to break glibc'd bswap_{16,32,64} functions. Fortunately they also provided their own byte swapping functions that do work.

The attached patch works fine for me but I'm unsure what impact it would have on other big-endian arches.

Btw. the tests fail if MAKEOPTS = 3 so the ebuild should probably do emake -j1 check.
Comment 2 SpanKY gentoo-dev 2008-10-26 04:50:00 UTC
Comment on attachment 167114 [details, diff]

the code you're changing isnt sparc specific, and really you only need to change the one location in the header file.  a simple '&& !defined(__sparc__)'.  please test that and post a new patch.
Comment 3 Friedrich Oslage (RETIRED) gentoo-dev 2008-11-17 19:12:03 UTC
Created attachment 172106 [details, diff]

Right, here's the revised patch, works fine.
Comment 4 SpanKY gentoo-dev 2008-11-17 20:26:31 UTC
once that patch gets cleaned up, feel free to commit it
Comment 5 Friedrich Oslage (RETIRED) gentoo-dev 2008-11-17 22:39:11 UTC
Comment 6 SpanKY gentoo-dev 2008-11-17 22:56:57 UTC
looks good, thanks
Comment 7 Friedrich Oslage (RETIRED) gentoo-dev 2008-12-31 18:01:07 UTC
Created attachment 176962 [details, diff]
alternative patch for 0.13.50

FYI I investigated ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED in 0.13.50, it fixes fetch.h but not fetch.c.

I attached a patch to change 0.13.50 to do it the way upstream wants to do it. Both this one and the existing zziplib-0.13.50-sparc-aligned-access.patch are fine so use whatever you prefer :)