cyclonedds
cyclonedds copied to clipboard
undefined reference to symbol when building with tsan
I'm trying to build with tsan enabled following this guide here: https://github.com/colcon/colcon-sanitizer-reports/blob/master/README.rst
In order to test an issue with moveit I've generated my workspace like this:
rosinstall_generator moveit --rosdistro rolling --deps | vcs import src
When I build with this command:
colcon build --build-base=build-tsan --install-base=install-tsan \
--cmake-args -DOSRF_TESTING_TOOLS_CPP_DISABLE_MEMORY_TOOLS=ON \
-DINSTALL_EXAMPLES=OFF -DSECURITY=ON --no-warn-unused-cli \
-DCMAKE_BUILD_TYPE=Debug \
--mixin tsan ccache
I get this error:
--- stderr: cyclonedds
/usr/bin/ld: CMakeFiles/ddsconf.dir/__/__/ddsrt/src/threads/posix/threads.c.o: undefined reference to symbol 'pthread_getspecific@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
cyclonedds is checked out from the source release with this tag: release/rolling/cyclonedds/0.8.0-6
I am on Ubuntu 20.04 with all the requirements on the ros2 install page installed. I do not have any ros workspace sourced.
That looks like -lpthread
(from the top of my head) isn't passed to the compiler because the function is found during compilation(?) If you do a non-tsan build, do you also receive the linker error?
It builds fine without tsan. I agree it looks like pthread isn't being linked to correctly but wasn't able to figure out how to modify cyclonedds to fix this.
Hi @tylerjw,
Are you still running into this issue? If so I'll take another look.
I have not reproduced it recently but I could if that would help. I believe it is probably just something small in the cmake although I wasn't able to figure it out.
No more feedback forthcoming, closing. Please open a new issue with more information if the problem reoccurs.