ros / roscpp_core

ros distribution sandbox
89 stars 116 forks source link

ros serialization get wrong message size when compile on arm64 with gcc -O3 #130

Closed randoms closed 1 year ago

randoms commented 2 years ago

Example Project: https://github.com/AutoxingTech/simple_publisher_crash

output message size

Publication::enqueueMessage 1 2427156042
Publication::enqueueMessage 2 2427156042
Publication::enqueueMessage 3
randoms commented 2 years ago

This is a bug of gcc. The issue was caused by -ftree-loop-vectorize optimization option which is included by -O3 option. The issue was reported here and still not fixed in gcc 9.3. Upgrade to gcc 10.x should fix this issue.

peci1 commented 1 year ago

Would it be a solution to mark some function in the serialization code as non-optimized, or e.g. -O2-optimized? https://stackoverflow.com/a/13825238/1076564 . Can you try?

peci1 commented 1 year ago

@randoms #136 should fix this. Could you verify?

ros-discourse commented 1 year ago

This issue has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/who-are-current-roscpp-core-maintaners/31247/5