Talker example issue with Beta 1

Hi,
I built the beta 1 release against RTI 5.2.5 install and tested the build with these results

100% tests passed, 0 tests failed out of 27

Label Time Summary:
cppcheck = 2.09 sec (8 tests)
cpplint = 7.23 sec (8 tests)
linter = 13.45 sec (27 tests)
pep257 = 0.34 sec (1 test)
pep8 = 0.40 sec (1 test)
pyflakes = 0.25 sec (1 test)
uncrustify = 3.15 sec (8 tests)

Total Test time (real) = 13.46 sec

I tried to run the talker example with both ./talker and the following

./talker__rmw_connext_cpp
terminate called after throwing an instance of 'std::runtime_error’
what(): could not create publisher: type support handle implementation ‘rosidl_typesupport_cpp’ (0x7fd53c4eb76d) does not match valid type supports (‘rosidl_typesupport_connext_cpp’ (0x7fd53bca0650), ‘connext_static_c’ (0x7fd53c0a7659)), at /path/src/ros2/rmw_connext/rmw_connext_cpp/src/functions.cpp:225, at /path/src/ros2/rcl/rcl/src/rcl/publisher.c:81
Aborted (core dumped)

I have an installed and working environment with alpha 8. Any thoughts?

Thanks
Vince

Have you done a clean build in a fresh workspace or iterated on a previously existing workspace?

Hi Dirk,
Clean build in new workspace.

Thanks
Vince

I am not sure what the difference is . It works fine for me locally, on the CI as well as with the binary package.

What package are these test results from? Anyway they look unrelated.

Maybe if you describe the exact steps and post the output we can spot something different.

What I posted was from these steps that I performed

  1. Since I already have alpha 8 running I created a new directory/workspace for the beta 1 source release code. I already had RTI installed, so I built against that.

  2. Executed the following:
    src/ament/ament_tools/scripts/ament.py build --build-tests –symlink-install

  3. Executed the following:
    src/ament/ament_tools/scripts/ament.py test
    The results of the test are above

  4. Executed ./talker__rmw-connext-cpp from the /install/bin output is shown above

Thanks
Vince

You mentioned that talker as well as talker__rmw_connext_cpp failed with the same error. That implies that you have somehow disabled / removed FastRTPS from the build. Otherwise talker would be using FastRTPS. That difference could be related to the problem you are seeing and that’s why it is important to post the exact steps.

In step 3 you are running all tests on all packages. But the output you quoted is only the summary of the last processed package. For a summary across all packages you need to run ament test_results (optionally with --verbose).

Hi Dirk,

I should have stated the difference

For ./talker error message was terminate called after throwing an instance of ‘Poco::LibraryLoadException’ what(): Cannot load library

I did install Poco

libpoco-dev is already the newest version (1.3.6p1-5.1build1).
libpocofoundation9v5 is already the newest version (1.3.6p1-5.1build1).
libpocofoundation9v5-dbg is already the newest version (1.3.6p1-5.1build1).

I didn’t not install # dependencies for testing and # dependencies for fastrtps

For ./talker__rmw-connext-cpp as shown above

Thanks for the pointer on test_results. These are the results:

Summary: 9962 tests, 9 errors, 85 failures, 24 skipped

Here are the list of errors

build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_add_two_ints_server_add_two_ints_client__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_add_two_ints_server_add_two_ints_client_async__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_list_parameters__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_list_parameters_async__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_parameter_events__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_parameter_events_async__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_set_and_get_parameters__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_set_and_get_parameters_async__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
build/demo_nodes_cpp/test_results/demo_nodes_cpp/test_tutorial_talker_listener__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures

Most of the failures were related to the

build/intra_process_demo/test_results/intra_process_demo/test_demo_cyclic_pipeline__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 0 errors, 1 failures
build/osrf_pycommon/test_results/osrf_pycommon/nosetests.xunit.xml: 32 tests, 0 skipped, 0 errors, 1 failures
build/pendulum_control/test_results/pendulum_control/test_demo_pendulum_teleop__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 0 errors, 1 failures
build/test_communication/test_results/test_communication/test_publisher_subscriber__BoundedArrayNested__rclcpp__rclpy__rmw_connext_cpp__rmw_fastrtps_cpp.xunit.xml: 1 tests, 0 skipped, 0 errors, 1 failures

To (Most of the failure cases are here)

build/test_communication/test_results/test_communication/test_publisher_subscriber__StaticArrayPrimitives__rclpy__rmw_fastrtps_cpp__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 0 errors, 1 failures

build/test_communication/test_results/test_communication/test_requester_replier__Primitives__rclcpp__rclpy__rmw_fastrtps_cpp.xunit.xml: 1 tests, 0 skipped, 0 errors, 1 failures
build/test_communication/test_results/test_communication/test_requester_replier__Primitives__rclpy__rmw_fastrtps_cpp.xunit.xml: 1 tests, 0 skipped, 0 errors, 1 failures

Thanks
Vince

Maybe figuring out the reason why the talker fails helps in determining the cause for the talker__rmw_connext_cpp.

I assume you have sourced the local_setup.bash file before trying to run any of the binaries?

Can you test which library poco is failing to load. E.g. run the talker within gdb and print the library_path.

Hi Dirk,
Yes, I have sourced the local_setup.bash. I have secured another HD and will try a clean install. Will also try the figure out why poco lib isn’t being found.

Thanks
Vince

Hi Dirk,
I tried a clean install on new HDD and machine.

src/ament/ament_tools/scripts/ament.py test_results
build/osrf_pycommon/test_results/osrf_pycommon/nosetests.xunit.xml: 32 tests, 0 skipped, 0 errors, 1 failures
build/pendulum_control/test_results/pendulum_control/test_demo_pendulum__rmw_connext_cpp.xunit.xml: 1 tests, 0 skipped, 1 errors, 0 failures
Summary: 9962 tests, 1 errors, 1 failures, 24 skipped

Also tried to run
./talker
terminate called after throwing an instance of 'std::runtime_error’
what(): could not create publisher: type support not from this implementation, at /path/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/functions.cpp:782, at /path/src/ros2/rcl/rcl/src/rcl/publisher.c:81
Aborted (core dumped)

ran it with gdb turned on:

Starting program: /path/install/bin/talker
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
[New Thread 0x7ffff3ed9700 (LWP 25894)]
[New Thread 0x7ffff36d8700 (LWP 25895)]
[New Thread 0x7ffff2ed7700 (LWP 25896)]
[New Thread 0x7ffff26d6700 (LWP 25897)]
[New Thread 0x7ffff1ed5700 (LWP 25898)]
[New Thread 0x7ffff16d4700 (LWP 25899)]
[New Thread 0x7ffff0ed3700 (LWP 25900)]
terminate called after throwing an instance of 'std::runtime_error’
what(): could not create publisher: type support not from this implementation, at /path/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/functions.cpp:782, at /path/src/ros2/rcl/rcl/src/rcl/publisher.c:81

Thread 1 “talker” received signal SIGABRT, Aborted.
0x00007ffff6882428 in __GI_raise (sig=sig@entry=6)
at …/sysdeps/unix/sysv/linux/raise.c:54
54 …/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) exit

Also tried

./talker__rmw_connext_cpp
terminate called after throwing an instance of 'std::runtime_error’
what(): could not create publisher: type support handle implementation ‘rosidl_typesupport_cpp’ (0x7fa59d40a76d) does not match valid type supports (‘rosidl_typesupport_connext_cpp’ (0x7fa59cbbf650), ‘connext_static_c’ (0x7fa59cfc6659)), at /path/src/ros2/rmw_connext/rmw_connext_cpp/src/functions.cpp:225, at /path/src/ros2/rcl/rcl/src/rcl/publisher.c:81
Aborted (core dumped)

With gdb turned on

alker__rmw_connext_cpp
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
[New Thread 0x7ffff34a1700 (LWP 25959)]
[New Thread 0x7ffff2ca0700 (LWP 25960)]
[New Thread 0x7ffff2205700 (LWP 25961)]
[New Thread 0x7ffff1a04700 (LWP 25962)]
[New Thread 0x7ffff1203700 (LWP 25963)]
[New Thread 0x7ffff0a02700 (LWP 25964)]
[New Thread 0x7fffe3fff700 (LWP 25965)]
[New Thread 0x7fffe37fe700 (LWP 25966)]
terminate called after throwing an instance of 'std::runtime_error’
what(): could not create publisher: type support handle implementation ‘rosidl_typesupport_cpp’ (0x7ffff44d376d) does not match valid type supports (‘rosidl_typesupport_connext_cpp’ (0x7ffff3c88650), ‘connext_static_c’ (0x7ffff408f659)), at /path/src/ros2/rmw_connext/rmw_connext_cpp/src/functions.cpp:225, at /path/src/ros2/rcl/rcl/src/rcl/publisher.c:81

