1
0
mirror of https://github.com/golang/go synced 2024-10-04 00:21:20 -06:00
Commit Graph

366 Commits

Author SHA1 Message Date
Russ Cox
904ec00981 [dev.garbage] merge default into dev.garbage 2014-10-03 12:22:19 -04:00
Rick Hudson
d42328c9f7 [dev.garbage] runtime: scan and mark phase refactoring
Refactoring of the scan and mark phase so that concurrent GC,
in particular the write barrier, can share a common infrastructure.
Now that the scan and mark phases have been separated
we will be able to scan stacks without blackening any objects.
This in turn will allow us to delay installing expensive write barrier code.

LGTM=rsc
R=rsc, khr, dvyukov
CC=golang-codereviews
https://golang.org/cl/145640044
2014-10-03 11:33:57 -04:00
Russ Cox
a3630c9e44 [dev.garbage] runtime: make sure G.param and SudoG.elem do not hold stale pointers
In old conservative Go, this could cause memory leaks.
A new pickier collector might reasonably crash when it saw one of these.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/147480043
2014-10-02 16:49:11 -04:00
Russ Cox
fdb0cc6e7b [dev.garbage] runtime: remove another BitsMultiWord
Not found because it was not used by name.
Add name in comments for what's left behind.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/148430043
2014-10-02 14:26:04 -04:00
Brad Fitzpatrick
85cdc49e8a os, syscall: add Unsetenv
Also address a TODO, making Clearenv pass through to cgo.

Based largely on Minux's earlier https://golang.org/cl/82040044

Fixes #6423

LGTM=iant, alex.brainman, r, rsc
R=rsc, iant, r, alex.brainman
CC=golang-codereviews
https://golang.org/cl/148370043
2014-10-01 11:17:15 -07:00
Keith Randall
ac9218f5f0 runtime: fix scanning of gc work buffer
GC types were not being generated for the garbage collector
work buffer.  The markfor object was being collected as a result.
This broke amd64p32 and maybe plan9 builds.  Why it didn't break
every build I'm not sure...

Fixes #8812

LGTM=0intro, rsc
R=golang-codereviews, dave, khr, 0intro, rsc
CC=golang-codereviews
https://golang.org/cl/149260043
2014-09-30 08:51:02 -07:00
Dmitriy Vyukov
12308d5a0b runtime: fix throwsplit check
Newstack runs on g0, g0->throwsplit is never set.

LGTM=rsc
R=rsc
CC=golang-codereviews, khr
https://golang.org/cl/147370043
2014-09-30 19:34:33 +04:00
Keith Randall
70b2da98ca runtime: initialize traceback variables earlier
Our traceback code needs to know the PC of several special
functions, including goexit, mcall, etc.  Make sure that
these PCs are initialized before any traceback occurs.

Fixes #8766

LGTM=rsc
R=golang-codereviews, rsc, khr, bradfitz
CC=golang-codereviews
https://golang.org/cl/145570043
2014-09-29 21:21:36 -07:00
Dave Cheney
0b36211cfb liblink: generate MRC replacement in liblink, not tls_arm
Fixes #8690.

This CL moves the save of LR around BL runtime.read_tls_fallback to liblink as it is not needed when MRC is not replaced.

LGTM=rsc, minux
R=rsc, khr, minux
CC=golang-codereviews
https://golang.org/cl/147310043
2014-09-30 10:03:10 +10:00
Keith Randall
b4380a3ba2 runtime: delete unused variables.
We're not comparing with code addresses any more.  Instead,
we use nil algorithm functions to mark uncomparable types.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/151040044
2014-09-29 14:05:33 -07:00
Keith Randall
e1364a6d0e runtime: fix cgo_topofstack to save clobbered registers
Fixes #8816

At least, I hope it does.

TBR=rsc
CC=golang-codereviews
https://golang.org/cl/153730043
2014-09-28 23:52:08 -07:00
Keith Randall
1aa65fe8d4 runtime: add load_g call in arm callback.
Need to restore the g register.  Somehow this line vaporized from
CL 144130043.  Also cgo_topofstack -> _cgo_topofstack, that vaporized also.

