[asan] Update asan config to work with gcc; fix a few issues#22746
Open
hageboeck wants to merge 7 commits into
Open
[asan] Update asan config to work with gcc; fix a few issues#22746hageboeck wants to merge 7 commits into
hageboeck wants to merge 7 commits into
Conversation
ferdymercury
reviewed
Jul 2, 2026
ferdymercury
suggested changes
Jul 2, 2026
ferdymercury
left a comment
Collaborator
There was a problem hiding this comment.
Thanks a lot!
Could you edit https://github.com/root-project/root/blob/master/cmake/modules/RootBuildOptions.cmake#L194 to reflect that both GCC and Clang work ?
silverweed
approved these changes
Jul 2, 2026
silverweed
left a comment
Contributor
There was a problem hiding this comment.
Thanks! I second @ferdymercury's request to edit the message if you confirmed that clang works
Test Results 23 files 23 suites 3d 15h 9m 36s ⏱️ For more details on these failures, see this check. Results for commit c1897f9. ♻️ This comment has been updated with latest results. |
Since the \0 character was missing in the dynamically allocated buffer, the strlen function can run past the end of the buffer. Therefore, the buffer was replaced with a TString directly constructed from char* and length.
7345086 to
e98fd05
Compare
Asan detected an overflow of the argv array, because it violated the convention to contain an extra element == nullptr.
- Convert the flags from a list into a string. - Append the string to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS. - Activate use-after-scope sanitisation also in gcc. In this way, the flags are observable at configure time, they propagate into builtins and tools like clad which are initialised with ROOT's CMAKE_CXX_FLAGS. This also allowed for removing two special cases for gtest and clad.
Instead of sanitizing only a few hand-picked executables, recursively search all executables defined in the build system. Sanitize all that don't link to ROOTStaticSanitizerConfig. Since roottest is part of ROOT, several special cases could be removed.
Member
Author
|
@silverweed could I ask you to check again? |
silverweed
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For those externals that are not covered by the sanitizer (system libs or builtins), modern sanitiser implementations cover them through function interpositioning, so dynamic allocations are covered (while the stack is not). This seems a good compromise, because objects that are passed around between ROOT and builtins are covered.
ROOT_EXECUTABLE, ROOT's sanitiser configs were missing. Instead of keeping up-to-date a curated list of executables that break tests, there's now a CMake function to sanitise every executable declared in the ROOT build.In testing the asan builds,
foursix issues were uncovered and fixed:A use-after-free in CppInterOp (when passing argument to the interpreter by
char*) will be addressed by @aaronj0 in #22728Fix #7968