Visitar URL original
[3.13] gh-140815: Fix faulthandler for invalid/freed frame (#140921) by vstinner · Pull Request #140985 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20251105000046/https://github.com/python/cpython/pull/140985
Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Nov 4, 2025 •

faulthandler now detects if a frame or a code object is invalid or freed.

Add helper functions:

  • _PyCode_SafeAddr2Line()
  • _PyFrame_SafeGetCode()
  • _PyFrame_SafeGetLasti()

_PyMem_IsPtrFreed() now detects pointers in [-0xff, 0xff] range as freed.

(cherry picked from commit a84181c)

)

faulthandler now detects if a frame or a code object is invalid or
freed.

Add helper functions:

* _PyCode_SafeAddr2Line()
* _PyFrame_SafeGetCode()
* _PyFrame_SafeGetLasti()

_PyMem_IsPtrFreed() now detects pointers in [-0xff, 0xff] range
as freed.

(cherry picked from commit a84181c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant