Solaris on Sparc Bus Error
matt.joss at roguesheep.com
Thu Sep 11 15:19:34 PDT 2008
I ran into some problems running Exempi on a Solaris machine with a
Sparc chip. Running the 'dumpmainxmp' sample would cause a bus
error. The problem is with memory alignment. The Sparc chip requires
memory to be accessed on 32 bit boundaries for anything but single
byte access and the XMP toolkit violates this causing a bus error.
The particular place I noticed it is in the GetUns16BE() method in
EndianUtils.hpp. There it is casting a memory address to a XMP_Uns16
and trying to dereference it.
I fixed it at this location, but ran into another bus error that I
didn't feel like tracking down. I did find a solution on the web.
The solution is to install a misaligned trap handler to handle this
scenario. This can have a significant performance impact, but for my
purposes this was not a problem.
To install misaligned trap handler, add the following call to your
i.e. main would look like ...
extern "C" int
main ( int argc, const char * argv  )
// REST OF CODE HERE
This would be better fixed in the code, but barring that, this
solution may allow you to use exempi on sparc.
More information about the Exempi-devel