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

PYTHONMALLOCSTATS=1 fails with fatal error at Python exit #111499

Closed
Labels
3.12only security fixes3.13bugs and security fixestopic-subinterpreterstype-bugAn unexpected behavior, bug, or error
@vstinner

Description

@vstinner

Py_FinalizeEx() calls_PyObject_DebugMallocStats() which calls indirectly_PyInterpreterState_GET(). Problem: at this point, there is no "interpreter" anymore, and so_PyInterpreterState_GET() fails with a fatal error.

It's a regression introduced by commitdf3173d. Python 3.12 is also affected.

Reproducer:

$ PYTHONMALLOCSTATS=1 ./python -c passSmall block threshold = 512, in 32 size classes.(...)Total                              =              262,144Small block threshold = 512, in 32 size classes.(...)Total                              =              655,360Fatal Python error: _PyInterpreterState_GET: the function must be called with the GIL held, after Python initialization and before Python finalization, but the GIL is released (the current Python thread state is NULL)Python runtime state: finalizing (tstate=0x0000000000ae7550)Abandon (core dumped)

cc@ericsnowcurrently

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixestopic-subinterpreterstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp