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

compiling an AST with an invalid TypeAlias causes a segmentation fault #109341

Closed
Assignees
JelleZijlstra
Labels
3.12only security fixes3.13bugs and security fixestopic-typingtype-crashA hard crash of the interpreter, possibly with a core dump
@15r10nk

Description

@15r10nk

Bug report

Bug description:

The code for the following AST is:

typefoo['x']=Callable

compiling the AST for the given code results in a segmentation fault

fromastimport*m=Module(body=[TypeAlias(name=Subscript(value=Name(id="foo",ctx=Load()),slice=Constant(value="x"),ctx=Store(),            ),type_params=[],value=Name(id="Callable",ctx=Load()),        )    ],type_ignores=[],)compile(fix_missing_locations(m),"<file>","exec")

output (Python 3.12.0rc2+):

fish: Job 1, 'venv3.12/bin/python bug.py' terminated by signal SIGSEGV (Adressbereichsfehler)

Compiling the code gives the correct syntax error.

compile("type foo['x'] = Callable","<file>","exec")

output (Python 3.12.0rc2+):

Traceback (most recent call last):  File "/home/frank/projects/executing/bug.py", line 1, in <module>    compile("type foo['x'] = Callable","<file>","exec")  File "<file>", line 1    type foo['x'] = Callable             ^^^SyntaxError: invalid syntax

CPython versions tested on:

3.12

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixestopic-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-2025 Movatter.jp