python / python/cpython

Freethreading interpreter will attempt to import unsupported stable ABI extension modules

Open
#120,901 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending topic-free-threading type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

Compile a stable ABI extension module with the filename "something.abi3.so" (or .pyd on Windows)

Run python -c "import something"

A freethreading build will attempt to import the extension module, even though it explicitly isn't compatible with the stable ABI. This (unsurprisingly) leads to a crash.

Tested on beta 3.13.0b2 (but a quick search didn't find relevant changes after that)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on a freethreading CPython 3.13 build with a stable ABI extension named something.abi3.so, then trace the interpreter's extension-module import handling. Verify the completed change by rerunning python -c "import something" and confirming the unsupported stable ABI module is not attempted in a way that crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.