From 825b31b20360e4d0bc655e67e3b09491bdfdfc15 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 19 Jul 2026 17:03:19 +0200 Subject: [PATCH] Record clean ThreadSanitizer release gate --- docs/release-testing-0.7.md | 2 +- docs/test-evidence/0.7-r1.md | 65 ++++++++++++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/docs/release-testing-0.7.md b/docs/release-testing-0.7.md index 35548e3..055f9cd 100644 --- a/docs/release-testing-0.7.md +++ b/docs/release-testing-0.7.md @@ -47,7 +47,7 @@ only in the pass evidence directory, which must not be committed. | BLD-04 | Complete Clang CTest suite | [PASS](test-evidence/0.7-r1.md#bld-04) | | | | BLD-05 | ASan and UBSan build plus unit and protocol sessions | [PASS](test-evidence/0.7-r1.md#bld-05) | | | | BLD-06 | LeakSanitizer run over startup, delivery, access, and shutdown | [PASS](test-evidence/0.7-r1.md#bld-06) | | | -| BLD-07 | Separate ThreadSanitizer concurrency run | | | | +| BLD-07 | Separate ThreadSanitizer concurrency run | [PASS](test-evidence/0.7-r1.md#bld-07) | | | | BLD-08 | 32-bit x86 build and tests without pointer/size truncation | | | | | BLD-09 | ARMv5 build with the supported baseline toolchain | | | | | BLD-10 | ARMv6 build with the supported baseline toolchain | | | | diff --git a/docs/test-evidence/0.7-r1.md b/docs/test-evidence/0.7-r1.md index 7175bd5..131ee3c 100644 --- a/docs/test-evidence/0.7-r1.md +++ b/docs/test-evidence/0.7-r1.md @@ -128,7 +128,7 @@ state, and Store search-hit parsing. Result: **PASS** -Commit `7a67cfafaa156749e934f7d96e76768098d87778` was tested with +Commit `3e9b934ec471ec75f3872558d58f25c710064dab` was tested with LeakSanitizer enabled together with ASan and UBSan. Leak detection remained enabled during startup, SMTP delivery, IMAP and POP access, and the complete manager/agent shutdown. The host `bongo.service` stayed stopped; the protocol @@ -153,7 +153,7 @@ unshare --user --map-root-user --net \ /tmp/bongo-0.7-r1-asan-session.sh ``` -- Native CTest: 52 passed, 0 failed. This includes the full Mailutils Sieve +- Native CTest: 55 passed, 0 failed. This includes the full Mailutils Sieve syntax/error path and the queue-registration cancellation regression test. - Python C-extension CTest: 2 passed, 0 failed with the ASan runtime loaded before CPython. @@ -164,7 +164,7 @@ unshare --user --map-root-user --net \ - No LeakSanitizer, AddressSanitizer, UBSan, or runtime-error diagnostic was present in the test output or manager/agent log. - CMake cache SHA-256: - `7425b6570598d6bb107066fc6f38b2207731ff12088b965a58d7f3e3c5517296` + `9696f8805c0f7c50c50ee4e2828600bd8f110b266e49cb72f2a188584f424e4f` - Configuration-set SHA-256: `d6de90aed16ac5c1407fc6dce9a4ee08740c6971d174436eb563df832ec82eed` @@ -175,3 +175,62 @@ allocations, libcurl global cleanup, detached thread-pool lifetime, monitor shutdown, the IMAP busy-thread count, and cancellation of Queue registration while the Queue server is going away. The Mailutils 3.21 fix is carried by the Bongo overlay as commit `61670a4` and was installed for this run. + +## BLD-07 + +Result: **PASS** + +Commit `3e9b934ec471ec75f3872558d58f25c710064dab` was built with Clang 22.1.8 +and ThreadSanitizer. The +installed tree used the same private configuration/state roots and isolated +user/network namespace as the ASan/LSan protocol session. + +```sh +CC=clang cmake -S . -B /tmp/bongo-0.7-r1-tsan-live -G Ninja \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON \ + -DCMAKE_C_FLAGS='-fsanitize=thread -fno-omit-frame-pointer' \ + -DCMAKE_EXE_LINKER_FLAGS='-fsanitize=thread' \ + -DCMAKE_SHARED_LINKER_FLAGS='-fsanitize=thread' \ + -DCMAKE_INSTALL_PREFIX=/tmp/bongo-0.7-r1-tsan-root/usr \ + -DBONGO_CONFIG_DIR=/tmp/bongo-0.7-r1-asan-config \ + -DBONGO_STATE_DIR=/tmp/bongo-0.7-r1-asan-state -DBONGO_USER=root + +TSAN_OPTIONS=halt_on_error=1 \ +ctest --test-dir /tmp/bongo-0.7-r1-tsan-live \ + --output-on-failure -E '^python-' + +LD_PRELOAD=/usr/lib/clang/22/lib/linux/libclang_rt.tsan-x86_64.so \ +TSAN_OPTIONS=halt_on_error=1 \ +ctest --test-dir /tmp/bongo-0.7-r1-tsan-live \ + --output-on-failure -R '^python-' + +unshare --user --map-root-user --net \ + /tmp/bongo-0.7-r1-tsan-session.sh +``` + +- Native CTest: 55 passed, 0 failed, including the concurrent atomic and + Store logical-lock regression tests. +- Python C-extension CTest: 2 passed, 0 failed with the Clang TSan runtime + loaded before the uninstrumented CPython executable. +- Protocol session: SMTP submission with STARTTLS, SMTPS, IMAPS delivery and + search, IMAP STARTTLS, POP3 STLS, and POP3S passed. +- Every listener and worker stopped normally. No ThreadSanitizer diagnostic + remained in test output or manager/agent logs. +- CMake cache SHA-256: + `d20e5508f082782b8867520f3123171de74e76ac2c0004e1f16fa274c1a9f468` +- Configuration-set SHA-256: + `d6de90aed16ac5c1407fc6dce9a4ee08740c6971d174436eb563df832ec82eed` + +The repair loop found and fixed real concurrency defects: an AB/BA Store lock +order, non-atomic shared agent and listener state, Queue worker teardown while +shared tables were still in use, listener socket ownership during shutdown, +SMTP client-pool lifetime accounting, the legacy thread-group macro writing to +shared caller state, and POP3 freeing a shared GnuTLS context while a worker +was still negotiating. The portable atomic implementation is selected through +GCC/Clang builtins and CMake links `libatomic` automatically on targets that +require it, including older 32-bit architectures. + +After those repairs, the complete ASan/UBSan/LeakSanitizer CTest and live +protocol session were repeated successfully. This confirms that the +concurrency fixes did not regress the Mailutils Sieve leak repair or introduce +new ownership errors.