Thread 1 “talker__rmw_con” received signal SIGABRT, Aborted.
0x00007ffff5457428 in __GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:54
54 …/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) quit

Thanks
Vince

The type support for C++ has been heavily refactored before the beta 1. So that might be related. On the other hand it passes all unit tests and works for me (and others) just fine.

The two locations where the exception is thrown are: https://github.com/ros2/rmw_fastrtps/blob/release-beta1/rmw_fastrtps_cpp/src/functions.cpp#L782 and https://github.com/ros2/rmw_connext/blob/release-beta1/rmw_connext_cpp/src/functions.cpp#L225

In order to figure out what is wrong can you please debug a few local variables in gdb:

  • print type_supports
  • print type_supports.typesupport_identifier
  • print type_supports.data
  • print type_supports.func

I haven’t tried the following line but something like this:

  • print (type_support_map_t *)(type_supports.data)
  • print ((type_support_map_t *)(type_supports.data)).size
  • print ((type_support_map_t *)(type_supports.data)).package_name
  • print ((type_support_map_t *)(type_supports.data)).typesupport_identifier[0]

Hi Dirk,
Results:

Machine #1

Program

./talker
break /path/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/functions.cpp:782

Results from commands

  1. print type_supports

(gdb) print type_supports
$3 = (const rosidl_message_type_support_t *) 0x7ffff684c0b0 <rcl_interfaces::msg::rosidl_typesupport_cpp::ParameterEvent_message_type_support_handle>

  1. print type_supports.typesupport_identifier

(gdb) print type_supports.typesupport_identifier
$4 = 0x7ffff5cb476d “rosidl_typesupport_cpp”

  1. print type_supports.data

(gdb) print type_supports.data
$5 = (const void *) 0x7ffff684b5e0 <rcl_interfaces::msg::rosidl_typesupport_cpp::_ParameterEvent_message_typesupport_map>

  1. print type_supports.func

(gdb) print type_supports.func
$6 = (rosidl_message_typesupport_handle_function) 0x7ffff5cb3040 <rosidl_typesupport_cpp::get_message_typesupport_handle_function(rosidl_message_type_support_t const*, char const*)>

  1. print (type_support_map_t *)(type_supports.data)

(gdb) print (type_support_map_t *)(type_supports.data)
$7 = (type_support_map_t *) 0x7ffff684b5e0 <rcl_interfaces::msg::rosidl_typesupport_cpp::_ParameterEvent_message_typesupport_map>

  1. print ((type_support_map_t *)(type_supports.data)).size

(gdb) print ((type_support_map_t *)(type_supports.data)).size
$8 = 2

  1. print ((type_support_map_t *)(type_supports.data)).package_name

(gdb) print ((type_support_map_t *)(type_supports.data)).package_name
$9 = 0x7ffff664853b “rcl_interfaces”

  1. print ((type_support_map_t *)(type_supports.data)).typesupport_identifier[0]

(gdb) print ((type_support_map_t *)(type_supports.data)).typesupport_identifier[0]
$10 = 0x7ffff6648420 “rosidl_typesupport_connext_cpp”

Program:

./talker__rmw_connext_cpp

break /path/src/ros2/rmw_connext/rmw_connext_cpp/src/functions.cpp:225

Results from commands

  1. print type_supports

(gdb) print type_supports
$1 = (const rosidl_message_type_support_t *) 0x7ffff50360b0 <rcl_interfaces::msg::rosidl_typesupport_cpp::ParameterEvent_message_type_support_handle>

  1. print type_supports.typesupport_identifier

(gdb) print type_supports.typesupport_identifier
$2 = 0x7ffff40e876d “rosidl_typesupport_cpp”

  1. print type_supports.data

