Skip to content

DAOS-18626 build: Add ASan/UBSan/TSan compiler and Docker build support#18613

Draft
knard38 wants to merge 1 commit into
ckochhof/dev/master/daos-18826/patch-001from
ckochhof/dev/master/daos-18626/patch-002
Draft

DAOS-18626 build: Add ASan/UBSan/TSan compiler and Docker build support#18613
knard38 wants to merge 1 commit into
ckochhof/dev/master/daos-18826/patch-001from
ckochhof/dev/master/daos-18626/patch-002

Conversation

@knard38

@knard38 knard38 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

This is PR 1 of 10 in the split of #18557 (see ckochhof/dev/master/daos-18626/patch-001 for 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 into CGO_LDFLAGS so that go build picks them up when CGO-linking a sanitizer-compiled C archive (otherwise Go binaries get "DSO missing from command line" for libubsan.so.1).
  • 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 (confirmed via an isolated single-threaded reproducer to be a TSan tool limitation, not a DAOS bug).
  • 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.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

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>
@knard38 knard38 self-assigned this Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Ticket title is 'ASAN Men check with GitHub Action'
Status is 'In Progress'
https://daosio.atlassian.net/browse/DAOS-18626

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants