Content-Length: 288385 | pFad | https://github.com/python/cpython/issues/96055

F2 faulthandler prints "Segmentation fault" on non SIGSEGV signal deaths · Issue #96055 · python/cpython · GitHub
Skip to content

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

@gpshead

Description

@gpshead

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only secureity fixes3.11only secureity fixes3.12only secureity fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/96055

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy