python / python/cpython

Assertion failures from `_interpchannels._register_end_types`

Open
#127,234 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.13 3.14 extension-modules topic-subinterpreters type-crash
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Crash report

What happened?

It's possible to abort a debug build by calling _interpchannels._register_end_types with invalid values:

import _interpchannels

_interpchannels._register_end_types(int, int)

Abort on 3.13:

python: Python/crossinterp_data_lookup.h:260: _PyCrossInterpreterData_RegisterClass: Assertion `matched->getdata == getdata' failed.
Aborted

Abort on main:

python: Python/crossinterp_data_lookup.h:271: _PyXIData_RegisterClass: Assertion `matched->getdata == getdata' failed.
Aborted

Found using fusil by @vstinner.

CPython versions tested on:

3.13, 3.14, CPython main branch

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.13.0+ (heads/3.13:746a0c5, Nov 20 2024, 21:39:05) [GCC 13.2.0]

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

Start by reproducing the debug-build abort with the _interpchannels._register_end_types call shown in the report, then inspect that entry point and the related assertion in Python/crossinterp_data_lookup.h. Done means invalid values no longer abort the interpreter and the behavior is covered by a regression test.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.