ros2 / rosidl_typesupport

Packages which provide the typesupport for ROS messages and services
Apache License 2.0
13 stars 34 forks source link

Addresses test failures in release mode #75

Closed brawner closed 4 years ago

brawner commented 4 years ago

These tests were behaving differently under release mode than debug mode, which is how they were originally tested and evaluated. I'm not entirely sure of the full cause of the issue or why it worked in debug mode but not release. As far as I can tell the functions defined in test_type_support.c and test_type_support.cpp were simple void functions, but after loading their librariestype_support_dispatch called those functions and assigned their result to a pointer which was then returned, and that always returned null on gcc release. Even stranger, printing out the address of sym with std::cout in type_support_dispatch allowed the test to pass. It seems likely to me that the original code was causing undefined behavior and gcc's optimizations caused a different result than debug mode.

Signed-off-by: Stephen Brawner stephenbrawner@verbsurgical.com

brawner commented 4 years ago

Example failure: https://ci.ros2.org/view/nightly/job/nightly_linux_release/1549/testReport/(root)/projectroot/test_message_type_support_2/

brawner commented 4 years ago

CI on release mode:

brawner commented 4 years ago

Force pushed fix for uncrustify:

Build Status