TBR=rsc
CC=golang-codereviews
https://golang.org/cl/150940044
2014-09-25 08:37:04 -07:00
Keith Randall
1b6807bb06 cgo: adjust return value location to account for stack copies.
During a cgo call, the stack can be copied.  This copy invalidates
the pointer that cgo has into the return value area.  To fix this
problem, pass the address of the location containing the stack
top value (which is in the G struct).  For cgo functions which
return values, read the stktop before and after the cgo call to
compute the adjustment necessary to write the return value.

Fixes #8771

LGTM=iant, rsc
R=iant, rsc, khr
CC=golang-codereviews
https://golang.org/cl/144130043
2014-09-25 07:59:01 -07:00
Russ Cox
3c94b1d305 runtime: more NOPTR
Fixes linux builds (_vdso); may fix others.
I can at least cross-compile cmd/go for every
implemented system now.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/142630043
2014-09-24 19:04:06 -04:00
Russ Cox
75cca0526d runtime: more NOPTR
Fixes (or makes better) various builds.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/146280043
2014-09-24 17:50:44 -04:00
Russ Cox
117a6973cb build: fix elf builds
Corrections due to new strict type rules for data+bss.
Also disable misc/cgo/cdefstest since you can't compile C code anymore.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/148050044
2014-09-24 14:45:11 -07:00
Russ Cox
193daab988 cmd/cc, cmd/ld, runtime: disallow conservative data/bss objects
In linker, refuse to write conservative (array of pointers) as the
garbage collection type for any variable in the data/bss GC program.

In the linker, attach the Go type to an already-read C declaration
during dedup. This gives us Go types for C globals for free as long
as the cmd/dist-generated Go code contains the declaration.
(Most runtime C declarations have a corresponding Go declaration.
Both are bss declarations and so the linker dedups them.)

In cmd/dist, add a few more C files to the auto-Go-declaration list
in order to get Go type information for the C declarations into the linker.

In C compiler, mark all non-pointer-containing global declarations
and all string data as NOPTR. This allows them to exist in C files
without any corresponding Go declaration. Count C function pointers
as "non-pointer-containing", since we have no heap-allocated C functions.

In runtime, add NOPTR to the remaining pointer-containing declarations,
none of which refer to Go heap objects.

In runtime, also move os.Args and syscall.envs data into runtime-owned
variables. Otherwise, in programs that do not import os or syscall, the
runtime variables named os.Args and syscall.envs will be missing type
information.

I believe that this CL eliminates the final source of conservative GC scanning
in non-SWIG Go programs, and therefore...

Fixes #909.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/149770043
2014-09-24 16:55:26 -04:00
Russ Cox
a0785a53ad cmd/go: prohibit C sources files unless using cgo
Those C files would have been compiled with 6c.
It's close to impossible to use C correctly anymore,
and the C compilers are going away eventually.
Make them unavailable now.

go1.4.txt change in CL 145890046

LGTM=iant
R=iant
CC=golang-codereviews, r
https://golang.org/cl/149720043
2014-09-24 15:10:38 -04:00
Russ Cox
6f219e8b84 runtime: fix LastGC comment
I have no idea what "absolute time" means.

LGTM=dvyukov, r
R=r, dvyukov
CC=golang-codereviews
https://golang.org/cl/144320043
2014-09-24 14:18:25 -04:00
Hector Martin Cantero
7283e08cbf runtime: keep g->syscallsp consistent after cgo->Go callbacks
Normally, the caller to runtime.entersyscall() must not return before
calling runtime.exitsyscall(), lest g->syscallsp become a dangling
pointer. runtime.cgocallbackg() violates this constraint. To work around
this, save g->syscallsp and g->syscallpc around cgo->Go callbacks, then
restore them after calling runtime.entersyscall(), which restores the
syscall stack frame pointer saved by cgocall. This allows the GC to
correctly trace a goroutine that is currently returning from a
Go->cgo->Go chain.

This also adds a check to proc.c that panics if g->syscallsp is clearly
invalid. It is not 100% foolproof, as it will not catch a case where the
stack was popped then pushed back beyond g->syscallsp, but it does catch
the present cgo issue and makes existing tests fail without the bugfix.

