-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests: Use ASAN for all (native) tests #20550
base: master
Are you sure you want to change the base?
Conversation
not just unit tests
This verifies that unit tests still run under ASAN (they currently do but are special-cased)
This fails before the Do-Not-Merge should-really-fail commit on top, first time in tests_rtc, but I don't know enough about native's signal handling to make anything of it -- @fjmolinas, @OlegHahm, any ideas? copy of the linked test failure
|
Hm, at least test_rtc is not failing on the mentioned commit on my machine (clang version 17.0.6). How can I trigger all tests at once? |
/** | ||
* @{ | ||
* | ||
* @file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @file | |
* @file | |
* @brief Provide a true-positive (failing) test case for ASAN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only the "DO NOT MERGE" that will be removed once verified -- that commit will be removed again because AFAICT we don't have infrastructure for required-to-fail-to-build tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bold words for someone working that late on the weekend ;)
Yes please! |
Not reproducible for me either. |
Co-authored-by: Teufelchen <[email protected]>
Contribution description
So far, ASAN has only been used in unit tests for native, but not in general tests.
ASAN would have spotted issues like #20549, and may spot security issues as well -- but only wen turned on.
There is a trade-off: Enabling ASAN pulls in the NATIVE_MEMORY define that disables TLSF. I think it's worth it: It's more likely we make bugs anywhere in the tested code base that are spotted this way than to overlook TLSF bugs that only occur on native (because it's still tested on other boards), and memory properties are different on native already anyway.
(FWIW I'd advocate enabling ASAN for developers all the time, but let's take it one step at a time.)
Testing procedure