Hello again!

Posted my patch-file as comment on ticket. I saw that there is already a patch-file which is declared as not multi-arch safe. So plz test it!
Used compiler defined macros ( gcc -dM -E - <<<'' ) __ARMEL__ and __VFP_FP__ to ensure, that its only done on arm mcu with float-abi softfp or hard enabled!

hopefully it helps!

Peter

2013/3/3 Tully Foote <tfoote@osrfoundation.org>
Hi Peter, 

Thanks for digging into this.  I've created a ticket at https://github.com/ros/ros_comm/issues/184 to track this.  

Tully


On Sun, Mar 3, 2013 at 2:59 AM, Austin Hendrix <legotown@aol.com> wrote:
Awesome! I've been running into the same thing over the past few days, but I haven't had time to look into it extensively.

I'll keep my eyes peeled for a patch. Have you made any measurements of how it affects performance on arm and x86?

-Austin

On Mar 3, 2013, at 2:23 AM, Peter Rudolph <semael23@gmail.com> wrote:

> He guys!
> I tried to solved and it seems solved! First i will explain the problem itself: while de-/serializing unaligned pointercasts are done. normally this is not a problem! but since newer versions of arm-gcc use float support with options -mfloat-abi=hard/softfp, there are many possibilities to hit this alignment fault, because NEON instructions must be aligned! This is a very big problem... compiling ROS with -Wcast-align shows the potential lines! Solving this by setting "-mno-unaligned-access" as compiler-flag does NOT work! Every prebuilt-compiler i used seemed to ignore this switch.
>
> example from www, demonstrates the error (compile it w/o any optimization(-O0), else compiler will re-align the pointercast, but this won't work for ROS, since everything is built w/ optimization(-O2)):
>
> #include <stdio.h>
>
> int main(int argc, char* argv[])
> {
>    char __attribute__ ((aligned(32))) buffer[8] = { 0 };
>    float* fval_p;
>
>    fval_p = (float*)&buffer[1];
>    *fval_p = 0.1234;
>
>    printf("\nfloat at &buf[1] is %f\n", *fval_p);
>
>    return 0;
> }
>
> Build my own example from this, to check what works correctly and serious...
>
> Only possibility was to hack the correct lines in roscpp_serialization. I only changed the lines from pointercasts to simple memcpy's and now everything seems to work fine! No alignment faults, no bus errors, no kernel exceptions! Tried a lightweight openni version, my own robot stack, and gmapping! navigation stack will follow!
>
> Due to having no time now, patchfile will follow, too!
>
> Regards,
> sem23
> _______________________________________________
> ros-users mailing list
> ros-users@code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users

_______________________________________________
ros-users mailing list
ros-users@code.ros.org
https://code.ros.org/mailman/listinfo/ros-users


_______________________________________________
ros-users mailing list
ros-users@code.ros.org
https://code.ros.org/mailman/listinfo/ros-users