Fixes #7978.

LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, minux, bradfitz, iant, gobot, rsc
CC=golang-codereviews, rsc
https://golang.org/cl/131910043
2014-09-24 13:20:25 -04:00
Dave Cheney
c486d4130d runtime: fix runtime.Breakpoint on ARMv5
Fixes #8775.

Use the illegal instruction suggested by Ian in https://golang.org/cl/144180043/#msg4 on all arm arches.

LGTM=minux
R=golang-codereviews, gobot, rsc
CC=golang-codereviews, iant, minux
https://golang.org/cl/146130043
2014-09-23 15:34:38 +10:00
Dmitriy Vyukov
dcb594ec30 runtime: remove unused function declaration
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/145970043
2014-09-22 19:51:53 -07:00
Keith Randall
3b2577ced3 runtime: be very careful with bad pointer tests
Saw this on a test:

runtime: bad pointer in frame runtime_test.testSetPanicOnFault at 0xc20801c6b0: 0xfff
fatal error: bad pointer!

runtime stack:
...
copystack(0xc2081bf7a0, 0x1000)
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/stack.c:621 +0x173 fp=0xfffffd7ffd5ffee0 sp=0xfffffd7ffd5ffe20
runtime.newstack()
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/stack.c:774 +0x552 fp=0xfffffd7ffd5fff90 sp=0xfffffd7ffd5ffee0
runtime.morestack()
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/asm_amd64.s:324 +0x90 fp=0xfffffd7ffd5fff98 sp=0xfffffd7ffd5fff90

goroutine 163354 [stack growth]:
...
runtime.convT2E(0x587000, 0xc20807bea8, 0x0, 0x0)
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/iface.go:141 +0xd2 fp=0xc20801c678 sp=0xc20801c640
runtime_test.testSetPanicOnFault(0xc20822c510, 0xfff, 0xc20801c748)
        /root/work/solaris-amd64-smartos-2dde8b453d26/go/src/runtime/runtime_test.go:211 +0xc6 fp=0xc20801c718 sp=0xc20801c678
...

This test is testing bad pointers.  It loads the bad pointer into a pointer variable,
but before it gets a chance to dereference it, calls convT2E.  That call causes a stack copy,
which exposes that live but bad pointer variable.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews
https://golang.org/cl/146880043
2014-09-20 23:31:11 -07:00
Keith Randall
0306478fe5 runtime: Fix interaction between Goexit and defers
When running defers, we must check whether the defer
has already been marked as started so we don't run it twice.

Fixes #8774.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/142280044
2014-09-19 16:33:14 -07:00
Russ Cox
5c795632d6 runtime: add runtime· prefix to some static variables
Pure renaming. This will make an upcoming CL have smaller diffs.

LGTM=dvyukov, iant
R=iant, dvyukov
CC=golang-codereviews
https://golang.org/cl/142280043
2014-09-19 13:51:23 -04:00
Russ Cox
c7f6bd795a runtime: rename SchedType to SchedT
CL 144940043 renamed it from Sched to SchedType
to avoid a lowercasing conflict in the Go code with
the variable named sched.
We've been using just T resolve those conflicts, not Type.

The FooType pattern is already taken for the kind-specific
variants of the runtime Type structure: ChanType, MapType,
and so on. SchedType isn't a Type.

LGTM=bradfitz, khr
R=khr, bradfitz
CC=golang-codereviews
https://golang.org/cl/145180043
2014-09-18 23:51:22 -04:00
Russ Cox
88d53ddb17 runtime: release Windows thread handle in unminit
Fixes #8517.

LGTM=dvyukov, alex.brainman
R=golang-codereviews, dvyukov, alex.brainman
CC=golang-codereviews
https://golang.org/cl/145890044
2014-09-18 22:33:49 -04:00
Dave Cheney
66795e8ba1 runtime: fix GOARM<7 build
Update #8690

If liblink determines that the host doesn't support TLS it replaces the MRC call with a BL runtime.tls_read_fallback. The problem is save_g doesn't expect anyone to make any BL calls and hasn't setup its own link register properly so when runtime.tls_read_fallback returns the LR points to save_g, not save_g's caller so the RET at the end of the function turns into an infinite loop.

