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

Python3.10.5 Pattern Matching Excessive Memory Consumption #93671

Closed
Assignees
pablogsalbrandtbucher
Labels
3.10only security fixes3.11only security fixes3.12only security fixestype-crashA hard crash of the interpreter, possibly with a core dump
@tom-p-reichel

Description

@tom-p-reichel

Crash report

While writing some code to match a particularly complicated AST, I accidentally wrote a function whose definition causes the Python 3.10.5 interpreter to rapidly consume memory. On my system, it consumed approximately 24 GBs of memory before being killed.

The function is as follows:

defdefines(self):matchself.ast:case [S('CoqAst'), [[S('v'), [_, _, [S('expr'), [S('VernacDefinition'), [S('NoDischarge'),S('Definition')], [[[S('v'), [S('Name'), [S('Id'),S(name)]]], _], []], [S('DefineBody'), [], [], [_, _], []]]]]], _]]| [S('CoqAst'), [[S('v'), [[S('control'), []], [S('attrs'), []], [S('expr'), [S('VernacStartTheoremProof'),S('Theorem'), [[[[[S('v'), [S('Id'),name]], _], []], _]]]]]], _]]:returnname

To replicate, paste the above function into a python file and run it.

Error messages

OOM killing produced no output, save forKilled.

Your environment

  • CPython versions tested on: 3.10.5
  • Operating system and architecture: Tested on both Windows 10 and ArchLinux.

Metadata

Metadata

Labels

3.10only security fixes3.11only security fixes3.12only security fixestype-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