René's URL Explorer Experiment


Title: test_capi fails on Sanitizers / TSan (free-threading) CI with exit code 66 · Issue #162144 · python/cpython · GitHub

Open Graph Title: test_capi fails on Sanitizers / TSan (free-threading) CI with exit code 66 · Issue #162144 · python/cpython

X Title: test_capi fails on Sanitizers / TSan (free-threading) CI with exit code 66 · Issue #162144 · python/cpython

Description: Bug report It seems like the problem comes from test_object_clear_managed_dict_ft_memory_error() of test_capi.test_object, a test added 2 days ago (commit 369d8bc). I don't think that the problem comes from this specific test, but more f...

Open Graph Description: Bug report It seems like the problem comes from test_object_clear_managed_dict_ft_memory_error() of test_capi.test_object, a test added 2 days ago (commit 369d8bc). I don't think that the problem c...

X Description: Bug report It seems like the problem comes from test_object_clear_managed_dict_ft_memory_error() of test_capi.test_object, a test added 2 days ago (commit 369d8bc). I don't think that the probl...

Opengraph URL: https://github.com/python/cpython/issues/162144

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_capi fails on Sanitizers / TSan (free-threading) CI with exit code 66","articleBody":"### Bug report\n\nIt seems like the problem comes from `test_object_clear_managed_dict_ft_memory_error()` of test_capi.test_object, a test added 2 days ago (commit 369d8bc4f6fe1f751de2512523a1acb95491a5eb).\n\nI don't think that the problem comes from this specific test, but more from `_testcapi.set_nomemory()` and `_testcapi.call_with_nomemory()` which are **not** thread safe. The problem comes from `PyMem_SetAllocator()` which uses a lock whereas functions reading the allocation function don't use a lock.\n\nI suppose that `@support.nomemtest` should be modified to skip the test if TSan is used.\n\nI'm working on a fix.\n\n---\n\nPython built with `./configure --config-cache 'OPT=-O2 -g' --with-thread-sanitizer --with-pydebug --disable-gil CC=clang LD=clang`.\n\nTest: `TSAN_OPTIONS=\"log_path=$PWD/san_log handle_segv=0\" ./python -m test test_capi --matchfile=bisect -v; echo \"exitcode => $?\"`.\n\nThe command fails with exit code 66.\n\nWith `bisect` file:\n\n```\ntest.test_capi.test_abstract.CAPITest.test_mapping_haskeystring\ntest.test_capi.test_capsule.CapsuleImportTests.test_error_from_import\ntest.test_capi.test_complex.CAPIComplexTest.test_py_c_pow\ntest.test_capi.test_config.CAPITests.test_config_set_cpu_count\ntest.test_capi.test_exceptions.Test_PyUnstable_Exc_PrepReraiseStar.test_reraise_orig\ntest.test_capi.test_function.FunctionTest.test_function_get_module\ntest.test_capi.test_getargs.Bytes_TestCase.test_c\ntest.test_capi.test_getargs.Bytes_TestCase.test_w_star\ntest.test_capi.test_mem.PyMemMallocDebugTests.test_pyobject_freed_is_freed\ntest.test_capi.test_misc.Test_testcapi.test_atomic_exchange_uint64\ntest.test_capi.test_misc.Test_testcapi.test_buildvalue_N\ntest.test_capi.test_misc.Test_testcapi.test_dict_iteration\ntest.test_capi.test_misc.Test_testcapi.test_pythread_tss_key_state\ntest.test_capi.test_object.CAPITest.test_object_clear_managed_dict_ft_memory_error\ntest.test_capi.test_slots.TypeSlotsTests.test_repeat_warning\ntest.test_capi.test_type.BuiltinStaticTypesTests.test_tp_bases_is_set\ntest.test_capi.test_unicode.CAPITest.test_fromstring\ntest.test_capi.test_unicode.CAPITest.test_tailmatch\ntest.test_capi.test_watchers.TestDictWatchers.test_watch_unassigned_watcher_id\ntest.test_capi.test_weakref.CAPIWeakrefTest.test_pyweakref_checkproxy\n```\n\nTSan log:\n\n```\nWARNING: ThreadSanitizer: data race (pid=2260396)\n  Write of size 8 at 0x000000dee638 by thread T13:\n    #0 __tsan_memcpy ??:? (python+0x760682) (BuildId: 088d0863e8351f5ea2fa99217aa4430d2048d6e2)\n    #1 set_allocator_unlocked /home/vstinner/python/main/Objects/obmalloc.c:? (python+0x9fec80) (BuildId: 088d0863e8351f5ea2fa99217aa4430d2048d6e2)\n    #2 PyMem_SetAllocator /home/vstinner/python/main/Objects/obmalloc.c:1152 (python+0x9fec80)\n    #3 fm_setup_hooks /home/vstinner/python/main/./Modules/_testcapi/mem.c:163 (_testcapi.cpython-316td-x86_64-linux-gnu.so+0x52303) (BuildId: 0eac47155c6133af464962558ffdbdb649d9b928)\n    #4 fm_set_nomemory /home/vstinner/python/main/./Modules/_testcapi/mem.c:189 (_testcapi.cpython-316td-x86_64-linux-gnu.so+0x52303)\n    #5 call_with_nomemory /home/vstinner/python/main/./Modules/_testcapi/mem.c:239 (_testcapi.cpython-316td-x86_64-linux-gnu.so+0x511b1) (BuildId: 0eac47155c6133af464962558ffdbdb649d9b928)\n    ...\n\n  Previous read of size 8 at 0x000000dee638 by main thread:\n    #0 PyMem_Malloc /home/vstinner/python/main/Objects/obmalloc.c:1266 (python+0x9ff062) (BuildId: 088d0863e8351f5ea2fa99217aa4430d2048d6e2)\n    #1 list_allocate_array /home/vstinner/python/main/Objects/listobject.c:42 (python+0x957c14) (BuildId: 088d0863e8351f5ea2fa99217aa4430d2048d6e2)\n    #2 py_list_resize /home/vstinner/python/main/Objects/listobject.c:163 (python+0x957c14)\n    #3 list_resize /home/vstinner/python/main/Objects/listobject.c:128 (python+0x957c14)\n    #4 _PyList_AppendTakeRefListResize /home/vstinner/python/main/Objects/listobject.c:586 (python+0x957923) (BuildId: 088d0863e8351f5ea2fa99217aa4430d2048d6e2)\n    #5 _PyList_AppendTakeRef /home/vstinner/python/main/./Include/internal/pycore_list.h:53 (python+0xb4eb97) (BuildId: 088d0863e8351f5ea2fa99217aa4430d2048d6e2)\n    #6 _PyEval_EvalFrameDefault /home/vstinner/python/main/Python/generated_cases.c.h:3984 (python+0x7061fe) (BuildId: 088d0863e8351f5ea2fa99217aa4430d2048d6e2)\n    ...\n```\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-162154\n* gh-162174\n* gh-162175\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2026-11-17T01:02:07Z","url":"https://github.com/python/cpython/issues/162144"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d1fdf8ce-2d59-28a0-c7c8-dccd30ed2a70
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA01E:A70A9:1301711:1925116:6B01EE01
html-safe-nonce4ebf94a44b74a9c13cf643921681b3c705e2558e93d3d5dcba75c8e7e046f695
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDFFOkE3MEE5OjEzMDE3MTE6MTkyNTExNjo2QjAxRUUwMSIsInZpc2l0b3JfaWQiOiIzMDg5MjkxNTMwMjMwNDI3MTM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace644ec668c560b5b9b29916934c61778de3c9729aa8d7aaac51c9d7d114746c8
hovercard-subject-tagissue:6434466878
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/162144/issue_layout
twitter:imagehttps://opengraph.githubassets.com/cbc0c84af404c6bc645d37119b6fb76f163962736811965d73f19a3e9ceba6ba/python/cpython/issues/162144
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cbc0c84af404c6bc645d37119b6fb76f163962736811965d73f19a3e9ceba6ba/python/cpython/issues/162144
og:image:altBug report It seems like the problem comes from test_object_clear_managed_dict_ft_memory_error() of test_capi.test_object, a test added 2 days ago (commit 369d8bc). I don't think that the problem c...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevstinner
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/162144#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F162144
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F162144
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/162144
Reloadhttps://github.com/python/cpython/issues/162144
Reloadhttps://github.com/python/cpython/issues/162144
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/162144
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/162144
test_capi fails on Sanitizers / TSan (free-threading) CI with exit code 66https://github.com/python/cpython/issues/162144#top
https://github.com/vstinner
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Nov 17, 2026https://github.com/python/cpython/issues/162144#issue-6434466878
369d8bchttps://github.com/python/cpython/commit/369d8bc4f6fe1f751de2512523a1acb95491a5eb
gh-162144: Skip @nomemtest tests when using a thread sanitizer (TSan) #162154https://github.com/python/cpython/pull/162154
[3.15] gh-162144: Skip @nomemtest tests when using a thread sanitizer (TSan) (GH-162154) #162174https://github.com/python/cpython/pull/162174
[3.14] gh-162144: Skip @nomemtest tests when using a thread sanitizer (TSan) (GH-162154) #162175https://github.com/python/cpython/pull/162175
vstinnerhttps://github.com/vstinner
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
on Nov 17, 2026https://github.com/python/cpython/issues/162144#event-36347970149
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Nov 17, 2026https://github.com/python/cpython/issues/162144#issuecomment-6934494742
#157416https://github.com/python/cpython/pull/157416
d1878cchttps://github.com/python/cpython/commit/d1878ccb44999bfa30f5a0e84b4383e6068e5b72
gh-157415https://github.com/python/cpython/issues/157415
vstinnerhttps://github.com/vstinner
on Nov 17, 2026https://github.com/python/cpython/issues/162144#event-36348655945
vstinnerhttps://github.com/vstinner
on Nov 17, 2026https://github.com/python/cpython/issues/162144#event-36419186550
pythongh-162144: Skip `@nomemtest` when using a thread sanitizer (TSan)https://github.com/vstinner/cpython/commit/d2cb9b754571751a205ddc33bc2ad38896e86994
pythongh-162144https://github.com/python/cpython/issues/162144
d2cb9b7https://github.com/vstinner/cpython/commit/d2cb9b754571751a205ddc33bc2ad38896e86994
pythongh-162144: Skip `@nomemtest` tests when using a thread sanitize…https://github.com/vstinner/cpython/commit/99b239926333e3de6ff631e6f5e10e36b8961d6c
pythongh-162144https://github.com/python/cpython/issues/162144
99b2399https://github.com/vstinner/cpython/commit/99b239926333e3de6ff631e6f5e10e36b8961d6c
gh-162144: Skip `@nomemtest` tests when using a thread sanitizer (TSa…https://github.com/python/cpython/commit/e28063ef9bc5c79ab8576a7293ec97e5bd62b37a
gh-162144https://github.com/python/cpython/issues/162144
e28063ehttps://github.com/python/cpython/commit/e28063ef9bc5c79ab8576a7293ec97e5bd62b37a
vstinnerhttps://github.com/vstinner
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 17, 2026https://github.com/python/cpython/issues/162144#event-36454235240
vstinnerhttps://github.com/vstinner
on Nov 17, 2026https://github.com/python/cpython/issues/162144#event-36457476754
[3.15] gh-162144: Skip `@nomemtest` tests when using a thread sanitiz…https://github.com/python/cpython/commit/f0cf88c65937e9deee0a48778de62c1d7234a1b4
gh-162144https://github.com/python/cpython/issues/162144
f0cf88chttps://github.com/python/cpython/commit/f0cf88c65937e9deee0a48778de62c1d7234a1b4
[3.14] gh-162144: Skip `@nomemtest` tests when using a thread sanitiz…https://github.com/python/cpython/commit/ee7f7927b60ae43d7590d6cc1ebdcdb2a8b4c653
gh-162144https://github.com/python/cpython/issues/162144
ee7f792https://github.com/python/cpython/commit/ee7f7927b60ae43d7590d6cc1ebdcdb2a8b4c653
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/162144
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/162144
vstinnerhttps://github.com/vstinner
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.