Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
Description
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 faultCurrent thread 0x0000005504ffa450 (most recent call first):...
The cause is thefaulthandler_handlers
array of structs inhttps://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.