<div dir="ltr">Hi Peter, <div><br></div><div style>Thanks for digging into this.  I've created a ticket at <a href="https://github.com/ros/ros_comm/issues/184">https://github.com/ros/ros_comm/issues/184</a> to track this.  </div>

<div style><br></div><div style>Tully</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 3, 2013 at 2:59 AM, Austin Hendrix <span dir="ltr"><<a href="mailto:legotown@aol.com" target="_blank">legotown@aol.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>


<br>
I'll keep my eyes peeled for a patch. Have you made any measurements of how it affects performance on arm and x86?<br>
<span class="HOEnZb"><font color="#888888"><br>
-Austin<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Mar 3, 2013, at 2:23 AM, Peter Rudolph <<a href="mailto:semael23@gmail.com">semael23@gmail.com</a>> wrote:<br>
<br>
> He guys!<br>
> 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.<br>


><br>
> 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)):<br>
><br>
> #include <stdio.h><br>
><br>
> int main(int argc, char* argv[])<br>
> {<br>
>    char __attribute__ ((aligned(32))) buffer[8] = { 0 };<br>
>    float* fval_p;<br>
><br>
>    fval_p = (float*)&buffer[1];<br>
>    *fval_p = 0.1234;<br>
><br>
>    printf("\nfloat at &buf[1] is %f\n", *fval_p);<br>
><br>
>    return 0;<br>
> }<br>
><br>
> Build my own example from this, to check what works correctly and serious...<br>
><br>
> 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!<br>


><br>
> Due to having no time now, patchfile will follow, too!<br>
><br>
> Regards,<br>
> sem23<br>
> _______________________________________________<br>
> ros-users mailing list<br>
> <a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
> <a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</div></div></blockquote></div><br></div>