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

gh-96055: Update faulthandler to emit proper unexpect signal number#99162

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
corona10 merged 3 commits intopython:mainfromcorona10:gh-96055
Nov 7, 2022
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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
Update :mod:`faulthandler` to emit an error message with the proper
unexpected signal number. Patch by Dong-hee Na.
20 changes: 16 additions & 4 deletionsModules/faulthandler.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -333,14 +333,17 @@ faulthandler_fatal_error(int signum)
size_t i;
fault_handler_t *handler = NULL;
int save_errno = errno;
int found = 0;

if (!fatal_error.enabled)
return;

for (i=0; i < faulthandler_nsignals; i++) {
handler = &faulthandler_handlers[i];
if (handler->signum == signum)
if (handler->signum == signum) {
found = 1;
break;
}
}
if (handler == NULL) {
/* faulthandler_nsignals == 0 (unlikely) */
Expand All@@ -350,9 +353,18 @@ faulthandler_fatal_error(int signum)
/* restore the previous handler */
faulthandler_disable_fatal_handler(handler);

PUTS(fd, "Fatal Python error: ");
PUTS(fd, handler->name);
PUTS(fd, "\n\n");
if (found) {
PUTS(fd, "Fatal Python error: ");
PUTS(fd, handler->name);
PUTS(fd, "\n\n");
}
else {
char unknown_signum[23] = {0,};
snprintf(unknown_signum, 23, "%d", signum);
PUTS(fd, "Fatal Python error from unexpected signum: ");
PUTS(fd, unknown_signum);
PUTS(fd, "\n\n");
}

faulthandler_dump_traceback(fd, fatal_error.all_threads,
fatal_error.interp);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp