SIGBUS using DBUS library on ARM

Frédéric DALLEAU frederic.dalleau at palmsource.com
Wed Nov 8 08:39:45 PST 2006


Thiago Macieira a écrit :
> Sjoerd Simons wrote:
>   
>> On Wed, Nov 08, 2006 at 11:05:05AM +0100, Frédéric DALLEAU wrote:
>>     
>>> Thiago,
>>>
>>> The problem doesn't appear with optimization disabled.
>>>
>>> About arm, I just heard that a short must be accessed through a
>>> 2-aligned address, an int through a 4-aligned and so on. Individual
>>> bytes can be accessed at any address.
>>> In our case, we are reading a short on a 2-aligned address and this
>>> should work. So I guess the optimiser tried to put an integer read in
>>> place...
>>>       
>> See http://www.nslu2-linux.org/wiki/Info/Alignment.
>>
>> You can request the arm's kernel to fixup unaligned accesses for you. If
>> you want to debug it, you can also have it send a signal that you can
>> catch with a debugger :)
>>
>> The default is to ignore unaligned accesses and do scary things though
>> :(
>>     
>
> The problem is that the address is aligned, so the loading of 2 bytes 
> should have worked. Looks like it's a miscompilation by gcc.
>   
I managed to have it working with -O2 -fno-force-mem (gcc 3.4.4)
Thank you all for advices!
Fred



More information about the dbus mailing list