This fix is only a proof of concept, I think the real fix should go into liblink as its MRC substitution is not as transparent as expected.

LGTM=rsc
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/143050043
2014-09-19 02:02:21 +00:00
Russ Cox
5fdea3430a runtime: revise TestSetPanicOnFault
We can't assume all those addresses are unmapped.
But at least one should be.

What we're really testing is that the program doesn't crash.

Fixes #8542.

LGTM=iant
R=golang-codereviews, iant, minux
CC=golang-codereviews
https://golang.org/cl/144120043
2014-09-18 21:43:09 -04:00
Alex Brainman
2ed209eaf5 runtime: allow OutputDebugString to be sent to debugger
We mark DBG_PRINTEXCEPTION_C messages in VEH handler
as handled, thus preventing debugger from seeing them.
I don't see reason for doing that. The comment warns
of crashes, but I added test and don't see any crashes.

This is also simplify VEH handler before making
changes to fix issue 8006.

Update #8006

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/146800043
2014-09-19 11:38:48 +10:00
Alex Brainman
f8474fa01d runtime: remove useless code around of EXCEPTION_BREAKPOINT
This is to simplify VEH handler before making
changes to fix issue 8006.

Update #8006

LGTM=adg, rsc
R=golang-codereviews, adg, rsc
CC=golang-codereviews
https://golang.org/cl/138630043
2014-09-19 11:14:51 +10:00
Russ Cox
048692e5de runtime: fix Windows SysUsed
Same fix as for SysUnused.
Fixes #8038.

LGTM=iant, alex.brainman
R=golang-codereviews, iant, alex.brainman
CC=golang-codereviews
https://golang.org/cl/147820043
2014-09-18 20:41:00 -04:00
Russ Cox
54245cba1f runtime: show frames for exported runtime functions
The current Windows build failure happens because by
default runtime frames are excluded from stack traces.
Apparently the Windows breakpoint path dies with an
ordinary panic, while the Unix path dies with a throw.
Breakpoint is a strange function and I don't mind that it's
a little different on the two operating systems.

The panic squelches runtime frames but the throw shows them,
because throw is considered something that shouldn't have
happened at all, so as much detail as possible is wanted.

The runtime exclusion is meant to prevents printing too much noise
about internal runtime details. But exported functions are
not internal details, so show exported functions.
If the program dies because you called runtime.Breakpoint,
it's okay to see that frame.
This makes the Breakpoint test show Breakpoint in the
stack trace no matter how it is handled.

Should fix Windows build.
Tested on Unix by changing Breakpoint to fault instead
of doing a breakpoint.

TBR=brainman
CC=golang-codereviews
https://golang.org/cl/143300043
2014-09-18 20:35:36 -04:00
David du Colombier
45143aeca4 runtime: fix handling of GOTRACEBACK
Since CL 130990043, the GOTRACEBACK variable is
only used when the GODEBUG variable is set.
This change restores the original behavior.

LGTM=rsc
R=golang-codereviews, aram, gobot, r, rsc
CC=golang-codereviews
https://golang.org/cl/132520043
2014-09-18 23:25:11 +02:00
Russ Cox
c3b5db895b runtime: delete panicstring; move its checks into gopanic
In Go 1.3 the runtime called panicstring to report errors like
divide by zero or memory faults. Now we call panic (gopanic)
with pre-allocated error values. That new path is missing the
checking that panicstring did, so add it there.

The only call to panicstring left is in cnew, which is problematic
because if it fails, probably the heap is corrupt. In that case,
calling panicstring creates a new errorCString (no allocation there),
but then panic tries to print it, invoking errorCString.Error, which
does a string concatenation (allocating), which then dies.
Replace that one panicstring with a throw: cnew is for allocating
runtime data structures and should never ask for an inappropriate
amount of memory.

With panicstring gone, delete newErrorCString, errorCString.
While we're here, delete newErrorString, not called by anyone.
(It can't be: that would be C code calling Go code that might
block or grow the stack.)

