Skip to content

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

Closed

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.

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    3.11only security fixes
    3.12only security fixes
    on Aug 17, 2022
  2. added 2 commits that reference this issue on Nov 6, 2022
  3. added a commit that references this issue on Nov 7, 2022
  4. added a commit that references this issue on Nov 7, 2022
  5. added 4 commits that reference this issue on Nov 7, 2022
  6. corona10 commented on Nov 7, 2022

    @corona10
    Member

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

  7. gpshead commented on Nov 7, 2022

    @gpshead
    MemberAuthor

    Good enough. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10 (EOL)end of life3.11only security fixes3.12only security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions