Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 265792 - >=app-text/stardict-3.0.1 sigbuses on sparc when loading cache files
Summary: >=app-text/stardict-3.0.1 sigbuses on sparc when loading cache files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Spell checking utilities and dictionaries -- related bugs (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: unaligned-access 258485 288555
  Show dependency tree
 
Reported: 2009-04-11 18:02 UTC by Friedrich Oslage (RETIRED)
Modified: 2023-05-06 05:40 UTC (History)
2 users (show)

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


Attachments
stardict-sigbus.patch (stardict-sigbus.patch,1.35 KB, patch)
2009-04-11 18:02 UTC, Friedrich Oslage (RETIRED)
Details | Diff
stardict-fix-bus-sig-on-sparc.patch (stardict-fix-bus-sig-on-sparc.patch,2.70 KB, patch)
2010-03-08 20:35 UTC, Tiago Cunha (RETIRED)
Details | Diff
stardict-3.0.1-fix-bus-sig-on-sparc.diff (stardict-3.0.1-fix-bus-sig-on-sparc.diff,2.75 KB, patch)
2010-03-11 22:37 UTC, Tiago Cunha (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Friedrich Oslage (RETIRED) gentoo-dev 2009-04-11 18:02:24 UTC
Stardict loads the cache files using mmap and then casts the resulting char * to guint32 * which breaks the alignment.

If it sigbuses depends on the installed dictionaries, with those listed in bug #258485 it does.

The attached patch which makes it use the align-safe get_uint32 function and skips loading cache files on startup. This makes it slightly slower(well, not really measureable) but that's better than sigbussing, right?

Maybe upstream can rewrite the cache-loading functions to load the data aligned, but it looks like that would be a lot of rewriting...
Comment 1 Friedrich Oslage (RETIRED) gentoo-dev 2009-04-11 18:02:47 UTC
Created attachment 187999 [details, diff]
stardict-sigbus.patch
Comment 2 Peter Volkov (RETIRED) gentoo-dev 2010-02-03 15:49:57 UTC
Thank you for report Friedrich. Was this reported upstream?
Comment 3 Tiago Cunha (RETIRED) gentoo-dev 2010-03-03 22:06:32 UTC
I've emailed upstream about this, today.

I'd rather just wait a few days (since it's a workaround), and see what they have to say before bumping, and including the patch. There would be no point in requesting other architectures, but SPARC to stable it, because the patch adds tests for the pre-processor, which only applies to ARM/SPARC.

That said, this is currently blocking bug #288555, which is needed for GCC-4.4.x stabilization.

Depending on their answer, we can remove (for now?) the keyword from the affected versions (>=3.0.1).
Comment 4 Tiago Cunha (RETIRED) gentoo-dev 2010-03-07 21:58:15 UTC
I've heard nothing back from upstream.

Not sure what would be better:
1. Marking this specific version as -sparc (as far as I know 2.x works). If I got the dependencies right, it wouldn't be needed to remove the keywords from the dictionaries. Or,
2. Applying the patch (workaround), and bumping the ebuild.

Any thoughts, Raúl?
Comment 5 Tiago Cunha (RETIRED) gentoo-dev 2010-03-08 20:35:30 UTC
Created attachment 222719 [details, diff]
stardict-fix-bus-sig-on-sparc.patch

Got this patch from one of its developers.
Will test as soon as time permits.
Comment 6 Tiago Cunha (RETIRED) gentoo-dev 2010-03-11 22:37:51 UTC
Created attachment 223233 [details, diff]
stardict-3.0.1-fix-bus-sig-on-sparc.diff

Here's an updated patch which applies cleanly against 3.0.1, and makes the cache code work on SPARC (other architectures might benefit from this, as well).
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2010-05-03 23:47:27 UTC
(In reply to comment #6)
> Created an attachment (id=223233) [details]
> stardict-3.0.1-fix-bus-sig-on-sparc.diff
> 
> Here's an updated patch which applies cleanly against 3.0.1, and makes the
> cache code work on SPARC (other architectures might benefit from this, as
> well).
> 

applied in -r3