Recording Service - Pluggable Storage C++ Example - undefined symbol error

4 posts / 0 new
Last post
Offline
Last seen: 3 years 1 month ago
Joined: 03/29/2021
Posts: 12
Recording Service - Pluggable Storage C++ Example - undefined symbol error

Hi guys,

I'm having trouble with running the C++ Recording Service - Pluggable Storage example code at: https://github.com/rticommunity/rticonnextdds-examples/tree/master/examples/recording_service/pluggable_storage/cpp

I've followed the instructions in README.md document and have successfully build the C++ code using CMake. I have also run the HelloMsg_publisher executable successfully:

$ ./HelloMsg_publisher 0
Writing HelloMsg, count 0
Writing HelloMsg, count 1
...

However, when I try to run rtirecordingservice, I meet an "undefined symbol" error and the recording service failed to launch. The log is as below:

$ cd build/
$ echo $LD_LIBRARY_PATH
/home/asus/rti_connext_dds-6.0.1/lib/x64Linux4gcc7.3.0::/home/asus/work/tmp/rti_dds/rticonnextdds-examples/examples/recording_service/pluggable_storage/cpp/build
$ rtirecordingservice -cfgFile ../pluggable_storage_example.xml -cfgName CppFileWriterExample -domainIdBase 0
RTI Recording Service (Recorder) 6.0.1 starting...
[/recording_services/CppFileWriterExample|START] RTIOsapiLibrary_open:!open library=libFileStorageWriterCpp.so: libFileStorageWriterCpp.so: undefined symbol: _ZNK3rti4core6xtypes15DynamicDataImpl5valueIN3dds4core12basic_stringIcNS0_6memory14OsapiAllocatorIcEEEEEET_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
[/recording_services/CppFileWriterExample|START] create_connection:caught exception from:
    load_storage_library:!open library=FileStorageWriterCpp
[/recording_services/CppFileWriterExample|START] ROUTERConnection_enable:(adapter=StorageAdapterPlugin, retcode=0: load_storage_library:!open library=FileStorageWriterCpp
)
[/recording_services/CppFileWriterExample|START] ROUTERDomainRoute_start:!enable Connection
[/recording_services/CppFileWriterExample|START] ROUTERService_startDomainRoute:!start domain route
[/recording_services/CppFileWriterExample|START] ROUTERService_createDomainRoute:!start domain route
[/recording_services/CppFileWriterExample|START] ROUTERService_start:!create domain route
[/recording_services/CppFileWriterExample|START] RTI_RoutingService_start:!start routing service
Stopping RTI Recording Service
RTI Recording Service stopped
main:!failed to start RoutingService

Please help me to troubleshoot this issue. Thank you very much for the help!

Howard's picture
Offline
Last seen: 2 days 22 hours ago
Joined: 11/29/2012
Posts: 608

So this is likely a result of using a version of the C++ compiler to compile the plugin that's incompatible with the Connext DDS libraries that is being linked.

It looks like you're linking against the x64Linux4gcc7.3.0 libs, which uses GCC 7.3.0.

What version of GCC are you using for your plugin?  What is your Linux distribution and version?

Offline
Last seen: 3 years 1 month ago
Joined: 03/29/2021
Posts: 12

Hi Howard,

I'm using Ubuntu 18.04, gcc version 7.5.0.

$ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

Howard's picture
Offline
Last seen: 2 days 22 hours ago
Joined: 11/29/2012
Posts: 608

So, the issue is definitely compiler ABI incompatibility, but not with the compiler used to compile your plugin (gcc 7.5.0) and the compiler used to compile the x64Linux4gcc7.3.0 libraries (gcc 7.3.0).  As far as it's documented, binaries created by those two versions should work with each other.

The issue is that the "rtirecordingservice" executable that you are running was compiled with gcc 4.4.5....which is not ABI compatible with gcc 7.5.0.

When you execute "rtirecordingservice", you're probably executing the one from "rti_connext_dds-6.0.1/bin" which is a script.  The actual executable it executes is here:

rti_connext_dds-6.0.1/resource/app/bin/x64Linux2.6gcc4.4.5

Unfortunately, this is the only precompiled executable of RTI's services, including Recording Service, that is distributed with RTI Connext DDS 6.0.1.

Which means that the compiler that you use to compile your plugin needs to be compatible with gcc 4.4.5.

In RTI's next release, RTI Connext 6.1, executables for the RTI services will be available for all supported target platforms...just to address this issue.

However at this time you have 2 workarounds:

1) install gcc 4.4.5 or compatible compiler, install the x64Linux2.6gcc4.4.5 target platform for RTI Connext 6.0.1, compile your plugin with this compiler

2) Build your own rtirecordingservice executable.  Even though we don't provide the final executable for every target platform, we do provide the libraries needed to do so yourself.

See this: 

https://community.rti.com/static/documentation/connext-dds/6.0.1/doc/api/routing_service/api_cpp/group__RTI__RoutingServiceLibModule.html