Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Crash in GenericAlias repr() with a self-mutating list #143823

Closed as not planned
Closed as not planned
Labels
topic-typingtype-crashA hard crash of the interpreter, possibly with a core dump
@JelleZijlstra

Description

@JelleZijlstra

Crash report

What happened?

This snippet causes a segfault on current main:

importtypeslst= []classX:def__repr__(self):lst.clear()return"x"lst+= [X(),1]ga=types.GenericAlias(int,lst)print(repr(ga))

This is because thega_repr_items_list() function does not properly handle the case where the list is mutated while we're iterating over it.

Similar to#143635 but a distinct code path.

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

macOS

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

Python 3.15.0a4+ (heads/main:1857a40807d, Jan 13 2026, 19:01:52) [Clang 15.0.0 (clang-1500.3.9.4)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-typingtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp