<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Thanks for the hint Cedric.<br>
      <br>
      It's the first time I encounter an endianness problem.<br>
      At this point we are not even sure this is an endianness problem.<br>
      <br>
      I filed a ticket to propose a more descriptive error message in
      case of buffer overrun, as the way it is now it's really useless
      (just buffer overrun, but no indication of which buffer, what was
      the dimension, what was the overrun and how was the dimension
      specified).<br>
      <br>
      By the way: how should I modify the snippet you posted to avoid
      endianness problems?<br>
      Wouldn't compiling with -mlittle-endian solve such problems?
      (trying now, but it will take about 8hrs to compile)<br>
      <br>
      Claudio<br>
      <br>
      <br>
      On 28/11/12 17:46, Cedric Pradalier wrote:<br>
    </div>
    <blockquote
cite="mid:CAOQFJr+cDcccHi4uXj6ueOcgMvbb_bxcDtpjVVY1+WdtUe6P4A@mail.gmail.com"
      type="cite">Here it is, in roscpp/src/libros, writeHeader
      <div>  uint32_t msg_len = len + 4;<br>
      </div>
      <div>
        <div>  boost::shared_array<uint8_t> full_msg(new
          uint8_t[msg_len]);</div>
        <div>  memcpy(full_msg.get() + 4, buffer.get(), len);</div>
        <div>  *((uint32_t*)full_msg.get()) = len;</div>
        <div><br>
        </div>
      </div>
      <div>and onHeaderLengthRead:</div>
      <div>
        <div>  uint32_t len = *((uint32_t*)buffer.get());</div>
        <div><br>
        </div>
      </div>
      <div>This type of code might create some trouble when run between
        x86 and arm cpu. However, I could only track this bit of code in
        the UDP and service loop, and I only checked that this code was
        there up to fuerte.</div>
      <div><br>
      </div>
      <div>In my experience some time ago, I could listen to packet from
        a gumstix (cturtle, compressed or raw video) from a x86 laptop
        (diamondback I think). So this might actually be two different
        bugs...</div>
      <div><br>
      </div>
      <div>Now, for people who wonder why I did not report this earlier:
        contributing to ros_comm has not been very successful so far on
        my side, so I just keep track of my patches until someone really
        needs them... (shared memory and compressed transports
        out-of-the-box for all topics?)</div>
      <div><br>
      </div>
      <div>Regards</div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Wed, Nov 28, 2012 at 5:14 PM,
          Claudio Carbone <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:cla_carbone@tiscali.it" target="_blank">cla_carbone@tiscali.it</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div>Thank you Cedric,<br>
                <br>
                I'll wait for your info.<br>
                <br>
                Regards<span class="HOEnZb"><font color="#888888"><br>
                    -- <br>
                  </font></span>
                <div>
                  <div class="im">
                    <p><b><span style="color:#262626">Eng. Claudio
                          Carbone<br>
                          Embedded Systems Design</span></b><span
                        style="color:#7f7f7f"> <br>
                      </span></p>
                    <p class="MsoNormal"><span style="color:#7f7f7f">P.IVA:

                        11688471009<br>
                        tel: <a moz-do-not-send="true"
                          href="tel:%2B393809017424"
                          value="+393809017424" target="_blank">+393809017424</a><br>
                        email: <a moz-do-not-send="true"
                          href="mailto:cla_carbone@tiscali.it"
                          target="_blank"><span style="color:#7f7f7f">Send
                            email<br>
                          </span></a></span><a moz-do-not-send="true"
                        href="http://it.linkedin.com/in/embeddedesign/en"
                        target="_blank"><span
                          style="text-decoration:none"><img alt="My
                            linkedin profile"
                            src="cid:part4.02060900.09060701@tiscali.it"
                            width="160" height="33" border="0"></span></a></p>
                    <p class="MsoNormal"><span style="color:#7f7f7f">My
                        Portfolio</span><br>
                      <a moz-do-not-send="true"
                        href="http://www.fusioncoredesign.it/"
                        target="_blank"><span
                          style="text-decoration:none"><img alt="My
                            portfolio site"
                            src="cid:part6.01040400.03060802@tiscali.it"
                            width="160" height="33" border="0"></span></a></p>
                    <p class="MsoNormal"> <br>
                    </p>
                  </div>
                  <div class="im">
                    <p class="MsoNormal"><br>
                      On 28/11/12 17:09, Cedric Pradalier wrote:<br>
                    </p>
                    <blockquote type="cite">Hi,
                      <div><br>
                      </div>
                      <div>last time I checked, some of the
                        deserialization code was actually endianness
                        specific (if I'm not mistaken), in particular
                        the length of the message... This could lead
                        easily to a buffer overrun.</div>
                      <div><br>
                      </div>
                      <div>I'll try to point out the little bit of code
                        later today.</div>
                      <div><br>
                      </div>
                      <div>Regards<br>
                      </div>
                    </blockquote>
                    <br>
                  </div>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            ros-users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
            <a moz-do-not-send="true"
              href="https://code.ros.org/mailman/listinfo/ros-users"
              target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        Cedric Pradalier<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
ros-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a>
<a class="moz-txt-link-freetext" href="https://code.ros.org/mailman/listinfo/ros-users">https://code.ros.org/mailman/listinfo/ros-users</a>
</pre>
    </blockquote>
  </body>
</html>