- 22 Jul, 2015 1 commit
-
-
Ian Lance Taylor authored
In the past badsignal would crash the program. In https://golang.org/cl/10757044 badsignal was changed to call sigsend, to fix issue #3250. The effect of this was that when a non-Go thread received a signal, and os/signal.Notify was not being used to check for occurrences of the signal, the signal was ignored. This changes the code so that if os/signal.Notify is not being used, then the signal handler is reset to what it was, and the signal is raised again. This lets non-Go threads handle the signal as they wish. In particular, it means that a segmentation violation in a non-Go thread will ordinarily crash the process, as it should. Fixes #10139. Update #11794. Change-Id: I2109444aaada9d963ad03b1d071ec667760515e5 Reviewed-on: https://go-review.googlesource.com/12503 Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
- 02 Jun, 2015 1 commit
-
-
Austin Clements authored
Currently signalstack takes a lower limit and a length and all calls hard-code the passed length. Change the API to take a *stack and compute the lower limit and length from the passed stack. This will make it easier for the runtime to steal some space from the top of the stack since it eliminates the hard-coded stack sizes. Change-Id: I7d2a9f45894b221f4e521628c2165530bbc57d53 Reviewed-on: https://go-review.googlesource.com/10311 Reviewed-by:
Rick Hudson <rlh@golang.org> Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 23 May, 2015 1 commit
-
-
Elias Naur authored
Implement the changes from CL 10173 on OpenBSD. Change-Id: I2db1cd8141fd392a34753a1b8113e2e0401173b9 Reviewed-on: https://go-review.googlesource.com/10342 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 22 May, 2015 1 commit
-
-
Elias Naur authored
Ian proposed an improved way of handling signals masks in Go, motivated by a problem where the Android java runtime expects certain signals to be blocked for all JVM threads. Discussion here https://groups.google.com/forum/#!topic/golang-dev/_TSCkQHJt6g Ian's text is used in the following: A Go program always needs to have the synchronous signals enabled. These are the signals for which _SigPanic is set in sigtable, namely SIGSEGV, SIGBUS, SIGFPE. A Go program that uses the os/signal package, and calls signal.Notify, needs to have at least one thread which is not blocking that signal, but it doesn't matter much which one. Unix programs do not change signal mask across execve. They inherit signal masks across fork. The shell uses this fact to some extent; for example, the job control signals (SIGTTIN, SIGTTOU, SIGTSTP) are blocked for commands run due to backquote quoting or $(). Our current position on signal masks was not thought out. We wandered into step by step, e.g., http://golang.org/cl/7323067 . This CL does the following: Introduce a new platform hook, msigsave, that saves the signal mask of the current thread to m.sigsave. Call msigsave from needm and newm. In minit grab set up the signal mask from m.sigsave and unblock the essential synchronous signals, and SIGILL, SIGTRAP, SIGPROF, SIGSTKFLT (for systems that have it). In unminit, restore the signal mask from m.sigsave. The first time that os/signal.Notify is called, start a new thread whose only purpose is to update its signal mask to make sure signals for signal.Notify are unblocked on at least one thread. The effect on Go programs will be that if they are invoked with some non-synchronous signals blocked, those signals will normally be ignored. Previously, those signals would mostly be ignored. A change in behaviour will occur for programs started with any of these signals blocked, if they receive the signal: SIGHUP, SIGINT, SIGQUIT, SIGABRT, SIGTERM. Previously those signals would always cause a crash (unless using the os/signal package); with this change, they will be ignored if the program is started with the signal blocked (and does not use the os/signal package). ./all.bash completes successfully on linux/amd64. OpenBSD is missing the implementation. Change-Id: I188098ba7eb85eae4c14861269cc466f2aa40e8c Reviewed-on: https://go-review.googlesource.com/10173 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 14 Apr, 2015 1 commit
-
-
David Crawshaw authored
Avoids shadowing the builtin channel close function. Change-Id: I7a729b0937c8248fe27222be61318a88db995eee Reviewed-on: https://go-review.googlesource.com/8898 Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org>
-
- 30 Mar, 2015 1 commit
-
-
Austin Clements authored
Currently, various functions are marked with the comment // May run without a P, so write barriers are not allowed. However, "running without a P" is ambiguous. We intended these to mean that m.p may be nil (which is the condition checked by the write barrier). The comment could also be taken to mean that a stop-the-world may happen, which is not the case for these functions because they run in situations where there is in fact a function on the stack holding a P locally, it just isn't in m.p. Change these comments to state precisely what we mean, that m.p may be nil. Change-Id: I4a4a1d26aebd455e5067540e13b9f96a7482146c Reviewed-on: https://go-review.googlesource.com/8209 Reviewed-by:
Minux Ma <minux@golang.org> Reviewed-by:
Rick Hudson <rlh@golang.org>
-
- 26 Mar, 2015 1 commit
-
-
Austin Clements authored
handoffp by definition runs without a P, so it's not allowed to have write barriers. It doesn't have any right now, but mark it nowritebarrier to disallow any creeping in in the future. handoffp in turns calls startm, newm, and newosproc, all of which are "below Go" and make sense to run without a P, so disallow write barriers in these as well. For most functions, we've done this because they may race with stoptheworld() and hence must not have write barriers. For these functions, it's a little different: the world can't stop while we're in handoffp, so this race isn't present. But we implement this restriction with a somewhat broader rule that you can't have a write barrier without a P. We like this rule because it's simple and means that our write barriers can depend on there being a P, even though this rule is actually a little broader than necessary. Hence, even though there's no danger of the race in these functions, we want to adhere to the broader rule. Change-Id: Ie22319c30eea37d703eb52f5c7ca5da872030b88 Reviewed-on: https://go-review.googlesource.com/8130 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by:
Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Rick Hudson <rlh@golang.org>
-
- 13 Mar, 2015 1 commit
-
-
Joel Sing authored
The kern.rthreads sysctl has not existed for a long time - there is no way to disable rthreads and __tfork no longer returns ENOTSUP. Change-Id: Ia50ff01ac86ea83358e72b8f45f7818aaec1e4b1 Reviewed-on: https://go-review.googlesource.com/7490 Reviewed-by:
Minux Ma <minux@golang.org>
-
- 02 Mar, 2015 1 commit
-
-
Matthew Dempsky authored
OpenBSD's sigprocmask system call passes the signal mask by value rather than reference, so vars are unnecessary. Additionally, declaring "var sigset_all = ^sigset_none" means sigset_all won't be initialized until runtime_init is called, but the first call to newosproc happens before then. I've witnessed Go processes on OpenBSD crash from receiving SIGWINCH on the newly created OS thread before it finished initializing. Change-Id: I16995e7e466d5e7e50bcaa7d9490173789a0b4cc Reviewed-on: https://go-review.googlesource.com/6440 Reviewed-by:
Mikio Hara <mikioh.mikioh@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 25 Feb, 2015 1 commit
-
-
Matthew Dempsky authored
OpenBSD's thrsleep system call includes an "abort" parameter, which specifies a memory address to be tested after being registered on the sleep channel (i.e., capable of being woken up by thrwakeup). By passing a pointer to waitsemacount for this parameter, we avoid race conditions without needing a lock. Instead we just need to use atomicload, cas, and xadd to mutate the semaphore count. Change-Id: If9f2ab7cfd682da217f9912783cadea7e72283a8 Reviewed-on: https://go-review.googlesource.com/5563 Reviewed-by:
Dmitry Vyukov <dvyukov@google.com> Reviewed-by:
Joel Sing <jsing@google.com>
-
- 19 Feb, 2015 1 commit
-
-
Matthew Dempsky authored
Change-Id: I2de63668a1c0152cc329df55c2d6d014e8183158 Reviewed-on: https://go-review.googlesource.com/4943 Reviewed-by:
Minux Ma <minux@golang.org>
-
- 28 Dec, 2014 1 commit
-
-
Keith Randall authored
Rename "gothrow" to "throw" now that the C version of "throw" is no longer needed. This change is purely mechanical except in panic.go where the old version of "throw" has been deleted. sed -i "" 's/[[:<:]]gothrow[[:>:]]/throw/g' runtime/*.go Change-Id: Icf0752299c35958b92870a97111c67bcd9159dc3 Reviewed-on: https://go-review.googlesource.com/2150 Reviewed-by:
Minux Ma <minux@golang.org> Reviewed-by:
Dave Cheney <dave@cheney.net>
-
- 23 Dec, 2014 1 commit
-
-
Austin Clements authored
These signals are used by glibc to broadcast setuid/setgid to all threads and to send pthread cancellations. Unlike other signals, the Go runtime does not intercept these because they must invoke the libc handlers (see issues #3871 and #6997). However, because 1) these signals may be issued asynchronously by a thread running C code to another thread running Go code and 2) glibc does not set SA_ONSTACK for its handlers, glibc's signal handler may be run on a Go stack. Signal frames range from 1.5K on amd64 to many kilobytes on ppc64, so this may overflow the Go stack and corrupt heap (or other stack) data. Fix this by ensuring that these signal handlers have the SA_ONSTACK flag (but not otherwise taking over the handler). This has been a problem since Go 1.1, but it's likely that people haven't encountered it because it only affects setuid/setgid and pthread_cancel. Fixes #9600. Change-Id: I6cf5f5c2d3aa48998d632f61f1ddc2778dcfd300 Reviewed-on: https://go-review.googlesource.com/1887 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 10 Dec, 2014 1 commit
-
-
Keith Randall authored
Change-Id: I0e95f8a5962c547da20e19a356ae1cf8375c9107 Reviewed-on: https://go-review.googlesource.com/1270 Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 14 Nov, 2014 3 commits
-
-
Russ Cox authored
Fixes build. Tested that all these systems can make.bash. TBR=austin CC=golang-codereviews https://golang.org/cl/177770043
-
Joel Sing authored
LGTM=rsc R=golang-codereviews, bradfitz, rsc CC=golang-codereviews https://golang.org/cl/173200044
-
Joel Sing authored
LGTM=rsc R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/171660043
-