gh-148037: remove critical section from PyCode_Addr2Line#148103
gh-148037: remove critical section from PyCode_Addr2Line#148103kumaraditya303 merged 7 commits intopython:mainfrom
PyCode_Addr2Line#148103Conversation
colesbury
left a comment
There was a problem hiding this comment.
Two comments below.
An additional thought: in light of things like https://discuss.python.org/t/pure-c-structured-traceback/106872, maybe we should just use atomic operations everywhere for these fields (i.e., _Py_atomic instead of FT_ATOMIC) because PyCode_Addr2Lineis called from _Py_DumpTraceback, which may be called from a signal handler or without holding the GIL.
colesbury
left a comment
There was a problem hiding this comment.
LGTM
Doesn't have to be part of this PR, but I'd like to remove _PyCode_SafeAddr2Line in a follow up. The atomic loads for checking are safer w.r.t. signal handlers and we can lift the bounds checking to the two call sites.
|
Thanks @kumaraditya303 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Sorry, @kumaraditya303, I could not cleanly backport this to |
…e` (pythonGH-148103) (cherry picked from commit d3b7b93) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
|
GH-148353 is a backport of this pull request to the 3.14 branch. |
Uh oh!
There was an error while loading. Please reload this page.