Solaris on Sparc Bus Error

Hubert Figuiere hub at figuiere.net
Tue Sep 16 08:16:28 PDT 2008


On Thu, 2008-09-11 at 15:19 -0700, Matt Joss wrote:
> 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.

Do you have a patch?

> 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  
> main() function...
> 
> asm("ta\t6");
> 
> 
> i.e. main would look like ...
> 
> extern "C" int
> main ( int argc, const char * argv [] )
> {
> 	asm("ta\t6");
> 
> 	// 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.

I don't have a Sparc to test.


Hub



More information about the Exempi-devel mailing list