Feature or enhancement
Proposal:
The faulthandler module allows registering a SIGSEGV handler to print a Python stacktrace if the program encounters a segfault. However, if developing C/C++ extension modules that may not be particularly useful on its own, and you also want the the C stacktrace.
The suggested API would be a kwarg to faulthandler.enable().
Implementation could use https://github.com/timmaxw/cfaulthandler as a starting point, timmaxw/cfaulthandler@561dbdd in particular.
The availability/usability of the feature would likely depend on platform and/or compile flags.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/print-c-stacktrace-with-faulthandler/56834
where @gpshead approved of opening a feature request
Linked PRs
Feature or enhancement
Proposal:
The
faulthandlermodule allows registering aSIGSEGVhandler to print a Python stacktrace if the program encounters a segfault. However, if developing C/C++ extension modules that may not be particularly useful on its own, and you also want the the C stacktrace.The suggested API would be a kwarg to faulthandler.enable().
Implementation could use https://github.com/timmaxw/cfaulthandler as a starting point, timmaxw/cfaulthandler@561dbdd in particular.
The availability/usability of the feature would likely depend on platform and/or compile flags.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/print-c-stacktrace-with-faulthandler/56834
where @gpshead approved of opening a feature request
Linked PRs
faulthandler#128159dprintf()for faulthandler C stacks #132800-ldlis passed to the linker whendladdr1is found #133040-ldlis passed only once to the linker #133071faulthandlerexample #136081faulthandlerexample (GH-136081) #136102