Title: test_hashlib fails when run on Free Threading with TSAN · Issue #153201 · python/cpython · GitHub
Open Graph Title: test_hashlib fails when run on Free Threading with TSAN · Issue #153201 · python/cpython
X Title: test_hashlib fails when run on Free Threading with TSAN · Issue #153201 · python/cpython
Description: Crash report TSAN CI job: https://github.com/python/cpython/actions/runs/28747943876/job/85377269260?pr=152717 test_hashlib fails when run on Free Threading with TSAN on the main branch. Commands: export CC=clang export TSAN_OPTIONS="$PW...
Open Graph Description: Crash report TSAN CI job: https://github.com/python/cpython/actions/runs/28747943876/job/85377269260?pr=152717 test_hashlib fails when run on Free Threading with TSAN on the main branch. Commands: ...
X Description: Crash report TSAN CI job: https://github.com/python/cpython/actions/runs/28747943876/job/85377269260?pr=152717 test_hashlib fails when run on Free Threading with TSAN on the main branch. Commands: ...
Opengraph URL: https://github.com/python/cpython/issues/153201
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_hashlib fails when run on Free Threading with TSAN","articleBody":"# Crash report\n\nTSAN CI job: https://github.com/python/cpython/actions/runs/28747943876/job/85377269260?pr=152717\n\ntest_hashlib fails when run on Free Threading with TSAN on the main branch.\n\nCommands:\n\n```\nexport CC=clang\nexport TSAN_OPTIONS=\"$PWD/log_path=san_log suppressions=$PWD/Tools/tsan/suppressions_free_threading.txt handle_segv=0\"\n\n./configure --config-cache --with-thread-sanitizer --with-pydebug --disable-gil\nmake -j4\n./python -m test --tsan-parallel --parallel-threads=4 -j4 -W --timeout=600 --slowest\n```\n\nTests output (truncated):\n\n```\nUsing random seed: 1463135961\n0:00:00 load avg: 2.65 mem: 267.1 MiB Run 2 tests in parallel using 2 worker processes (timeout: 10 min, worker timeout: 15 min)\n0:00:06 load avg: 2.76 mem: 611.2 MiB [1/2] test_abc passed\n0:00:14 load avg: 2.78 mem: 278.3 MiB [2/2/1] test_hashlib worker non-zero exit code (Exit code 66)\ntest_algorithms_available (test.test_hashlib.HashLibTestCase.test_algorithms_available) [threads=4] ... ok\ntest_algorithms_guaranteed (test.test_hashlib.HashLibTestCase.test_algorithms_guaranteed) [threads=4] ... ok\n(...)\ntest_scrypt_types (test.test_hashlib.TestScrypt.test_scrypt_types) [threads=4] ... ok\ntest_scrypt_validate (test.test_hashlib.TestScrypt.test_scrypt_validate) [threads=4] ... ok\n\n----------------------------------------------------------------------\nRan 88 tests in 9.698s\n\nOK (skipped=56)\n\n== Tests result: FAILURE ==\n```\n\nTSAN logs (truncated):\n\n```\nWARNING: ThreadSanitizer: data race (pid=30628)\n Read of size 8 at 0x721c0000e3a8 by thread T456:\n #0 memcmp \u003cnull\u003e (python+0x10d49e) (BuildId: 5899a6ff881ea0db9e292325f4f3bbeaba9715e6)\n #1 \u003cnull\u003e \u003cnull\u003e (libcrypto.so.3+0x24f2d1) (BuildId: 6608be85412b580cc4873b0421a014a9cc2a7b41)\n #2 pbkdf2_hmac /home/runner/work/cpython/cpython/./Modules/clinic/_hashopenssl.c.h:1490:20 (_hashlib.cpython-316td-x86_64-linux-gnu.so+0x7299) (BuildId: 1c2fdd533a623cb5e65ca60ec9662a58487ffb8b)\n\n Previous write of size 8 at 0x721c0000e3a8 by thread T454 (mutexes: write M0, write M1):\n #0 memcpy \u003cnull\u003e (python+0xfc022) (BuildId: 5899a6ff881ea0db9e292325f4f3bbeaba9715e6)\n #1 \u003cnull\u003e \u003cnull\u003e (libcrypto.so.3+0x24f0e6) (BuildId: 6608be85412b580cc4873b0421a014a9cc2a7b41)\n #2 pbkdf2_hmac /home/runner/work/cpython/cpython/./Modules/clinic/_hashopenssl.c.h:1490:20 (_hashlib.cpython-316td-x86_64-linux-gnu.so+0x7299) (BuildId: 1c2fdd533a623cb5e65ca60ec9662a58487ffb8b)\n\n Mutex M0 (0x721000000500) created at:\n #0 pthread_rwlock_init \u003cnull\u003e (python+0x103e6e) (BuildId: 5899a6ff881ea0db9e292325f4f3bbeaba9715e6)\n #1 CRYPTO_THREAD_lock_new \u003cnull\u003e (libcrypto.so.3+0x275485) (BuildId: 6608be85412b580cc4873b0421a014a9cc2a7b41)\n #2 CRYPTO_THREAD_run_once \u003cnull\u003e (libcrypto.so.3+0x27556c) (BuildId: 6608be85412b580cc4873b0421a014a9cc2a7b41)\n #3 run_exec_func /home/runner/work/cpython/cpython/Objects/moduleobject.c:707:15 (python+0x374a4a) (BuildId: 5899a6ff881ea0db9e292325f4f3bbeaba9715e6)\n\n Mutex M1 (0x7210000008c0) created at:\n #0 pthread_rwlock_init \u003cnull\u003e (python+0x103e6e) (BuildId: 5899a6ff881ea0db9e292325f4f3bbeaba9715e6)\n #1 CRYPTO_THREAD_lock_new \u003cnull\u003e (libcrypto.so.3+0x275485) (BuildId: 6608be85412b580cc4873b0421a014a9cc2a7b41)\n #2 CRYPTO_THREAD_run_once \u003cnull\u003e (libcrypto.so.3+0x27556c) (BuildId: 6608be85412b580cc4873b0421a014a9cc2a7b41)\n #3 run_exec_func /home/runner/work/cpython/cpython/Objects/moduleobject.c:707:15 (python+0x374a4a) (BuildId: 5899a6ff881ea0db9e292325f4f3bbeaba9715e6)\n```\n\nFull TSAN logs: [tsan_full.log](https://github.com/user-attachments/files/29707099/tsan_full.log).","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2026-07-06T14:26:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/153201/cpython/issues/153201"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7a513424-7296-1ba6-9bdd-5e5600f26662 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8518:6EB9C:DF5A3:137321:6A4DBA61 |
| html-safe-nonce | 0e78e129975dc3e5957a57de6020daae88c510e20628e042ea9f092bfe8d5cd5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTE4OjZFQjlDOkRGNUEzOjEzNzMyMTo2QTREQkE2MSIsInZpc2l0b3JfaWQiOiI3MTM5OTE5NDk4MjUzODEwMjczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 54b9b2925313596107c0c6ea37ce1ede0117e6b53b812eff833ce09604085fe9 |
| hovercard-subject-tag | issue:4820076235 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/153201/issue_layout |
| twitter:image | https://opengraph.githubassets.com/14abe7f97d0d171c1bc8c5d81c242b3050f3fbfcf923392cd1105368673656cb/python/cpython/issues/153201 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/14abe7f97d0d171c1bc8c5d81c242b3050f3fbfcf923392cd1105368673656cb/python/cpython/issues/153201 |
| og:image:alt | Crash report TSAN CI job: https://github.com/python/cpython/actions/runs/28747943876/job/85377269260?pr=152717 test_hashlib fails when run on Free Threading with TSAN on the main branch. Commands: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32f7b614aca06e6bbd89842b1370df1328264f68 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width