Go to file
Ian Lance Taylor 421a8ed412 runtime: scan caller-saved registers for non-split-stack
While testing a patch on Solaris, which does not support split-stack, I
    ran across a bug in the handling of caller-saved registers for the
    garbage collector.  For non-split-stack systems, runtime_mcall is
    responsible for saving all caller-saved registers on the stack so that
    the GC stack scan will see them.  It does this by calling
    __builtin_unwind_init and setting the g's gcnextsp field to point to the
    current stack.  The garbage collector then scans the stack from gcnextsp
    to the top of stack.
    
    Unfortunately, the code was setting gcnextsp to point to runtime_mcall's
    argument, which meant that even though runtime_mcall was careful to
    store all caller-saved registers on the stack, the GC never saw them.
    This is, of course, only a problem if a value lives only in a
    caller-saved register, and not anywhere else on the stack or heap.  And
    it is only a problem if that caller-saved register manages to make it
    all the way down to runtime_mcall without being saved by any function on
    the way.  This is moderately unlikely but it turns out that the recent
    changes to keep values on the stack when compiling the runtime package
    caused it to happen for the local variable `s` in `notifyListWait` in
    runtime/sema.go.  That function calls goparkunlock which is simple
    enough to not require all registers, and itself calls runtime_mcall.  So
    it was possible for `s` to be released by the GC before the goroutine
    returned from goparkunlock, which eventually caused a dangling pointer
    to be passed to releaseSudog.
    
    This is not a problem on split-stack systems, which use
    __splitstack_get_context, which saves a stack pointer low enough on the
    stack to scan the registers saved by runtime_mcall.
    
    Reviewed-on: https://go-review.googlesource.com/31323

From-SVN: r241304
2016-10-18 13:29:37 +00:00
boehm-gc [Hurd, kFreeBSD] boehm-gc: Use mmap instead of brk 2016-03-29 23:05:07 +02:00
config remove support for the interix target 2016-06-21 21:57:20 +00:00
contrib Revert bogus dg-extract-results.sh change 2016-09-23 11:35:34 +00:00
fixincludes check.tpl: Convert line endings to unix on test outputs 2016-09-30 10:36:18 -06:00
gcc runtime: scan caller-saved registers for non-split-stack 2016-10-18 13:29:37 +00:00
gnattools configure.ac: Add ACX_NONCANONICAL_HOST. 2016-05-16 08:55:12 +00:00
gotools Update copyright dates 2016-06-07 08:54:22 +00:00
include dwarf2.h (enum dwarf_calling_convention): Add new DWARF5 calling convention codes. 2016-10-17 19:35:33 +02:00
INSTALL
intl
libada config.guess: Remove SH5 support. 2016-04-30 09:11:03 +00:00
libatomic [libatomic] Add missing files for RTEMS support 2016-05-10 06:52:48 +00:00
libbacktrace * all: Remove meaningless trailing whitespace. 2016-09-11 13:44:07 +00:00
libcc1 Update copyright dates 2016-06-07 08:54:22 +00:00
libcilkrts configure.ac: Move AC_USE_SYSTEM_EXTENSIONS behind AM_ENABLE_MULTILIB. 2016-05-10 16:44:19 +00:00
libcpp gcc/ 2016-10-12 01:19:06 +02:00
libdecnumber
libffi ffi.c (ffi_struct_type): Put type declaration on separate line. 2016-09-04 17:39:05 +00:00
libgcc Move MEMMODEL_* from coretypes.h to memmodel.h 2016-10-13 14:17:52 +00:00
libgfortran re PR fortran/48298 ([F03] User-Defined Derived-Type IO (DTIO)) 2016-10-18 04:14:25 +00:00
libgo runtime: scan caller-saved registers for non-split-stack 2016-10-18 13:29:37 +00:00
libgomp typeck.c (cp_build_unary_op): Diagnose incrementing boolean expressions. 2016-09-14 17:46:59 +00:00
libiberty Fix zero-length parameter bug in pex_run. 2016-09-19 10:02:56 +00:00
libitm Allocate memory on cache line if requested 2016-04-19 10:01:11 -07:00
libmpx mpx_wrappers.c (move_bounds): Fix overflow bug. 2016-06-10 09:23:53 +00:00
libobjc
liboffloadmic backport: Makefile.am (myo_inc_dir): Remove. 2016-07-21 18:41:27 +00:00
libquadmath
libsanitizer re PR sanitizer/77567 (ASAN: Bugus error "alloc-dealloc-mismatch (malloc vs operator delete [])" with C++17's over-aligned types) 2016-09-21 16:40:30 +02:00
libssp re PR target/65867 (bootstrap fails for mingw32 due to missing header in ssp.c) 2016-02-09 12:16:30 -07:00
libstdc++-v3 Don't define uses-allocator variable templates in C++11 2016-10-18 12:42:18 +01:00
libvtv Don't install libvtv without --enable-vtable-verify 2016-05-02 18:10:17 +00:00
lto-plugin re PR driver/68463 (Offloading fails when some objects are compiled with LTO and some without) 2016-02-25 12:23:52 +00:00
maintainer-scripts re PR web/50642 (onlinedocs formated text too small to read) 2016-09-04 19:38:05 +00:00
zlib
.dir-locals.el
.gitattributes add basic .gitattributes files to notice whitespace issues 2016-04-23 02:37:43 +00:00
.gitignore .gitignore: Ignore in-tree prerequisites. 2016-09-09 17:20:55 -04:00
ABOUT-NLS
ChangeLog * MAINTAINERS: Update email address. 2016-10-11 10:36:33 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess config.guess: Import version 2016-04-02 (newest). 2016-05-16 16:13:37 -06:00
config.rpath
config.sub config.guess: Import version 2016-04-02 (newest). 2016-05-16 16:13:37 -06:00
configure configure.ac: Add aarch64-*-freebsd*. 2016-10-10 23:31:17 +02:00
configure.ac configure.ac: Add aarch64-*-freebsd*. 2016-10-10 23:31:17 +02:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS * MAINTAINERS: Update email address. 2016-10-11 10:36:33 +00:00
Makefile.def Makefile.def: Remove libjava. 2016-09-30 16:08:23 +00:00
Makefile.in Makefile.def: Remove libjava. 2016-09-30 16:08:23 +00:00
Makefile.tpl Makefile.def: Remove libjava. 2016-09-30 16:08:23 +00:00
missing
mkdep
mkinstalldirs
move-if-change
README
symlink-tree
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.