SIGBUS using DBUS library on ARM

frederic heem frederic.heem at telsey.it
Wed Nov 8 08:44:18 PST 2006


Hi Frederic,
By the way, on embedded system, -Os is usually used instead of -O2.
Frederic 
On Wednesday 08 November 2006 5:39 pm, Frédéric DALLEAU wrote:
> 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
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus


More information about the dbus mailing list