Repository navigation
Conversation
Since ClickHouse#124678 (AWS SDK 1.11.907) `Aws::Utils::Base64::Base64::Encode` calls `Aws::Crt::Base64Encode`, so the Content-MD5 header of every S3 write goes through `aws_base64_encode`. It dispatches on `aws_common_private_has_avx2`, which caches the AVX2 check in an unsynchronized `static int cpuid_state` (`contrib/aws-c-common/source/arch/intel/cpuid.c`). The first call on one thread and a later call on another race on it, and with `halt_on_error=1` the report aborts the TSan server (`test_s3_plain_rewritable_crash_recovery` and `test_refreshable_mv` in `Integration tests (amd_tsan)`). Every writer stores the same value derived from CPUID or `AWS_COMMON_AVX2`, so the race is benign. All accesses to `cpuid_state` are inside that one non-static function, so a `fun:` entry removes both sides of the race and nothing else, like the SQLite `randomnessPid` entry. Upstream runs this detection in `aws_common_library_init` since aws-c-common v1.0.2 (awslabs/aws-c-common#1280); ClickHouse pins v0.14.5, so the entry can be removed once the submodule is at v1.0.2 or later. Related: ClickHouse#124678, ClickHouse#125030 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 rounds, 1 finding) plus my own review (2 rounds, 1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261010-055200 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261010-031300 |
|
Workflow [PR], commit [3f140ef] Summary: ❌
AI ReviewSummaryThis PR adds a Final Verdict✅ No blocking or major issues found in the current patch. |
CI finish ledger - 3f140efEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261010-103003 |
|
#125080 re-lands the AWS bump with |
| fun:*unixOpen* | ||
| # `cpuid_state` in aws-c-common caches the AVX2 check of the base64 codec without synchronization; | ||
| # every thread stores the same value, so the race is benign. | ||
| fun:aws_common_private_has_avx2 |
There was a problem hiding this comment.
No fun :)
Instead, let's patch the library.
There was a problem hiding this comment.
#125080 does this with the upstream library patch: it moves aws-c-common to v1.0.2, where awslabs/aws-c-common#1280 runs this detection once in aws_common_library_init, while still single-threaded. Master has been clean since the revert #125030, so this PR is not needed and can be closed in favor of #125080.
Related: #124678
Related: #125030
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Ignore a benign data race in the AVX2 detection of
aws-c-commonin TSan builds, which aborted the server on concurrent S3 writes.Description
Since #124678 (AWS SDK 1.11.907), the server in
Integration tests (amd_tsan)aborts intest_s3_plain_rewritable_crash_recoveryandtest_refreshable_mvwithThreadSanitizer: data race ... cpuid.c:118:20 in aws_common_private_has_avx2,Location is global 'cpuid_state'(report). The revert robot opened #125030 for the bump; with this entry the bump can stay, or land again if it is reverted.The new SDK implements
Aws::Utils::Base64::Base64::EncodewithAws::Crt::Base64Encode, so theContent-MD5header of every S3 write now goes throughaws_base64_encode, which caches its AVX2 check in a plainstatic inton first use. The first call on one thread and a later call on another race on it. Every writer stores the same value, so the race is benign. Upstream runs this detection inaws_common_library_initsince v1.0.2 (awslabs/aws-c-common#1280); ClickHouse pins v0.14.5, so the entry can go after a bump.The change adds
fun:aws_common_private_has_avx2totests/tsan_ignorelist.txt, like the SQLiterandomnessPidentry. That function is the only one touchingcpuid_state; the sibling CPU-feature functions stay instrumented.Validation on a local TSan build:
aws_base64_encodeagainst this build'sawslibrary: 20/20 runs report the race without the entry, 0/200 with it.__tsan_read4/__tsan_write4calls in the function: 2 in the master CI binary, 0 in the fixed binary.test_s3_plain_rewritable_crash_recovery: 3/3 full runs green with no TSan report; the master CI binary fails the same module with this report.If preferred, I can bump
aws-c-commonto v1.0.3 instead of adding the entry.Workflow [PR]
Sync PR [sync-upstream/pr/125039]