Age | Commit message (Collapse) | Author | Files | Lines |
|
PR go/61871
runtime: Increase stack size on 64-bit non-split-stack systems.
From Uros Bizjak.
From-SVN: r219192
|
|
From-SVN: r219049
|
|
From Uros Bizjak.
https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01366.html
From-SVN: r218819
|
|
PR go/61258
runtime: Don't crash when deleting zero-sized key.
From-SVN: r218702
|
|
This patches in the Go 1.4 function, for convenience for
people using the Go 1.4 go tool with mainline gccgo.
From-SVN: r218700
|
|
Fix an unusual C to Go callback case. Newly created C threads
call into Go code, forcing the Go code to allocate new M and G
structures. While executing Go code, the stack is split. The
Go code then returns. Returning from a Go callback is treated
as entering a system call, so the G gcstack field is set to
point to the Go stack. In this case, though, we were called
from a newly created C thread, so we drop the extra M and G
structures. The C thread then exits.
Then a new C thread calls into Go code, reusing the previously
created M and G. The Go code requires a larger stack frame,
causing the old stack segment to be unmapped and a new stack
segment allocated. At this point the gcstack field is
pointing to the old stack segment.
Then a garbage collection occurs. The garbage collector sees
that the gcstack field is not nil, so it scans it as the first
stack segment. Unfortunately it points to memory that was
unmapped. So the program crashes.
The fix is simple: when handling extra G structures created
for callbacks from new C threads, clear the gcstack field.
From-SVN: r218699
|
|
drivers
* testsuite/lib/libatomic.exp: Load target-utils.exp
* testsuite/lib/libitm.exp: Load target-utils.exp.
Move load of target-supports.exp earlier.
* testsuite/lib/libvtv.exp: Load target-utils.exp
From-SVN: r218664
|
|
This goes towards making libgo more self-contained.
From-SVN: r218198
|
|
ppc64 for BE
ppc64le for LE
issue 8654
From-SVN: r217941
|
|
Different compilers may have different release cadences or ABI
incompatibilities, so it does not make sense to use the same library
name for runtime libraries intended for different compilers.
This CL causes a libgo built by llgo to receive the name libgo-llgo.
Likewise, libgobegin is named libgobegin-llgo.
From-SVN: r217583
|
|
From-SVN: r217404
|
|
2014-11-05 Dominik Vogt <vogt@linux.vnet.ibm.com>
* libgo/runtime/runtime.c (runtime_cputicks): s390: use stckf
unconditionally
From-SVN: r217195
|
|
2014-11-06 Dominik Vogt <vogt@linux.vnet.ibm.com>
* libgo/mksysinfo.sh: Tolerate missing structures.
From-SVN: r217194
|
|
Backport https://codereview.appspot.com/111320044 from Go
master library.
From-SVN: r217110
|
|
From Dominik Vogt.
* libgo/go/syscall/libcall_linux_s390.go: New file for s390 support.
* libgo/go/syscall/syscall_linux_s390.go: Ditto.
* libgo/go/syscall/libcall_linux_s390x.go: New file for s390x support.
* libgo/go/syscall/syscall_linux_s390x.go: Ditto.
* libgo/go/runtime/pprof/pprof.go (printStackRecord): Support s390 and
s390x.
* libgo/runtime/runtime.c (runtime_cputicks): Add support for s390 and
s390x
* libgo/mksysinfo.sh: Ditto.
(upcase_fields): New helper function
* libgo/go/debug/elf/file.go (applyRelocations): Implement relocations
on s390x.
(applyRelocationsS390x): Ditto.
(DWARF): Ditto.
* libgo/go/debug/elf/elf.go (R_390): New constants for S390 relocations.
(r390Strings): Ditto.
(String): Helper function for S390 relocations.
(GoString): Ditto.
* libgo/go/reflect/makefuncgo_s390.go: New file.
(S390MakeFuncStubGo): Implementation of s390 abi.
* libgo/go/reflect/makefuncgo_s390x.go: New file.
(S390xMakeFuncStubGo): Implementation of s390x abi.
* libgo/go/reflect/makefunc_s390.c: New file.
(makeFuncStub): s390 and s390x specific implementation of function.
* libgo/go/reflect/makefunc.go
(MakeFunc): Add support for s390 and s390x.
(makeMethodValue): Ditto.
(makeValueMethod): Ditto.
* libgo/Makefile.am (go_reflect_makefunc_s_file): Ditto.
(go_reflect_makefunc_file): Ditto.
* libgo/go/reflect/makefunc_dummy.c: Ditto.
* libgo/runtime/runtime.h (__go_makefunc_can_recover): Export prototype
for use in makefunc_s390.c.
(__go_makefunc_returning): Ditto.
* libgo/go/syscall/exec_linux.go (forkAndExecInChild): Fix order of the
arguments of the clone system call for s390[x].
* libgo/configure.ac (is_s390): New variable.
(is_s390x): Ditto
(LIBGO_IS_S390): Ditto.
(LIBGO_IS_S390X): Ditto.
(GOARCH): Support s390 and s390x.
* libgo/go/go/build/build.go (cgoEnabled): Ditto.
* libgo/go/go/build/syslist.go (goarchList): Ditto.
From-SVN: r217106
|
|
version
From-SVN: r217049
|
|
Backport of https://codereview.appspot.com/125910043 from the
dev.power64 branch of the master repository.
From-SVN: r216813
|
|
TIOCSWINSZ_val, TCGETS_val, TCSETS_val
From-SVN: r216807
|
|
From-SVN: r216746
|
|
From-SVN: r216490
|
|
Backport https://codereview.appspot.com/155450044 from the
master Go library. Original description:
I came across this while debugging a GC problem in gccgo.
There is code in assignTo and cvtT2I that handles assignment
to all interface values. It allocates an empty interface even
if the real type is a non-empty interface. The fields are
then set for a non-empty interface, but the memory is recorded
as holding an empty interface. This means that the GC has
incorrect information.
This is extremely unlikely to fail, because the code in the GC
that handles empty interfaces looks like this:
obj = nil;
typ = eface->type;
if(typ != nil) {
if(!(typ->kind&KindDirectIface) || !(typ->kind&KindNoPointers))
obj = eface->data;
In the current runtime the condition is always true--if
KindDirectIface is set, then KindNoPointers is clear--and we
always want to set obj = eface->data. So the question is what
happens when we incorrectly store a non-empty interface value
in memory marked as an empty interface. In that case
eface->type will not be a *rtype as we expect, but will
instead be a pointer to an Itab. We are going to use this
pointer to look at a *rtype kind field. The *rtype struct
starts out like this:
type rtype struct {
size uintptr
hash uint32 // hash of type; avoids computation in hash tables
_ uint8 // unused/padding
align uint8 // alignment of variable with this type
fieldAlign uint8 // alignment of struct field with this type
kind uint8 // enumeration for C
An Itab always has at least two pointers, so on a
little-endian 64-bit system the kind field will be the high
byte of the second pointer. This will normally be zero, so
the test of typ->kind will succeed, which is what we want.
On a 32-bit system it might be possible to construct a failing
case by somehow getting the Itab for an interface with one
method to be immediately followed by a word that is all ones.
The effect would be that the test would sometimes fail and the
GC would not mark obj, leading to an invalid dangling
pointer. I have not tried to construct this test.
I noticed this in gccgo, where this error is much more likely
to cause trouble for a rather random reason: gccgo uses a
different layout of rtype, and in gccgo the kind field happens
to be the low byte of a pointer, not the high byte.
From-SVN: r216489
|
|
From Dominik Vogt.
From-SVN: r216355
|
|
We want to create goroutines with a small stack, at least on
systems where split stacks are supported. We don't need to
create threads with a small stack.
From-SVN: r216353
|
|
PR go/60406
runtime: Check callers in can_recover if return address doesn't match.
Also use __builtin_extract_return_address and tighten up the
checks in FFI code.
Fixes PR 60406.
From-SVN: r216003
|
|
PR go/61877
refect: fix direct call of variadic method value
As reported in bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61877
gcc mainline has regressed in this. This CL adds the tests proposed
for the main Go repository:
https://codereview.appspot.com/151280043/
https://codereview.appspot.com/152060043/
restores the code from the amd64/386 path that makes this work and
was lost when the Go 1.3 stdlib was merged and changes the FFI path
to call into the same helper code as the amd64/386 path.
I've only tested this on amd64 but I did test a version that was
patched to unconditionally take the FFI path.
From-SVN: r215859
|
|
Fixes issue 38.
From-SVN: r215832
|
|
This supports clang, which by default issues warnings about
unused command line arguments, a habit that interacts poorly
with configure scripts.
From-SVN: r215699
|
|
If the compiler inlines this function into kickoff, it may reuse
the TLS block address to load g. However, this is not necessarily
correct, as the call to g->entry in kickoff may cause the TLS
address to change. If the wrong value is loaded for g->status in
runtime_goexit, it may cause a runtime panic.
By marking the function as noinline we prevent the compiler from
reusing the TLS address.
From-SVN: r215484
|
|
From-SVN: r215423
|
|
Without this we weren't supporting the standard Cloneflags
field of SysProcAttr.
From-SVN: r214972
|
|
From-SVN: r214965
|
|
* go-gcc.cc (Gcc_backend::implicit_variable): Remove init
parameter. Add is_hidden parameter.
(Gcc_backend::implicit_variable_set_init): New method.
(Gcc_backend::implicit_variable_reference): New method.
From-SVN: r214894
|
|
From-SVN: r214048
|
|
The Go frontend passes closures through to functions using the
functions __go_set_closure and __go_get_closure. The
expectation is that there are no function calls between
set_closure and get_closure. However, it turns out that there
can be function calls if some of the function arguments
require type conversion to an interface type. Converting to
an interface type can allocate memory, and that can in turn
trigger a garbage collection, and that can in turn call pool
cleanup functions that may call __go_set_closure. So the
called function can see the wrong closure value, which is bad.
This patch fixes the problem in two different ways. First, we
move all type conversions in function arguments into temporary
variables so that they can not appear before the call to
__go_set_closure. (This required shifting the flatten phase
after the simplify_thunk phase, since the latter expects to
work with unconverted argument types.) Second, we fix the
memory allocation function to preserve the closure value
across any possible garbage collection.
A test case is the libgo database/sql check run with the
environment variable GOGC set to 1.
From-SVN: r213932
|
|
Based on patch from Rainer Orth.
From-SVN: r213599
|
|
PR other/61895
runtime: Ignore small argv[0] file for backtrace.
Reportedly in some cases Docker starts processes with argv[0]
pointing to an empty file. That would cause libgo to pass
that empty file to libbacktrace, which would then fail to do
any backtraces. Everything should work fine if libbacktrace
falls back to /proc/self/exe.
This patch to libgo works around the problem by ignoring
argv[0] if it is a small file, or if stat fails. This is not
a perfect fix but it's an unusual problem.
From-SVN: r213513
|
|
This variable is unused apparently as a result of local changes.
gccgo accepts this variable declaration, but other frontends may not.
From-SVN: r212873
|
|
This adds an import of the runtime package to fix compilation
of the TestStopCPUProfilingWithProfilerOff function.
The gccgo compiler should never have accepted this. The patch
for the comiler is http://codereview.appspot.com/116960043 .
The test is https://codereview.appspot.com/118000043 .
From-SVN: r212870
|
|
From-SVN: r212862
|
|
Keep using the existing 386 and amd64 code on those archs,
since it is more efficient.
From-SVN: r212853
|
|
From-SVN: r212840
|
|
From-SVN: r212837
|
|
This revision renames several files in the runtime directory
from .c to .goc.
From-SVN: r212472
|
|
Rename in order to avoid confusion with the new
runtime/iface.goc file in the Go library master sources.
From-SVN: r212447
|
|
The flags were used by the reflect package in the past, but
not for a couple of years now.
From-SVN: r212446
|
|
PR go/61620
runtime: Don't free tiny blocks in map deletion.
The memory allocator now has a special case for tiny blocks
(smaller than 16 bytes) and they can not be explicitly freed.
From-SVN: r212233
|
|
This introduces the "bench" build target, which can be used to run
all benchmarks.
It is also possible to run subsets of benchmarks with the
"package/check" build targets by setting GOBENCH to a matching regex.
From-SVN: r212212
|
|
From-SVN: r211961
|
|
PR go/52583
runtime: Stop backtrace at a few recognized functions.
On x86_64 Solaris the makecontext function does not properly
indicate that it is at the top of the stack. Attempting to
unwind the stack past a call to makecontext tends to crash.
This patch changes libgo to look for certain functions that
are always found at the top of the stack, and to stop
unwinding when it reaches one of those functions. There is
never anything interesting past these functions--that is,
there is never any code written by the user.
From-SVN: r211640
|
|
PR go/61498
runtime: Always set gcnext_sp to pointer-aligned address.
The gcnext_sp field is only used on systems that do not use
split stacks. It marks the bottom of the stack for the
garbage collector. This change makes sure that the stack
bottom is always aligned to a pointer value.
Previously the garbage collector would align all the addresses
that it scanned, but it now expects them to be aligned before
scanning.
From-SVN: r211639
|