Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscriber crashed when deserialize msg which is send by foxglove_bridge through loaned api #479

Closed
sgf201 opened this issue Dec 19, 2023 · 1 comment

Comments

@sgf201
Copy link

sgf201 commented Dec 19, 2023

Operating system:
Ubuntu 20.04 LTS

Compiler version:
GCC 9.4.0

Eclipse iceoryx version:
2.0.3

rmw_cyclonedds version:
1.3.4
cyclonedds version:
0.10.3

Observed result or behaviour:
loaned api deserialize crash
turn off loaned api it worked
[decodec-1] eclipse-iceoryx/iceoryx#12 Object "/home/admin/5v5r/fsinstall/nov_codec/lib/nov_codec/decodec", at 0xaaaae95184e3, in
[decodec-1] eclipse-iceoryx/iceoryx#11 Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffff823bfe0f, in __libc_start_main
[decodec-1] eclipse-iceoryx/iceoryx#10 Object "/home/admin/5v5r/fsinstall/nov_codec/lib/nov_codec/decodec", at 0xaaaae9518b57, in main
[decodec-1] eclipse-iceoryx/iceoryx#9 Object "/opt/nros/lib/librclcpp.so", at 0xffff828fad83, in rclcpp::executors::SingleThreadedExecutor::spin()
[decodec-1] eclipse-iceoryx/iceoryx#8 Object "/opt/nros/lib/librclcpp.so", at 0xffff828f42fb, in rclcpp::Executor::execute_any_executable(rclcpp::AnyExecutable&)
[decodec-1] eclipse-iceoryx/iceoryx#7 Object "/opt/nros/lib/librclcpp.so", at 0xffff828f2fcb, in rclcpp::Executor::execute_subscription(std::shared_ptrrclcpp::SubscriptionBase)
[decodec-1] eclipse-iceoryx/iceoryx#6 Object "/opt/nros/lib/librclcpp.so", at 0xffff828f208b, in
[decodec-1] eclipse-iceoryx/iceoryx#5 Object "/opt/nros/lib/librclcpp.so", at 0xffff828f1ee3, in
[decodec-1] eclipse-iceoryx/iceoryx#4 Object "/opt/nros/lib/librcl.so", at 0xffff8233183b, in rcl_take_loaned_message
[decodec-1] eclipse-iceoryx/iceoryx#3 Object "/opt/nros/lib/librmw_cyclonedds_cpp.so", at 0xffff81f7bcd3, in
[decodec-1] eclipse-iceoryx/iceoryx#2 Object "/opt/nros/lib/librmw_cyclonedds_cpp.so", at 0xffff81f7b5a7, in rmw_deserialize
[decodec-1] eclipse-iceoryx/iceoryx#1 Object "/opt/nros/lib/librmw_cyclonedds_cpp.so", at 0xffff81f88b07, in
[decodec-1] #0 Object "/opt/nros/lib/librmw_cyclonedds_cpp.so", at 0xffff81f88a84, in
[decodec-1] Segmentation fault (Address not mapped to object [(nil)])

Expected result or behaviour:
What do you expect to happen?
worked
Conditions where it occurred / Performed steps:
Describe how one can reproduce the bug.
code in foxglove_bridge
// Copy the message payload into a SerializedMessage object
rclcpp::SerializedMessage serializedMessage{message.getLength()};
auto& rclSerializedMsg = serializedMessage.get_rcl_serialized_message();
std::memcpy(rclSerializedMsg.buffer, message.getData(), message.getLength());
rclSerializedMsg.buffer_length = message.getLength();

// Publish the message
publisher->publish(serializedMessage);

eclipse-iceoryx/iceoryx#2136

@sgf201
Copy link
Author

sgf201 commented Jun 26, 2024

root cause found,The loan API actually affects the way some APIs are used in ROS2, and developers who implement it at a slightly lower level need to handle it carefully
foxglove/ros-foxglove-bridge#280

@sgf201 sgf201 closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant