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

[3.12] gh-123967: Fix faulthandler for trampoline frames (#127329)#127363

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 1 commit intopython:3.12fromvstinner:faulthandler_owned12
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-123967: Fix faulthandler for trampoline frames (#127329)
If the top-most frame is a trampoline frame, skip it.(cherry picked from commit58e334e)
  • Loading branch information
@vstinner
vstinner committedNov 28, 2024
commitb9d887812c44bffe0d66df2d117efbda0f007dd3
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
Fix faulthandler for trampoline frames. If the top-most frame is a
trampoline frame, skip it. Patch by Victor Stinner.
23 changes: 14 additions & 9 deletionsPython/traceback.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1242,6 +1242,8 @@ _Py_DumpASCII(int fd, PyObject *text)
static void
dump_frame(int fd, _PyInterpreterFrame *frame)
{
assert(frame->owner != FRAME_OWNED_BY_CSTACK);

PyCodeObject *code = frame->f_code;
PUTS(fd, " File ");
if (code->co_filename != NULL
Expand DownExpand Up@@ -1315,24 +1317,27 @@ dump_traceback(int fd, PyThreadState *tstate, int write_header)

unsigned int depth = 0;
while (1) {
if (frame->owner == FRAME_OWNED_BY_CSTACK) {
/* Trampoline frame */
frame = frame->previous;
if (frame == NULL) {
break;
}

/* Can't have more than one shim frame in a row */
assert(frame->owner != FRAME_OWNED_BY_CSTACK);
}

if (MAX_FRAME_DEPTH <= depth) {
PUTS(fd, " ...\n");
break;
}

dump_frame(fd, frame);
frame = frame->previous;
if (frame == NULL) {
break;
}
if (frame->owner == FRAME_OWNED_BY_CSTACK) {
/* Trampoline frame */
frame = frame->previous;
}
if (frame == NULL) {
break;
}
/* Can't have more than one shim frame in a row */
assert(frame->owner != FRAME_OWNED_BY_CSTACK);
depth++;
}
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp