1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:38:32 -06:00
go/src
Austin Clements 3b5637ff2b runtime: doubly fix "double wakeup" panic
runtime.gchelper depends on the non-atomic load of work.ndone
happening strictly before the atomic add of work.nwait. Until very
recently (commit 978af9c2db, fixing #20334), the compiler reordered
these operations. This created a race since work.ndone can change as
soon as work.nwait is equal to work.ndone. If that happened, more than
one gchelper could attempt to wake up the work.alldone note, causing a
"double wakeup" panic.

This was fixed in the compiler, but to make this code less subtle,
make the load of work.ndone atomic. This clearly forces the order of
these operations, ensuring the race doesn't happen.

Fixes #19305 (though really 978af9c2db fixed it).

Change-Id: Ieb1a84e1e5044c33ac612c8a5ab6297e7db4c57d
Reviewed-on: https://go-review.googlesource.com/43311
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-05-12 15:33:09 +00:00
..
archive archive/zip: replace RWMutex with sync.Map 2017-04-29 17:21:43 +00:00
bufio bufio: clarify that Flush returns a cached write error 2017-04-21 00:48:51 +00:00
builtin
bytes internal/cpu: new package to detect cpu features 2017-05-10 17:02:21 +00:00
cmd cmd/go: fix TestExecutableGOROOT on Windows 2017-05-12 14:26:32 +00:00
compress compress/lzw: fix hi code overflow. 2017-04-28 05:59:30 +00:00
container container/heap: optimization when selecting smaller child 2017-05-09 03:38:37 +00:00
context context: define behavior for Err before Done is closed 2017-04-26 15:39:18 +00:00
crypto internal/cpu: new package to detect cpu features 2017-05-10 17:02:21 +00:00
database/sql database/sql: ensure releaseConn is defined before a possible close 2017-04-28 22:55:26 +00:00
debug cmd/internal/obj: fix LSym.Type during compilation, not linking 2017-05-02 00:21:33 +00:00
encoding encoding/gob: use MakeMapWithSize when decoding map 2017-05-03 02:43:40 +00:00
errors
expvar expvar: reduce sync.Map overhead for (*Map).Set 2017-05-02 17:13:40 +00:00
flag
fmt
go go/build: accept spaces in cgo directives 2017-05-10 17:14:57 +00:00
hash internal/cpu: new package to detect cpu features 2017-05-10 17:02:21 +00:00
html html/template: allow safe usage of predefined escapers in pipelines 2017-05-05 18:56:31 +00:00
image image/gif: don't panic on large or nil-containing color.Palettes. 2017-05-06 00:37:43 +00:00
index/suffixarray
internal internal/cpu: new package to detect cpu features 2017-05-10 17:02:21 +00:00
io io: correctly compute call depth in test 2017-04-18 19:56:54 +00:00
log
math internal/cpu: new package to detect cpu features 2017-05-10 17:02:21 +00:00
mime mime: re-accept empty encoded-text 2017-04-29 04:14:36 +00:00
net net/http: for http2, use the priority write scheduler by default 2017-05-11 17:46:43 +00:00
os os: remove extraneous 's' from TestStdPipe error message 2017-05-10 20:19:50 +00:00
path os: do not report ModeDir for symlinks on windows 2017-04-26 23:17:23 +00:00
plugin plugin: resolve plugin import path issue 2017-04-26 00:54:54 +00:00
reflect reflect: remove dead v.typ assignment 2017-05-11 08:07:21 +00:00
regexp regexp: speed up QuoteMeta with a lookup table 2017-04-28 06:43:14 +00:00
runtime runtime: doubly fix "double wakeup" panic 2017-05-12 15:33:09 +00:00
sort
strconv
strings internal/cpu: new package to detect cpu features 2017-05-10 17:02:21 +00:00
sync sync: really test DeepCopyMap 2017-04-30 14:17:36 +00:00
syscall syscall: fix typo in documentation for StringToUTF16Ptr 2017-04-28 05:28:27 +00:00
testing testing: add argument to list tests, benchmarks, and examples 2017-04-26 15:53:32 +00:00
text html/template: allow safe usage of predefined escapers in pipelines 2017-05-05 18:56:31 +00:00
time all: remove some unused parameters in test code 2017-04-25 14:38:10 +00:00
unicode
unsafe
vendor/golang_org/x vendor/golang_org/x/crypto/chacha20poly1305: revendor 2017-05-03 13:47:50 +00:00
all.bash Revert "build: fail nicely if somebody runs all.bash from a binary tarball package" 2017-04-28 21:19:32 +00:00
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc