Skip to content

Commit 7b686b8

Browse files
committed
ci: 抑制 OpenSSL PBKDF2 的已知 TSan 竞争
背景:free-threading 构建的 Sanitizers / TSan 作业在 main 上连续 5 次失败(10-12 的 38178124237 等),唯一失败步骤是 --tsan-parallel --parallel-threads=4 那一步,失败项是 Sanitizers / TSan (free-threading) 与依赖它的 All required checks pass。TSan 只报一条警告: hash.pbkdf2_hmac() 经 PKCS5_PBKDF2_HMAC() 内部对同一地址出现 memcmp 读与 memcpy 写, 栈帧落在 Modules/clinic/_hashopenssl.c.h:1490 与 libcrypto.so.3,不在本仓库改动范围内 (Modules/_hashopenssl.c 来自基线提交 cc632c6,本 fork 未修改)。 改动:在 Tools/tsan/suppressions_free_threading.txt 增加一条 race:^pbkdf2_hmac$,并在注释里 记录复现命令、TSan 原文与上游条目 gh-143756。选择抑制而不是跳过测试,是为了让并行测试 继续覆盖其余用例。抑制文件由 reusable-san.yml:53 通过 TSAN_OPTIONS 传入,该文件此前为空。 验证:用 clang 14 编一个含同名 pbkdf2_hmac 函数的双线程竞争小程序,以 -fsanitize=thread 构建。 不加抑制运行时 TSan 报 2 条 data race、退出码 66;以 TSAN_OPTIONS=suppressions=<本文件> 运行时 0 条警告、退出码 0,证明该条目匹配得到同名栈帧。未在本地复现 CPython 的 TSan 构建。 Refs: python/cpython#143756 Refs: https://github.com/Flotiarenor/Kawaii-Python/actions/runs/38178124237
1 parent 75a0a94 commit 7b686b8

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

‎Tools/tsan/suppressions_free_threading.txt‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,24 @@
88
# that describes how to reproduce the race and includes the relevant TSan
99
# output.
1010

11-
# There are currently no active suppressions. This file is kept so tooling
12-
# that expects it can still find it.
11+
# The race is inside OpenSSL, not in CPython: hash.pbkdf2_hmac() reaches
12+
# PKCS5_PBKDF2_HMAC(), whose comparison of precomputed HMAC values is reported
13+
# as a read/write pair on the same address between two threads running the
14+
# "parallel tests" step of the TSan job. Upstream tracks OpenSSL binding races
15+
# in gh-143756 (https://github.com/python/cpython/issues/143756).
16+
#
17+
# Suppressed here rather than skipped in CI so that the parallel test step keeps
18+
# running the rest of the suite. Reproduce with:
19+
# ./python -m test --tsan-parallel --parallel-threads=4 -j4
20+
# TSan output (Actions run 38178124237, job 114585198438):
21+
# WARNING: ThreadSanitizer: data race (pid=32233)
22+
# Read of size 8 at 0x721c00011ac8 by thread T457:
23+
# #0 memcmp
24+
# #1 libcrypto.so.3+0x24f351
25+
# #2 pbkdf2_hmac Modules/clinic/_hashopenssl.c.h:1490:20
26+
# Previous write of size 8 at 0x721c00011ac8 by thread T456:
27+
# #0 memcpy
28+
# #1 libcrypto.so.3+0x24f166
29+
# #2 pbkdf2_hmac Modules/clinic/_hashopenssl.c.h:1490:20
30+
race:^pbkdf2_hmac$
31+

0 commit comments

Comments
 (0)