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

Thread and Address Sanitizer CI #198

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from

Conversation

tylerjw
Copy link

@tylerjw tylerjw commented Jun 12, 2022

Signed-off-by: Tyler Weaver tylerjw@gmail.com

This adds a github actions CI job for tsan and asan.

This can be tested by building locally with the new cmake variables added. For example building and testing with colcon can be done like this:

tsan:

colcon build --cmake-args -DENABLE_SANITIZER_THREAD=ON -DCMAKE_BUILD_TYPE=Debug
colcon test --event-handlers console_direct+

asan:

colcon build --cmake-args -DENABLE_SANITIZER_ADDRESS=ON -DCMAKE_BUILD_TYPE=Debug
colcon test --event-handlers console_direct+

I'm creating this with the hope that we can fix the errors found by ASAN and TSAN here so that projects that depend on this library can use ASAN and TSAN themselves.

Locally I've applied this change over #186 and was able to observe it reduced the number of errors found by ASAN.

@tylerjw tylerjw force-pushed the add_sanitizer_ci branch 2 times, most recently from fff8f12 to bc6d3b0 Compare June 12, 2022 14:56
@tylerjw
Copy link
Author

tylerjw commented Jun 12, 2022

Note that we should probably figure out how to run these changes in CI from this PR before merging this (to test the CI config works as expected). Also, this probably shouldn't be merged until asan and tsan tests pass (they don't locally).

The reason I created this was to make it easier to test this project locally with asan and tsan to begin fixing memory errors and race conditions.

@gbiggs
Copy link
Contributor

gbiggs commented Jun 12, 2022

I think merging it while the asan and tsan tests don't pass is OK, but I agree with the need to have it running from CI.

@tylerjw
Copy link
Author

tylerjw commented Jun 12, 2022

I'll see if I can get it to run in my fork to test if it runs.

@tylerjw
Copy link
Author

tylerjw commented Jun 12, 2022

@gbiggs I created this PR within my own fork to test that these work as expected: tylerjw#1

@tylerjw
Copy link
Author

tylerjw commented Jun 13, 2022

I spent today trying to figure out these memory leaks and while I don't have a PR yet I'm getting closer using a combination of asan and valgrind. I hope to have a PR soon that cleans up all manual memory management.

@tylerjw
Copy link
Author

tylerjw commented Jun 13, 2022

I'm a little confused by the heavy usage of recursive mutex, does anyone know if there are specific use cases that explain why this repo uses recursive mutexes and if hopefully those use cases are reflected in the tests?

@audrow audrow changed the base branch from ros2 to rolling June 28, 2022 14:17
Signed-off-by: Tyler Weaver <tylerjw@gmail.com>
@tylerjw
Copy link
Author

tylerjw commented Oct 21, 2022

I pushed a rebase of this to see if the latest merged changes fix the bug found by asan.

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

Successfully merging this pull request may close these issues.

2 participants