1
0
mirror of https://github.com/golang/go synced 2024-11-26 21:11:57 -07:00
The Go programming language
Go to file
Russ Cox 26ad5d4ff0 cmd/gc: fix liveness vs regopt mismatch for input variables
The inputs to a function are marked live at all times in the
liveness bitmaps, so that the garbage collector will not free
the things they point at and reuse the pointers, so that the
pointers shown in stack traces are guaranteed not to have
been recycled.

Unfortunately, no one told the register optimizer that the
inputs need to be preserved at all call sites. If a function
is done with a particular input value, the optimizer will stop
preserving it across calls. For single-word values this just
means that the value recorded might be stale. For multi-word
values like slices, the value recorded could be only partially stale:
it can happen that, say, the cap was updated but not the len,
or that the len was updated but not the base pointer.
Either of these possibilities (and others) would make the
garbage collector misinterpret memory, leading to memory
corruption.

This came up in a real program, in which the garbage collector's
'slice len ≤ slice cap' check caught the inconsistency.

Fixes #7944.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, khr
https://golang.org/cl/100370045
2014-05-12 17:19:02 -04:00
api api: update next.txt 2014-04-01 13:14:45 -04:00
doc cmd/go: link SWIG objects directly rather than using a shared library 2014-05-12 12:43:51 -07:00
include include/plan9: make mklibc.rc compatible with 9atom 2014-04-19 09:55:09 +02:00
lib lib/time: update time zone info to v.2014b 2014-04-29 21:41:54 -04:00
misc cmd/gc: disable link-time copying of un-Go-initialized globals 2014-05-09 16:03:44 -04:00
src cmd/gc: fix liveness vs regopt mismatch for input variables 2014-05-12 17:19:02 -04:00
test cmd/gc: fix liveness vs regopt mismatch for input variables 2014-05-12 17:19:02 -04:00
.hgignore lib9: enable on Plan 9 2014-02-13 20:06:41 +01:00
.hgtags tag go1.2.2 2014-05-05 10:45:56 -07:00
AUTHORS A+C: Fabrizio Milo (individual CLA) 2014-05-12 09:33:48 -07:00
CONTRIBUTORS A+C: Fabrizio Milo (individual CLA) 2014-05-12 09:33:48 -07:00
favicon.ico
LICENSE
PATENTS
README README: Fix installation instructions 2013-11-20 13:47:37 -08:00
robots.txt

This is the source code repository for the Go programming language.  

For documentation about how to install and use Go,
visit http://golang.org/ or load doc/install-source.html
in your web browser.

After installing Go, you can view a nicely formatted
doc/install-source.html by running godoc --http=:6060
and then visiting http://localhost:6060/doc/install/source.

Unless otherwise noted, the Go source files are distributed
under the BSD-style license found in the LICENSE file.

--

Binary Distribution Notes

If you have just untarred a binary Go distribution, you need to set
the environment variable $GOROOT to the full path of the go
directory (the one containing this README).  You can omit the
variable if you unpack it into /usr/local/go, or if you rebuild
from sources by running all.bash (see doc/install.html).
You should also add the Go binary directory $GOROOT/bin
to your shell's path.

For example, if you extracted the tar file into $HOME/go, you might
put the following in your .profile:

    export GOROOT=$HOME/go
    export PATH=$PATH:$GOROOT/bin

See doc/install.html for more details.