(gdb) print type_supports.data
$3 = (const void *) 0x7ffff50355e0 <rcl_interfaces::msg::rosidl_typesupport_cpp::_ParameterEvent_message_typesupport_map>

  1. print type_supports.func

(gdb) print type_supports.func
$4 = (rosidl_message_typesupport_handle_function) 0x7ffff40e7040 <rosidl_typesupport_cpp::get_message_typesupport_handle_function(rosidl_message_type_support_t const*, char const*)>

  1. print (type_support_map_t *)(type_supports.data)

(gdb) print (type_support_map_t *)(type_supports.data)
$5 = (type_support_map_t *) 0x7ffff50355e0 <rcl_interfaces::msg::rosidl_typesupport_cpp::_ParameterEvent_message_typesupport_map>

  1. print ((type_support_map_t *)(type_supports.data)).size

(gdb) print ((type_support_map_t *)(type_supports.data)).size
$6 = 2

  1. print ((type_support_map_t *)(type_supports.data)).package_name

(gdb) print ((type_support_map_t *)(type_supports.data)).package_name
$7 = 0x7ffff4e3253b “rcl_interfaces”

  1. print ((type_support_map_t *)(type_supports.data)).typesupport_identifier[0]

(gdb) print ((type_support_map_t *)(type_supports.data)).typesupport_identifier[0]
$8 = 0x7ffff4e32420 “rosidl_typesupport_connext_cpp”

I’ll try to capture the same on other machine

Thanks
Vince

Since the size is 2 can you please also output print ((type_support_map_t *)(type_supports.data)).typesupport_identifier[1]. But I assume it will be rosidl_typesupport_introspection_cpp since everything else looks consistent and correct.

./talker
(gdb) print ((type_support_map_t *)(type_supports.data)).typesupport_identifier[1]
$1 = 0x7ffff6648440 “rosidl_typesupport_introspection_cpp”

./talker__rmw_connext_cpp
print ((type_support_map_t *)(type_supports.data)).typesupport_identifier[1]
$9 = 0x7ffff4e32440 “rosidl_typesupport_introspection_cpp”

Thanks
Vince

The meta typesupport rosidl_typesupport_cpp is being used correctly and contains both typesupports: rosidl_typesupport_connext_cpp as well as rosidl_typesupport_introspection_cpp. I don’t see why both rmw implementations can’t extract their matching typesupport.

Reviewing the conversation you mentioned that you have sourced the setup file after building the workspace but your steps above don’t include that (Talker example issue with Beta 1). Can you please post the LD_LIBRARY_PATH from the shell you run the talker from.

I am sorry. I don’t know what else to debug.

Hi Dirk,
I’ve tried local_setup.bash also with same result

path/install$./setup.sh
path/install$ cd bin
path/install/bin$ echo $LD_LIBRARY_PATH
/opt/rti_connext_dds-5.2.5/lib:/opt/rti_connext_dds-5.2.5/lib/x64Linux3.xgcc4.6.3:/opt/rti_connext_dds-5.2.5/lib/java
path/install/bin$ ./talker
terminate called after throwing an instance of 'std::runtime_error’
what(): could not create publisher: type support not from this implementation, at path/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/functions.cpp:782, at path/src/ros2/rcl/rcl/src/rcl/publisher.c:81
Aborted (core dumped)

Thanks
Vince

The LD_LIBRARY_PATH should contains the lib folder from the install space of the workspace. That seems to be missing and that could be the reason why the typesupport libraries are not found.

Please make sure to source /path/install/local_setup.bash and check that /path/install/lib is in the LD_LIBRARY_PATH afterwards.

Hi Dirk,
local_setup.bash wasn’t setting the install/lib, but hard coded it into bash startup script and things are working. Thanks for you help.

Thanks
Vince

I am glad we found a workaround. It would be good to find the actual problem though. Can you please set export AMENT_TRACE_SETUP_FILES=1 before sourcing the install/local_setup.bash file. That should output a long list tracing which files are being sourced. Maybe that sheds some light into why the variable isn’t being set for you. (You are using bash, right?)

Hi Dirk,
Yes, on bash.

$ ./local_setup.bash
. “/path/install/local_setup.sh”
. “/path/install/share/*”

Since there is a cap on size to post, I’ll state that all files under the share directory were included in the output. The * is sub directories above.

Thanks
Vince