Found while debugging a malloc corruption.
This resulted in 'panic during panic' instead of a more useful message.

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/138290045
2014-09-18 14:49:24 -04:00
Dmitriy Vyukov
ed7db89b90 runtime: output number of goroutines in GC trace
Example output:
gc26(1): 1+0+1038+0 us, 0 -> 1 MB, 19074 (88777-69703) objects, 5 gs, 184/0/0 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields
It's useful to understand long scan times,
because goroutine traceback is slow.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, rsc
https://golang.org/cl/136310044
2014-09-17 20:38:50 -07:00
Keith Randall
92eb1e1600 runtime: free stacks of Gdead goroutines at GC time
We could probably free the G structures as well, but
for the allg list.  Leaving that for another day.

Fixes #8287

LGTM=rsc
R=golang-codereviews, dvyukov, khr, rsc
CC=golang-codereviews
https://golang.org/cl/145010043
2014-09-17 13:25:46 -07:00
Russ Cox
6fb9d50d15 runtime: print more detail in adjustframe crash
The logic here is copied from mgc0.c's scanframe.
Mostly it is messages although the minsize code is new
(and I believe necessary).

I am hoping to get more information about the current
arm build failures (or, if it's the minsize thing, fix them).

TBR=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/143180043
2014-09-17 16:12:17 -04:00
Russ Cox
e19d8a47d1 runtime: account for tiny allocs, for testing.AllocsPerRun
Fixes #8734.

LGTM=r, bradfitz, dvyukov
R=bradfitz, r, dvyukov
CC=golang-codereviews, iant, khr
https://golang.org/cl/143150043
2014-09-17 14:49:32 -04:00
Keith Randall
6c934238c9 runtime: change minimum stack size to 2K.
It will be 8K on windows because it needs 4K for the OS.
Similarly, plan9 will be 4K.

On linux/amd64, reduces size of 100,000 goroutines
from ~819MB to ~245MB.

Update #7514

LGTM=dvyukov
R=golang-codereviews, dvyukov, khr, aram
CC=golang-codereviews
https://golang.org/cl/145790043
2014-09-17 08:32:15 -07:00
Dmitriy Vyukov
98a1e207e2 sync/atomic: add Value
A Value provides an atomic load and store of a consistently typed value.
It's intended to be used with copy-on-write idiom (see the example).

Performance:
BenchmarkValueRead	50000000	        21.7 ns/op
BenchmarkValueRead-2	200000000	         8.63 ns/op
BenchmarkValueRead-4	300000000	         4.33 ns/op

TBR=rsc
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/136710045
2014-09-16 19:54:26 -07:00
Keith Randall
da8cf5438a runtime: always run semacquire on the G stack
semacquire might need to park the currently running G.  It can
only park if called from the G stack (because it has no way of
saving the M stack state).  So all calls to semacquire must come
from the G stack.

The three violators are GOMAXPROCS, ReadMemStats, and WriteHeapDump.
This change moves the semacquire call earlier, out of their C code
and into their Go code.

This seldom caused bugs because semacquire seldom actually had
to park the caller.  But it did happen intermittently.

Fixes #8749

LGTM=dvyukov
R=golang-codereviews, dvyukov, bradfitz
CC=golang-codereviews
https://golang.org/cl/144940043
2014-09-16 17:26:16 -07:00
Russ Cox
4bf4d9f86e runtime: reenable TestStackGrowth on 32-bit systems
If this needs to be turned back off, it should be done
just before the '// in finalizer' comment, not at the top
of the function.

GC is more precise now than it was (the only imprecise
stuff left is some global variables), so maybe the finalizer
test will work now on 32-bit systems.

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/144030043
2014-09-16 17:46:25 -04:00
Russ Cox
653fb6d872 liblink: make GO_ARGS the default for functions beginning with ·
If there is a leading ·, assume there is a Go prototype and
attach the Go prototype information to the function.
If the function is not called from Go and does not need a
Go prototype, it can be made file-local instead (using name<>(SB)).

This fixes the current BSD build failures, by giving functions like
sync/atomic.StoreUint32 argument stack map information.

Fixes #8753.

LGTM=khr, iant
R=golang-codereviews, iant, khr, bradfitz
CC=golang-codereviews, r, rlh
https://golang.org/cl/142150043
2014-09-16 17:39:55 -04:00
Keith Randall
15274e5c9b runtime: make it clear that Goexit cannot be recover'd.
LGTM=r
R=r, bradfitz, khr
CC=golang-codereviews
https://golang.org/cl/136660044
2014-09-16 12:50:05 -07:00
Russ Cox
99e8f40488 runtime: fix 386 build
mark finalizer1 as having no pointers

TBR=iant
CC=golang-codereviews
https://golang.org/cl/141570045
2014-09-16 11:43:35 -04:00
Russ Cox
d208361cde runtime: remove uses of ScanConservatively
Along with CLs 139610043 and 141490043,
this removes all conservative scanning during
garbage collection, except _cgo_allocate,
which is SWIG-only.

LGTM=rlh, khr
R=golang-codereviews, dvyukov, rlh, khr
CC=golang-codereviews, iant
https://golang.org/cl/144860043
2014-09-16 11:09:58 -04:00
Russ Cox
fc46931442 runtime: remove untyped allocation of ParFor
Now it's two allocations. I don't see much downside to that,
since the two pieces were in different cache lines anyway.

Rename 'conservative' to 'cgo_conservative_type' and make
clear that _cgo_allocate is the only allowed user.

This depends on CL 141490043, which removes the other
use of conservative (in defer).

LGTM=dvyukov, iant
R=khr, dvyukov, iant
CC=golang-codereviews, rlh
https://golang.org/cl/139610043
2014-09-16 11:03:11 -04:00
Russ Cox
f95beae61d runtime: use traceback to traverse defer structures
This makes the GC and the stack copying agree about how
to interpret the defer structures. Previously, only the stack
copying treated them precisely.
This removes an untyped memory allocation and fixes
at least three copystack bugs.

To make sure the GC can find the deferred argument
frame until it has been copied, keep a Defer on the defer list
during its execution.

In addition to making it possible to remove the untyped
memory allocation, keeping the Defer on the list fixes
two races between copystack and execution of defers
(in both gopanic and Goexit). The problem is that once
the defer has been taken off the list, a stack copy that
happens before the deferred arguments have been copied
back to the stack will not update the arguments correctly.
The new tests TestDeferPtrsPanic and TestDeferPtrsGoexit
(variations on the existing TestDeferPtrs) pass now but
failed before this CL.

In addition to those fixes, keeping the Defer on the list
helps correct a dangling pointer error during copystack.
The traceback routines walk the Defer chain to provide
information about where a panic may resume execution.
When the executing Defer was not on the Defer chain
but instead linked from the Panic chain, the traceback
had to walk the Panic chain too. But Panic structs are
on the stack and being updated by copystack.
Traceback's use of the Panic chain while copystack is
updating those structs means that it can follow an
updated pointer and find itself reading from the new stack.
The new stack is usually all zeros, so it sees an incorrect
early end to the chain. The new TestPanicUseStack makes
this happen at tip and dies when adjustdefers finds an
unexpected argp. The new StackCopyPoison mode
causes an earlier bad dereference instead.
By keeping the Defer on the list, traceback can avoid
walking the Panic chain at all,  making it okay for copystack
to update the Panics.

We'd have the same problem for any Defers on the stack.
There was only one: gopanic's dabort. Since we are not
taking the executing Defer off the chain, we can use it
to do what dabort was doing, and then there are no
Defers on the stack ever, so it is okay for traceback to use
the Defer chain even while copystack is executing:
copystack cannot modify the Defer chain.

LGTM=khr
R=khr
CC=dvyukov, golang-codereviews, iant, rlh
https://golang.org/cl/141490043
2014-09-16 10:36:38 -04:00
Russ Cox
d2574e2adb runtime: remove duplicated Go constants
The C header files are the single point of truth:
every C enum constant Foo is available to Go as _Foo.
Remove or redirect duplicate Go declarations so they
cannot be out of sync.

Eventually we will need to put constants in Go, but for now having
them be out of sync with C is too risky. These predate the build
support for auto-generating Go constants from the C definitions.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/141510043
2014-09-16 10:22:15 -04:00