GeezerVison is showing github.com — gh-150467: Fix linking python3.dll and python3t.dll with ASan on Windows by ck0i · Pull Request #160992 · python/cpython
Conversation
ck0i
commented
Oct 31, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes gh-150467.
Root cause
python3.dll and python3t.dll only contain /EXPORT forwarders and are linked with /NOENTRY, so the CRT is never pulled in. With ASan enabled, the linker adds clang_rt.asan_dynamic_runtime_thunk, which needs the CRT (_initterm, abort, __vcrt_*, __acrt_*), so the link fails with LNK2001.
python3.dll also fails this way at the parent of GH-149218, so the bug is older. That change added python3t.dll, a second forwarder built with the same settings.
Fix
python3dll.vcxproj and python3tdll.vcxproj now set NoEntryPoint only when EnableASAN isn't true, so ASan builds keep the default CRT entry point. ASan turned on only through _CL_/_LINK_ is not detected; use /p:EnableASAN=true.
Non-ASan builds are unchanged: both DLLs still have no entry point and no imports.
Testing
x64 Release, VS 2026 (MSVC 14.51), building python3dll.vcxproj and python3tdll.vcxproj on their own:
/p:EnableASAN=true: both failed with LNK2001 before, and link now. dumpbin shows _DllMainCRTStartup as the entry point and an import of clang_rt.asan_dynamic-x86_64.dll.
- Without ASan: both still have no entry point and no imports, and export the same 964 forwarders.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…n Windows
The stable ABI forwarder DLLs are linked with /NOENTRY, so nothing pulls
in the CRT. With AddressSanitizer enabled, the linker adds the ASan
runtime thunk library, which needs the CRT, and the link fails with
unresolved symbols. Keep the default CRT entry point for these DLLs
when building with ASan.
|
All commit authors signed the Contributor License Agreement.

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
⚠️ Failed 2026-10-31T03:33:16.126766Z We couldn’t complete this review. Comment @codex review to try again. |
0fd9307 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thank you for your interest in contributing to Python. This is a community-driven project, and we want it to be a welcoming place to learn and collaborate.
Contributors are responsible for reviewing and understanding what they submit, checking its claims, and being able to explain changes in their own words. This helps reviewers focus on the contribution and leaves more time to support other contributors.
This contribution appears to have been authored with AI assistance. Please explain your contribution in your own words and describe how you checked its correctness.
Please read our guidelines for using AI tools.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Agreed, made some changes regarding the comment you linked. Thanks.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
chris-eibl
Awaiting requested review from chris-eibl
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|