This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients gregory.p.smith
Date 2021-03-03.17:45:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614793504.75.0.801298006043.issue43390@roundup.psfhosted.org>
In-reply-to
Content
PyOS_setsig currently sets the struct sigaction context.sa_flags = 0 before calling sigaction.

Other virtual machines such as Golang depend on signals using SA_ONSTACK such that signal handlers use a specially allocated stack that runtime sets up for reliability reasons as they use tiny stacks on normal threads.

SA_ONSTACK is a no-op flag in the typical case where no sigaltstack() call has been made to setup an alternate signal handling stack.  (as in 99.99% of all CPython applications)

When a C/C++ extension module is linked with cgo to call into a Golang library, doing this increases reliability.

As much as I try to dissuade anyone from creating and relying on hidden complexity multi-VM-hybrids in a single process like this, some people do, and this one line change helps.

Golang references:
  https://golang.org/pkg/os/signal/#hdr-Go_programs_that_use_cgo_or_SWIG
 and
  https://go-review.googlesource.com/c/go/+/298269/ (which clarifies that SA_RESTART is no longer a requirement. Good. Because Python won't get along well with that one.)
History
Date User Action Args
2021-03-03 17:45:04gregory.p.smithsetrecipients: + gregory.p.smith
2021-03-03 17:45:04gregory.p.smithsetmessageid: <1614793504.75.0.801298006043.issue43390@roundup.psfhosted.org>
2021-03-03 17:45:04gregory.p.smithlinkissue43390 messages
2021-03-03 17:45:04gregory.p.smithcreate