The Wayback Machine - https://web.archive.org/web/20241129093427/https://github.com/python/cpython/issues/123967
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faulthandler's dump_traceback doesn't handle case where top-most frame is FRAME_OWNED_BY_CSTACK #123967

Open
colesbury opened this issue Sep 11, 2024 · 0 comments
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@colesbury
Copy link
Contributor

colesbury commented Sep 11, 2024

Bug report

We properly skip trampoline frames when they are not the top-most frame:

cpython/Python/traceback.c

Lines 979 to 982 in 3bd942f

if (frame->owner == FRAME_OWNED_BY_CSTACK) {
/* Trampoline frame */
frame = frame->previous;
}

But if tstate->current_frame is a trampoline frame (i.e., FRAME_OWNED_BY_CSTACK) then dump_traceback will crash if faulthandler is triggered when executing a trampoline frame.

Linked PRs

@colesbury colesbury added type-bug An unexpected behavior, bug, or error 3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Sep 11, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Nov 27, 2024
If the top-most frame is a trampoline frame, skip it.
@picnixz picnixz added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Nov 27, 2024
vstinner added a commit that referenced this issue Nov 27, 2024
If the top-most frame is a trampoline frame, skip it.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 28, 2024
)

If the top-most frame is a trampoline frame, skip it.
(cherry picked from commit 58e334e)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit that referenced this issue Nov 28, 2024
…127363)

gh-123967: Fix faulthandler for trampoline frames (#127329)

If the top-most frame is a trampoline frame, skip it.

(cherry picked from commit 58e334e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants