aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_openbsd.go
AgeCommit message (Collapse)Author
2021-01-22runtime: switch runtime to libc for openbsd/amd64Joel Sing
Use libc rather than performing direct system calls for the runtime on openbsd/amd64. Updates #36435 Change-Id: Ib708009c3743f56a3fd6cb3bc731451e4a398849 Reviewed-on: https://go-review.googlesource.com/c/go/+/270379 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-08-29runtime: forward crashing signals to late handlersElias Naur
CL 49590 made it possible for external signal handlers to catch signals from a crashing Go process. This CL extends that support to handlers registered after the Go runtime has initialized. Updates #20392 (and possibly fix it). Change-Id: I18eccd5e958a505f4d1782a7fc51c16bd3a4ff9c Reviewed-on: https://go-review.googlesource.com/57291 Run-TryBot: Elias Naur <elias.naur@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-25runtime: unify sigTabT type across Unix systemsIan Lance Taylor
Change-Id: I8e8a3a118b1216f191c9076b70a88f6f3f19f79f Reviewed-on: https://go-review.googlesource.com/59150 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-26runtime: unify sigtrampgoIan Lance Taylor
Combine the various versions of sigtrampgo into a single function in signal_unix.go. This requires defining a fixsigcode method on sigctxt for all operating systems; it only does something on Darwin. This also requires changing the darwin/amd64 signal handler to call sigreturn itself, rather than relying on sigtrampgo to call sigreturn for it. We can then drop the Darwin sigreturn function, as it is no longer used. Change-Id: I5a0b9d2d2c141957e151b41e694efeb20e4b4b9a Reviewed-on: https://go-review.googlesource.com/29761 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-26runtime: unify handling of alternate signal stackIan Lance Taylor
Change all Unix systems to use stackt for the alternate signal stack (some were using sigaltstackt). Add OS-specific setSignalstackSP function to handle different types for ss_sp field, and unify all OS-specific signalstack functions into one. Unify handling of alternate signal stack in OS-specific minit and sigtrampgo functions via new functions minitSignalstack and setGsignalStack. Change-Id: Idc316dc69b1dd725717acdf61a1cd8b9f33ed174 Reviewed-on: https://go-review.googlesource.com/29757 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-12runtime: add ctxt parameter to cgocallback called from GoIan Lance Taylor
The cgocallback function picked up a ctxt parameter in CL 22508. That CL updated the assembler implementation, but there are a few mentions in Go code that were not updated. This CL fixes that. Fixes #16326 Change-Id: I5f68e23565c6a0b11057aff476d13990bff54a66 Reviewed-on: https://go-review.googlesource.com/24848 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
2016-04-15runtime: don't always unblock all signals on dragonfly, freebsd and openbsdMikio Hara
https://golang.org/cl/10173 intrduced msigsave, ensureSigM and _SigUnblock but didn't enable the new signal save/restore mechanism for SIG{HUP,INT,QUIT,ABRT,TERM} on DragonFly BSD, FreeBSD and OpenBSD. At present, it looks like they have the implementation. This change enables the new mechanism on DragonFly BSD, FreeBSD and OpenBSD the same as Darwin, NetBSD. Change-Id: Ifb4b4743b3b4f50bfcdc7cf1fe1b59c377fa2a41 Reviewed-on: https://go-review.googlesource.com/18657 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-03-24runtime: improve last ditch signal forwarding for Unix librariesJoe Sylve
The current runtime attempts to forward signals generated by non-Go code to the original signal handler. If it can't call the original handler directly, it currently attempts to re-raise the signal after resetting the handler. In this case, the original context is lost. This fix prevents that problem by simply returning from the go signal handler after resetting the original handler. It only does this when the original handler is the system default handler, which in all cases is known to not recover. The signal is not reset, so it is retriggered and the original handler takes over with the proper context. Fixes #14899 Change-Id: Ib1c19dfa4b50d9732d7a453de3784c8141e1cbb3 Reviewed-on: https://go-review.googlesource.com/21006 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-01-08runtime: add nowritebarrierrec to funcs called at signal timeIan Lance Taylor
Also nosplit where needed. Change-Id: I1e3f6f8f76df9ee7e87ed1b8560cef145928314c Reviewed-on: https://go-review.googlesource.com/18395 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-01-05runtime: set SIGCONT to _SigNotify + _SigDefaultIan Lance Taylor
Use the current ability to say that we don't do anything with SIGCONT by default, but programs can catch it using signal.Notify if they want. Fixes #8953. Change-Id: I67d40ce36a029cbc58a235cbe957335f4a58e1c5 Reviewed-on: https://go-review.googlesource.com/18185 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-24runtime: adjust gsignal stack to current signal stackIan Lance Taylor
If non-Go code calls sigaltstack before a signal is received, use sigaltstack to determine the current signal stack and set the gsignal stack to use it. This makes the Go runtime more robust in the face of non-Go code. We still can't handle a disabled signal stack or a signal triggered with SA_ONSTACK clear, but we now give clear errors for those cases. Fixes #7227. Update #9896. Change-Id: Icb1607e01fd6461019b6d77d940e59b3aed4d258 Reviewed-on: https://go-review.googlesource.com/18102 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2014-11-14[dev.cc] runtime: convert openbsd/amd64 port to GoJoel Sing
LGTM=rsc R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/171660043