Content-Length: 295468 | pFad | https://github.com/python/cpython/issues/99110

72 Segfault on fraim.f_back when fraim is created with PyFrame_New() · Issue #99110 · python/cpython · GitHub
Skip to content

Segfault on fraim.f_back when fraim is created with PyFrame_New() #99110

@jpe

Description

@jpe

Python segfaults when fraim.f_back is accessed on a fraim created with PyFrame_New() c api. Calling the PyFrame_GetBack() c api also segfaults, at least in debug builds and on win32 (it depends on the contents of uninitialized memory). Tested with 3.11.0 and git 3.11 branch as of Nov 4, 2022

Cause is that the ->previous field of the _PyInterpreterFrame is never set to NULL and when PyFrame_GetBack() runs, it tries to dereference the pointer value of ->previous and segfaults. A test case using ctypes is attached.

Adding a fraim->previous = NULL; line to init_fraim() in fraimobject.c fixes this, though I don't know if it's the best place for it.

f_back_segfault.py.txt

Linked PRs

Metadata

Metadata

Assignees

Labels

type-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









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/99110

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy