DAOS-18626 build: Add ASan/UBSan/TSan compiler and Docker build support#18613
Draft
knard38 wants to merge 1 commit into
Draft
DAOS-18626 build: Add ASan/UBSan/TSan compiler and Docker build support#18613knard38 wants to merge 1 commit into
knard38 wants to merge 1 commit into
Conversation
Add the build-system plumbing needed to compile DAOS with UndefinedBehaviorSanitizer and ThreadSanitizer, in addition to the already-supported AddressSanitizer: - site_scons/site_tools/compiler_setup.py: link the UBSan/TSan runtime libraries (-lubsan/-ltsan) explicitly, including into CGO_LDFLAGS so that 'go build' picks them up when CGO-linking a sanitizer-compiled C archive. - src/control/SConscript: skip control man-page generation under a SANITIZERS build (not needed, avoids extra build cost). - src/gurt/misc.c: skip d_free()'s debug poisoning memset() under TSan, which otherwise turns a harmless zero-size-allocation address reuse into a false heap-use-after-free report. - utils/scripts/install-el9.sh: install compiler-rt, libubsan, and libtsan alongside the existing libasan dependency. - utils/docker/Dockerfile.el.9: thread a new SANITIZERS build-arg through to the scons invocation (empty/unset by default, so existing callers are unaffected). This is purely additive: no existing (non-sanitizer) build is affected, and SANITIZERS=address behavior is unchanged. Part of the DAOS-18626 ASan CI split (see ckochhof/dev/master/daos-18626/patch-001 for the original, unsplit commit). Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
|
Ticket title is 'ASAN Men check with GitHub Action' |
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.
Description
This is PR 1 of 10 in the split of #18557 (see
ckochhof/dev/master/daos-18626/patch-001for the original, unsplit commit). It adds the build-system plumbing needed to compile DAOS with UndefinedBehaviorSanitizer and ThreadSanitizer, in addition to the already-supported AddressSanitizer. It does not add any CI wiring or test-runner changes — those land in later PRs in this stack.What/why
site_scons/site_tools/compiler_setup.py: link the UBSan/TSan runtime libraries (-lubsan/-ltsan) explicitly, including intoCGO_LDFLAGSso thatgo buildpicks them up when CGO-linking a sanitizer-compiled C archive (otherwise Go binaries get "DSO missing from command line" forlibubsan.so.1).src/control/SConscript: skip control man-page generation under aSANITIZERSbuild (not needed, avoids extra build cost).src/gurt/misc.c: skipd_free()'s debug poisoningmemset()under TSan, which otherwise turns a harmless zero-size-allocation address reuse into a false heap-use-after-free report (confirmed via an isolated single-threaded reproducer to be a TSan tool limitation, not a DAOS bug).utils/scripts/install-el9.sh: installcompiler-rt,libubsan, andlibtsanalongside the existinglibasandependency.utils/docker/Dockerfile.el.9: thread a newSANITIZERSbuild-arg through to thesconsinvocation (empty/unset by default, so existing callers are unaffected).This is purely additive: no existing (non-sanitizer) build is affected, and
SANITIZERS=addressbehavior is unchanged.Steps for the author:
After all prior steps are complete: