ros2 / rmw_zenoh

RMW for ROS 2 using Zenoh as the middleware
Apache License 2.0
186 stars 34 forks source link

rmw_subscription_data_t sub_data_handler problem #240

Open CihatAltiparmak opened 3 months ago

CihatAltiparmak commented 3 months ago

Tested on

rmw_zenoh : 5c09185f59d0d577a08bcdc83ddba39463164da4 ROS DISTRO: iron from dockerfile

Description

Hello,

This issue is a sort of continuation of #186 ,

When i ran ros2_controller test, i lucky received a segmentation fault. But unfortunately, i rarely can produce this segmentation fault this time and i couldn't find any way to produce this bug generally. Additionaly, i also received some weird outputs from rmw_zenohd side like below.

cihat@jarbay51:~$ docker exec -it jolly_torvalds bash
root@18a6c9234b43:/# source /opt/ros/iron/setup.bash 
root@18a6c9234b43:/# cd ws/
root@18a6c9234b43:/ws# source install/setup.bash 
root@18a6c9234b43:/ws# export RMW_IMPLEMENTATION=rmw_zenoh_cpp
root@18a6c9234b43:/ws# ros2 run rmw_zenoh_cpp rmw_zenohd 
Started Zenoh router with id 8ff9c5732ad41e5a2eaca34be138a86.
Enter 'q' to quit...
thread 'rx-1' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/dispatcher/face.rs:110:13:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'rx-0' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/dispatcher/face.rs:189:25:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
thread 'rx-1' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/dispatcher/face.rs:189:25:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
thread 'acc-0' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/router.rs:119:25:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
thread 'net-42' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/dispatcher/tables.rs:178:29:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
thread 'acc-0' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/router.rs:119:25:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
thread 'acc-0' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/router.rs:119:25:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
thread 'acc-0' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/router.rs:119:25:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
thread 'acc-0' panicked at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/93f93d2/zenoh/src/net/routing/router.rs:119:25:

All backtrace output for test_trajectory_controller:

https://gist.githubusercontent.com/CihatAltiparmak/a21288e1c43cae6011c804abd418eae0/raw/fc538b5990b794b2ef5673807b10fc52d11c8dc8/rmw_zenoh_test_trajectory_controller_segmentation_fault.txt

Test results (ran with colcon test command):

https://gist.github.com/CihatAltiparmak/a21288e1c43cae6011c804abd418eae0

Btw, the failed test executables can change anytime you ran the tests.

If i find any useful information, i will give a feedback for you.

How to trigger this bug

Build given dockerfile using below commands

Shell 1:

docker build -f ros2_control_testing.Dockerfile -t ros2_control_testing .
docker run -it ros2_control_testing
# Inside docker container, just run
cd ws
source /opt/ros/iron/setup.bash
source install/setup.bash
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
colcon test

Just for running rmw_zenohd Shell 2:

docker exec -it <running_ros2_container_name> bash
source /opt/ros/iron/setup.bash
source install/setup.bash
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run rmw_zenoh_cpp rmw_zenohd
ros-discourse commented 3 weeks ago

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

https://discourse.ros.org/t/google-summer-of-code-2024-zenoh-support-benchmarking/39526/3