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 prints "Segmentation fault" on non SIGSEGV signal deaths #96055

Closed
gpshead opened this issue Aug 17, 2022 · 2 comments
Closed

faulthandler prints "Segmentation fault" on non SIGSEGV signal deaths #96055

gpshead opened this issue Aug 17, 2022 · 2 comments
Labels
3.10 3.11 3.12 type-bug An unexpected behavior, bug, or error

Comments

@gpshead
Copy link
Member

gpshead commented Aug 17, 2022

Bug report

The faulthandler module has a hard coded fixed small list of signals that it knows the name of. For anything not in this list it uses the final entry in its table as the value to print in the error message. This is misleading.

Ex: trigger a SIGTRAP in a Python process with faulthandler enabled.

The process exits properly indicating the correct death signal to the OS (Linux on aarch64 in this case), but the message emitted by Python is confusingly:

Fatal Python error: Segmentation fault

Current thread 0x0000005504ffa450 (most recent call first):
...

The cause is the faulthandler_handlers array of structs in https://github.com/python/cpython/blob/main/Modules/faulthandler.c#L130

We should expand that to include more deadly signals. SIGTRAP led someone to notice it here. When we don't have the signal listed in the table it'd be nicer to emit an error message saying that rather than mislabelling it.

@gpshead gpshead added type-bug An unexpected behavior, bug, or error 3.11 3.10 3.12 labels Aug 17, 2022
corona10 added a commit to corona10/cpython that referenced this issue Nov 6, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 7, 2022
…mber (pythongh-99162)

(cherry picked from commit f626b7b)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
tim-one pushed a commit to tim-one/cpython that referenced this issue Nov 7, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 7, 2022
…mber (pythongh-99162)

(cherry picked from commit f626b7b)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
miss-islington added a commit that referenced this issue Nov 7, 2022
…h-99162)

(cherry picked from commit f626b7b)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 7, 2022
…mber (pythongh-99162)

(cherry picked from commit f626b7b)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
miss-islington added a commit that referenced this issue Nov 7, 2022
…h-99162)

(cherry picked from commit f626b7b)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
@corona10
Copy link
Member

corona10 commented Nov 7, 2022

@gpshead Can we close the issue or do we need more action?

@gpshead
Copy link
Member Author

gpshead commented Nov 7, 2022

Good enough. Thanks!

@gpshead gpshead closed this as completed Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 3.11 3.12 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants