Giter VIP home page Giter VIP logo

Comments (4)

dirk-thomas avatar dirk-thomas commented on July 20, 2024

With a short test I was able to send messages containing boolean fields from ARM to non-ARM without any problem.

Please provide more information about:

  • what exactly you tested
  • what the expected and actual behavior was
  • a sscce to reproduce the problem

Also instead of providing a diff file please consider creating a pull request.

from roscpp_core.

tho- avatar tho- commented on July 20, 2024

I thought it was so simple that I didn't want to bother you with details. "sizeof(1)" obviously makes no sense here, it looks more like a typo than a bug. Anyway, here you go:

On x86_64:

cricket[~] > cat test-bool-serializer.cc
#include "ros/serialization.h"

int
main()
{
  uint8_t c[1];
  ros::serialization::Serializer<bool> s;
  ros::serialization::OStream o(c, sizeof(c));

  s.write(o, true);
  return 0;
}
cricket[~] > uname -m
x86_64
cricket[~] > source /opt/ros/indigo/setup.zsh
cricket[~] > g++ test-bool-serializer.cc -L/opt/ros/indigo/lib -lroscpp_serialization
cricket[~] > ./a.out
cricket[~] > echo $?
0

While on arm:

alexanor[~] > uname -m
armv7l
alexanor[~] > source /opt/ros/indigo/setup.zsh
alexanor[~] > g++ test-bool-serializer.cc -L/opt/ros/indigo/lib -lroscpp_serialization
alexanor[~] > ./a.out
terminate called after throwing an instance of 'ros::serialization::StreamOverrunException'
  what():  Buffer Overrun
zsh: abort (core dumped)  ./a.out
alexanor[~]!> echo $?
134

from roscpp_core.

tho- avatar tho- commented on July 20, 2024

If you prefer, you can also pull the commit from there:
git pull --rebase http://homepages.laas.fr/mallet/roscpp_core.git indigo-devel

from roscpp_core.

dirk-thomas avatar dirk-thomas commented on July 20, 2024

Thank you for providing the example snippet. The problem doesn't happen when using message serialization and therefore I could reproduce this without. Only in the above example which uses a custom buffer (which doesn't have more bytes to accommodate the extra three bytes) I was able to reproduce the problem and also confirm that the patch you recommended addresses the problem.

from roscpp_core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.