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

rclcpp test_subscription_content_filter segfault #279

Closed
ahcorde opened this issue Sep 11, 2024 · 4 comments
Closed

rclcpp test_subscription_content_filter segfault #279

ahcorde opened this issue Sep 11, 2024 · 4 comments
Assignees

Comments

@ahcorde
Copy link
Contributor

ahcorde commented Sep 11, 2024

I'm getting a segfault running the test test_subscription_content_filter in particular TestContentFilterSubscription.content_filter_get_begin.

Thread 1 "test_subscripti" received signal SIGSEGV, Segmentation fault.
__memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:317
317	../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:317
#1  0x00007ffff7b43bd7 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*> (this=0x7fffffff20a0, 
    __beg=0x64636635383239 <error: Cannot access memory at address 0x64636635383239>, __end=0x646366353832ca <error: Cannot access memory at address 0x646366353832ca>)
    at /usr/include/c++/11/bits/basic_string.tcc:225
#2  0x00007ffff532bda5 in rmw_zenoh_cpp::liveliness::Entity::id[abi:cxx11]() const (this=0x555555b46590) at /home/ahcorde/ros2_rolling/src/ros2/rmw_zenoh/rmw_zenoh_cpp/src/detail/liveliness_utils.cpp:582
#3  0x00007ffff535b466 in operator() (__closure=0x555555b325b0, queryable_prefix="c67248845cb613836ba09f84f75fca9d") at /home/ahcorde/ros2_rolling/src/ros2/rmw_zenoh/rmw_zenoh_cpp/src/rmw_zenoh.cpp:1510

The memory address of sub_data->entity looks wrong 0x4

(gdb) print sub_data
$1 = (rmw_zenoh_cpp::rmw_subscription_data_t * const) 0x555555afdd30
(gdb) print sub_data->entity
$2 = std::shared_ptr<rmw_zenoh_cpp::liveliness::Entity> (expired, weak count 0) = {get() = 0x4}

Any thoughts @clalancette or @Yadunund ?

@ahcorde ahcorde self-assigned this Sep 11, 2024
@ahcorde
Copy link
Contributor Author

ahcorde commented Sep 11, 2024

Same issue is happening with test_client in rclcpp_action

@ahcorde
Copy link
Contributor Author

ahcorde commented Sep 11, 2024

digging a into the code, I see that set_querying_subscriber_callback is adding the callback to a structure, but this structure is not clean it when the topic is removed.

FYI @Yadunund

@ahcorde
Copy link
Contributor Author

ahcorde commented Sep 12, 2024

test client is printing this

[ERROR] [1726138415.253285962] [rclcpp_action.test.client.fibonacci_action_test_client.rclcpp_action]: Error in destruction of rcl action client handle: error not set
[ERROR] [1726138415.253585744] [rclcpp_action.test.client.fibonacci_action_test_client.rclcpp_action]: Error in destruction of rcl action client handle: action client implementation is invalid, at /home/ahcorde/ros2_rolling/src/ros2/rcl/rcl_action/src/rcl_action/action_client.c:491
[WARN] [1726138415.257648208] [rmw_zenoh_cpp]: Received liveliness token to remove node /fibonacci_action_test_client from the graph before all pub/subs/clients/services for this node have been removed. Removing all entities first...

if I commented out this line, then there is no error

        cb(entity->zid());

@Yadunund
Copy link
Member

I've opened a PR with a fix #282

imstevenpmwork pushed a commit to ZettaScaleLabs/rmw_zenoh that referenced this issue Sep 23, 2024
…destroyed (ros2#282)

Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
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

2 participants