go/src
Russ Cox b3932baba4 runtime: fix sudog leak
The SudoG used to sit on the stack, so it was cheap to allocated
and didn't need to be cleaned up when finished.

For the conversion to Go, we had to move sudog off the stack
for a few reasons, so we added a cache of recently used sudogs
to keep allocation cheap. But we didn't add any of the necessary
cleanup before adding a SudoG to the new cache, and so the cached
SudoGs had stale pointers inside them that have caused all sorts
of awful, hard to debug problems.

CL 155760043 made sure SudoG.elem is cleaned up.
CL 150520043 made sure SudoG.selectdone is cleaned up.

This CL makes sure SudoG.next, SudoG.prev, and SudoG.waitlink
are cleaned up. I should have done this when I did the other two
fields; instead I wasted a week tracking down a leak they caused.

A dangling SudoG.waitlink can point into a sudogcache list that
has been "forgotten" in order to let the GC collect it, but that
dangling .waitlink keeps the list from being collected.
And then the list holding the SudoG with the dangling waitlink
can find itself in the same situation, and so on. We end up
with lists of lists of unusable SudoGs that are still linked into
the object graph and never collected (given the right mix of
non-trivial selects and non-channel synchronization).

More details in golang.org/issue/9110.

Fixes #9110.

LGTM=r
R=r
CC=dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/177870043
2014-11-16 16:44:45 -05:00
..
archive
bufio bufio: remove unused 'panicked' variable from test 2014-11-06 15:22:29 +11:00
builtin
bytes cmd/go: fix bytes and net the right way 2014-09-24 19:18:01 -04:00
cmd cmd/cgo: tweak doc to not show example of passing Go pointer 2014-11-10 08:12:43 -08:00
compress all: use golang.org/x/... import paths 2014-11-10 09:15:57 +11:00
container
crypto crypto/x509: add Solaris certificate file location 2014-11-09 20:57:44 -08:00
database/sql database/sql: make TestDrivers not crash on second run 2014-10-31 09:49:42 -07:00
debug all: use golang.org/x/... import paths 2014-11-10 09:15:57 +11:00
encoding encoding/json: encode \t as \t instead of \u0009 2014-10-27 18:58:25 -04:00
errors
expvar
flag flag: roll back 156390043 (flag setting) 2014-10-20 13:28:00 -07:00
fmt fmt: fix one-letter typo in doc.go 2014-10-29 06:53:05 -07:00
go go/build: Return MultiplePackageError on importing a dir containing multiple packages 2014-10-14 23:24:58 -04:00
hash hash/crc32: fix comment that the IEEE polynomial applies to MPEG-2. 2014-11-12 18:48:00 +11:00
html html/template: fix build after encoding/js escaping change 2014-10-28 10:18:44 +11:00
image image/gif: don't let the per-frame transparent index modify the global 2014-09-22 14:29:45 +10:00
index/suffixarray
internal/syscall
io io: clarify Reader returning 0, nil 2014-09-16 10:01:28 -04:00
lib9 lib9, cmd/ld: fixes for cross-linking on a Windows host 2014-09-18 17:27:26 -07:00
libbio
liblink liblink: require DATA lines to be ordered by offset, with no overlap 2014-10-14 23:25:12 -04:00
log log/syslog: try /var/run/log, for FreeBSD 2014-09-30 12:30:16 -04:00
math math/big: Allow non-prime modulus for ModInverse 2014-10-14 14:09:56 -07:00
mime
net net/http: add comment to clarify whether Dir is '/' or '\'. 2014-11-14 11:43:01 +11:00
os os: document that users of Fd should keep f alive 2014-11-06 09:36:51 -05:00
path path/filepath: document that Glob ignores i/o errors 2014-09-18 21:50:22 -04:00
reflect reflect: fix TestAllocations now that interfaces hold only pointers 2014-10-20 11:10:03 -07:00
regexp regexp/syntax: Clarify comment of OpAnyCharNotNL. 2014-11-11 18:52:07 -08:00
runtime runtime: fix sudog leak 2014-11-16 16:44:45 -05:00
sort
strconv
strings strings: use fast path for IndexRune 2014-10-06 15:10:51 -07:00
sync sync/atomic: fix comment referencing Value.Store's argument name 2014-10-31 00:48:57 -03:00
syscall syscall: fix ParseRoutingSockaddr with unexpected submessages 2014-10-28 11:35:00 -04:00
testing runtime: fix memory profiler 2014-10-16 22:11:26 +04:00
text text/template: fix bug in pipelined variadics 2014-10-18 11:22:05 -07:00
time time: panic with a more helpful error on use of invalid Timer 2014-10-21 13:26:40 +02:00
unicode unicode/utf8: fix docs for DecodeRune(empty) and friends. 2014-10-16 09:13:50 +11:00
unsafe unsafe: document that unsafe programs are not protected 2014-10-24 09:37:25 -07:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
clean.bash
clean.bat
clean.rc
make.bash
make.bat
make.rc
nacltest.bash
race.bash
race.bat
run.bash build: fix elf builds 2014-09-24 14:45:11 -07:00
run.bat run.bat: comment text properly 2014-10-02 16:15:36 +10:00
run.rc
sudo.bash