summaryrefslogtreecommitdiff
path: root/src/runtime
Commit message (Collapse)AuthorAgeFilesLines
* [dev.garbage] all: merge dev.cc (81884b89bd88) into dev.garbageRuss Cox2014-12-0531-461/+1653
|\ | | | | | | | | | | TBR=rlh CC=golang-codereviews https://codereview.appspot.com/181100044
| * [dev.garbage] all: merge dev.cc (493ad916c3b1) into dev.garbageRuss Cox2014-11-24135-4065/+4013
| |\ | | | | | | | | | | | | | | | TBR=austin CC=golang-codereviews https://codereview.appspot.com/179290043
| * | [dev.garbage] runtime: Stop running gs during the GCscan phase.Rick Hudson2014-11-213-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that all gs are in a scan state when their stacks are being scanned. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/179160044
| * | [dev.garbage] runtime: add prefetcht0, prefetcht1, prefetcht2, prefetcht3, ↵Russ Cox2014-11-217-1/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prefetchnta for GC We don't know what we need yet, so add them all. Add them even on x86 architectures (as no-ops) so that the GC can refer to them unconditionally. Eventually we'll know what we want and probably have just one 'prefetch' with an appropriate meaning on each architecture. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/179160043
| * | [dev.garbage] runtime: Fix constant overflow on 32 bit machinesRick Hudson2014-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=golang-codereviews CC=golang-codereviews, rsc https://codereview.appspot.com/180040043
| * | [dev.garbage] runtime: Turn concurrent GC on by default. Avoid write ↵Rick Hudson2014-11-208-63/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | barriers for GC internal structures such as free lists. LGTM=rsc R=rsc CC=golang-codereviews, rsc https://codereview.appspot.com/179000043
| * | [dev.garbage] all: merge dev.cc (723ca3789b88) into dev.garbageRuss Cox2014-11-1625-401/+1475
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Brings in Linux time signature fixes. Should fix build. TBR=austin CC=golang-codereviews https://codereview.appspot.com/176870043
| | * \ [dev.garbage] all: merge dev.cc into dev.garbageRuss Cox2014-11-15308-26208/+21971
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The garbage collector is now written in Go. There is plenty to clean up (just like on dev.cc). all.bash passes on darwin/amd64, darwin/386, linux/amd64, linux/386. TBR=rlh R=austin, rlh, bradfitz CC=golang-codereviews https://codereview.appspot.com/173250043
| | * \ \ [dev.garbage] all: merge dev.power64 (7667e41f3ced) into dev.garbageRuss Cox2014-11-146-33/+41
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the only difference between dev.cc and dev.garbage is the runtime conversion on the one side and the garbage collection on the other. They both have the same set of changes from default and dev.power64. LGTM=austin R=austin CC=golang-codereviews https://codereview.appspot.com/172570043
| | * \ \ \ [dev.garbage] all: merge default (f38460037b72) into dev.garbageRuss Cox2014-11-1481-790/+4236
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the revision that dev.cc is branched from. LGTM=austin R=austin CC=golang-codereviews https://codereview.appspot.com/169590043
| | | * | | | [dev.garbage] runtime: Add write barriers to c codeRick Hudson2014-11-1211-2/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also improve missing GC mark diagnostics. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/169450043
| | | * | | | [dev.garbage] runtime: concurrent mark fixesRuss Cox2014-11-115-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing write barrier when initializing state for newly created goroutine. Add write barrier for same slot when preempting a goroutine. Disable write barrier during goroutine death, because dopanic does pointer writes. With concurrent mark enabled (not in this CL), all.bash passed once. The second time, TestGoexitCrash-2 failed. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/167610043
| | | * | | | [dev.garbage] runtime: add write barrier to caspRuss Cox2014-11-1011-30/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also rewrite some casp that don't use real pointers to use casuintptr instead. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/166440044
| | | * | | | [dev.garbage] runtime: Coarsen the write barrier to always grey the destination.Rick Hudson2014-11-101-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/174820043
| | | * | | | [dev.garbage] runtime: Code to implement write barriersRick Hudson2014-11-105-16/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To turn concurrent gc on alter the if false in func gogc currently at line 489 in malloc.go LGTM=rsc R=rsc CC=golang-codereviews, rlh https://codereview.appspot.com/172190043 Committer: Russ Cox <rsc@golang.org>
| | | * | | | [dev.garbage] cmd/gc, runtime: add locks around print statementsRuss Cox2014-11-052-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now each C printf, Go print, or Go println is guaranteed not to be interleaved with other calls of those functions. This should help when debugging concurrent failures. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/169120043
| | | * | | | [dev.garbage] runtime: ignore objects in dead spansRuss Cox2014-11-051-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We still don't know why this is happening. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/169990043
| | | * | | | [dev.garbage] runtime: fix a few checkmark bugsRuss Cox2014-11-051-35/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Some sequencing issues with stopping the first gc_m round at the right place to set up correctly for the second round. - atomicxor8 is not idempotent; avoid xor. - Maintain BitsDead type bits correctly; see long comment added. - Enable checkmark phase by default for now. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/171090043
| | | * | | | [dev.garbage] runtime: fix 32-bit buildRuss Cox2014-11-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TBR=crawshaw R=crawshaw CC=golang-codereviews https://codereview.appspot.com/168860046
| | | * | | | [dev.garbage] runtime: Add gc mark verification pass.Rick Hudson2014-11-046-143/+382
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an independent mark phase to the GC that can be used to verify the the default concurrent mark phase has found all reachable objects. It uses the upper 2 bits of the boundary nibble to encode the mark leaving the lower bits to encode the boundary and the normal mark bit. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/167130043
| | | * | | | [dev.garbage] cmd/gc, runtime: implement write barriers in terms of ↵Russ Cox2014-10-305-24/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writebarrierptr This CL implements the many multiword write barriers by calling writebarrierptr, so that only writebarrierptr needs the actual barrier. In lieu of an actual barrier, writebarrierptr checks that the value being copied is not a small non-zero integer. This is enough to shake out bugs where the barrier is being called when it should not (for non-pointer values). It also found a few tests in sync/atomic that were being too clever. This CL adds a write barrier for the memory moved during the builtin copy function, which I forgot when inserting barriers for Go 1.4. This CL re-enables some write barriers that were disabled for Go 1.4. Those were disabled because it is possible to change the generated code so that they are unnecessary most of the time, but we have not changed the generated code yet. For safety they must be enabled. None of this is terribly efficient. We are aiming for correct first. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/168770043
| | | * | | | [dev.garbage] all: merge dev.power64 (5ad5e85cfb99) into dev.garbageRuss Cox2014-10-2954-252/+2560
| | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal here is to get the big-endian fixes so that in some upcoming code movement for write barriers I don't make them unmergeable. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/166890043
| | | * \ \ \ \ [dev.garbage] all: merge default (dd5014ed9b01) into dev.garbageRuss Cox2014-10-2914-429/+727
| | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/170730043
| | | | * | | | | [dev.garbage] runtime: Fix 386 compiler warnings.Rick Hudson2014-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/163390043
| | | | * | | | | [dev.garbage] runtime: fix TestLFStack on 386Russ Cox2014-10-273-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rlh R=rlh, dvyukov CC=golang-codereviews https://codereview.appspot.com/157430044
| | | | * | | | | [dev.garbage] runtime: Concurrent scan codeRick Hudson2014-10-248-127/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Routines and logic to preform a concurrent stack scan of go-routines. This CL excersizes most of the functionality needed. The major exception being that it does not scan running goroutines. After doing the scans it relies on a STW to finish the GC, including rescanning the stacks. It is intended to achieve correctness, performance will follow. LGTM=rsc R=golang-codereviews, rsc CC=dvyukov, golang-codereviews https://codereview.appspot.com/156580043
| | | | * | | | | [dev.garbage] runtime: simplifiy lfstack.c due to undiagnosed buffer corruption.Rick Hudson2014-10-232-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes got rid of the problems we were seeing. We suspect the pushcnt field has a race. LGTM=rsc R=dvyukov, rsc CC=golang-codereviews https://codereview.appspot.com/159330043 Committer: Russ Cox <rsc@golang.org>
| | | | * | | | | all: merge default branch into dev.garbageRuss Cox2014-10-1626-295/+558
| | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hg was unable to create a CL on the code review server for this, so I am submitting the merge by hand. The only manual edits are in mgc0.c, to reapply the removal of cached/ncached to the new code.
| | | | * | | | | | [dev.garbage] runtime: Write barrier code.Rick Hudson2014-10-141-16/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comments lay out the concurrent GC algorithms. This CL implements parts of the algorithm. The acknowledgement code has been removed from this CL LGTM=rsc, dvyukov R=dvyukov, rsc CC=golang-codereviews https://codereview.appspot.com/151540043
| | | | * | | | | | [dev.garbage] all: merge default into dev.garbageRuss Cox2014-10-062-17/+33
| | | | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This picks up the TestDualStackUDPListener fix. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/147660044
| | | | * \ \ \ \ \ \ [dev.garbage] all: merge default into dev.garbageRuss Cox2014-10-067-272/+410
| | | | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This picks up the selectdone dangling pointer fix, among others. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/153070045
| | | | | * \ \ \ \ \ \ [dev.garbage] merge default into dev.garbageRuss Cox2014-10-0372-529/+759
| | | | | |\ \ \ \ \ \ \
| | | | | * | | | | | | | [dev.garbage] runtime: scan and mark phase refactoringRick Hudson2014-10-034-263/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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://codereview.appspot.com/145640044 Committer: Russ Cox <rsc@golang.org>
| | | | | * | | | | | | | [dev.garbage] runtime: make sure G.param and SudoG.elem do not hold stale ↵Russ Cox2014-10-024-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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://codereview.appspot.com/147480043
| | | | | * | | | | | | | [dev.garbage] runtime: remove another BitsMultiWordRuss Cox2014-10-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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://codereview.appspot.com/148430043
* | | | | | | | | | | | | [dev.cc] all: merge default (8d42099cdc23) into dev.ccdev.ccRuss Cox2014-12-052-7/+24
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TBR=austin CC=golang-codereviews https://codereview.appspot.com/178700044
| * | | | | | | | | | | | | runtime: fix hang in GC due to shrinkstack vs netpoll raceRuss Cox2014-12-013-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During garbage collection, after scanning a stack, we think about shrinking it to reclaim some memory. The shrinking code (called while the world is stopped) checked that the status was Gwaiting or Grunnable and then changed the state to Gcopystack, to essentially lock the stack so that no other GC thread is scanning it. The same locking happens for stack growth (and is more necessary there). oldstatus = runtime?readgstatus(gp); oldstatus &= ~Gscan; if(oldstatus == Gwaiting || oldstatus == Grunnable) runtime?casgstatus(gp, oldstatus, Gcopystack); // oldstatus is Gwaiting or Grunnable else runtime?throw("copystack: bad status, not Gwaiting or Grunnable"); Unfortunately, "stop the world" doesn't stop everything. It stops all normal goroutine execution, but the network polling thread is still blocked in epoll and may wake up. If it does, and it chooses a goroutine to mark runnable, and that goroutine is the one whose stack is shrinking, then it can happen that between readgstatus and casgstatus, the status changes from Gwaiting to Grunnable. casgstatus assumes that if the status is not what is expected, it is a transient change (like from Gwaiting to Gscanwaiting and back, or like from Gwaiting to Gcopystack and back), and it loops until the status has been restored to the expected value. In this case, the status has changed semi-permanently from Gwaiting to Grunnable - it won't change again until the GC is done and the world can continue, but the GC is waiting for the status to change back. This wedges the program. To fix, call a special variant of casgstatus that accepts either Gwaiting or Grunnable as valid statuses. Without the fix bug with the extra check+throw in casgstatus, the program below dies in a few seconds (2-10) with GOMAXPROCS=8 on a 2012 Retina MacBook Pro. With the fix, it runs for minutes and minutes. package main import ( "io" "log" "net" "runtime" ) func main() { const N = 100 for i := 0; i < N; i++ { l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { log.Fatal(err) } ch := make(chan net.Conn, 1) go func() { var err error c1, err := net.Dial("tcp", l.Addr().String()) if err != nil { log.Fatal(err) } ch <- c1 }() c2, err := l.Accept() if err != nil { log.Fatal(err) } c1 := <-ch l.Close() go netguy(c1, c2) go netguy(c2, c1) c1.Write(make([]byte, 100)) } for { runtime.GC() } } func netguy(r, w net.Conn) { buf := make([]byte, 100) for { bigstack(1000) _, err := io.ReadFull(r, buf) if err != nil { log.Fatal(err) } w.Write(buf) } } var g int func bigstack(n int) { var buf [100]byte if n > 0 { bigstack(n - 1) } g = int(buf[0]) + int(buf[99]) } Fixes issue 9186. LGTM=rlh R=austin, rlh CC=dvyukov, golang-codereviews, iant, khr, r https://codereview.appspot.com/179680043
* | | | | | | | | | | | | | [dev.cc] runtime: convert dragonfly/386 port to GoJoel Sing2014-11-253-59/+78
| |_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc, bradfitz CC=golang-codereviews https://codereview.appspot.com/178210043
* | | | | | | | | | | | | [dev.cc] runtime: convert netbsd/386 port to GoJoel Sing2014-11-225-45/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=minux R=rsc, minux CC=golang-codereviews https://codereview.appspot.com/177170043
* | | | | | | | | | | | | [dev.cc] runtime: convert netbsd/amd64 port to GoJoel Sing2014-11-2212-511/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/169620043
* | | | | | | | | | | | | [dev.cc] runtime: migrate Android/ARM port to Go.Shenghou Ma2014-11-215-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I tested building Go itself, but not any of go.mobile tests. LGTM=crawshaw R=crawshaw, rsc CC=golang-codereviews https://codereview.appspot.com/179110043
* | | | | | | | | | | | | [dev.cc] runtime: explicitly exclude android in zgoos_linux.goShenghou Ma2014-11-2112-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise both zgoos_linux.go and zgoos_android.go will be compiled for GOOS=android. LGTM=crawshaw, rsc R=rsc, crawshaw CC=golang-codereviews https://codereview.appspot.com/178110043
* | | | | | | | | | | | | [dev.cc] runtime: convert Plan 9 port to GoDavid du Colombier2014-11-2118-923/+756
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Aram H?v?rneanu, Nick Owens and Russ Cox for the early reviews. LGTM=aram, rsc R=rsc, lucio.dere, aram, ality CC=golang-codereviews, mischief https://codereview.appspot.com/175370043
* | | | | | | | | | | | | [dev.cc] runtime: convert nacl support to GoRuss Cox2014-11-2120-767/+562
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=dave R=minux, dave CC=golang-codereviews https://codereview.appspot.com/181030043
* | | | | | | | | | | | | [dev.cc] runtime: windows does not use _cgo_setenv and _cgo_unsetenvAlex Brainman2014-11-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/175480043
* | | | | | | | | | | | | [dev.cc] runtime: fix windows goenvs conversion mistakeAlex Brainman2014-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uint16 occupies 2 bytes, not 1 LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/178100043
* | | | | | | | | | | | | [dev.cc] all: merge default (e4ab8f908aac) into dev.ccRuss Cox2014-11-20358-26658/+25075
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TBR=austin CC=golang-codereviews https://codereview.appspot.com/179040044
| * | | | | | | | | | | | [dev.cc] runtime: convert remaining windows C code to GoAlex Brainman2014-11-2012-984/+853
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/177090043
| * | | | | | | | | | | | [dev.cc] runtime: add explicit siginfo.si_addr fieldAustin Clements2014-11-199-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct siginfo_t's si_addr field is part of a union. Previously, we represented this union in Go using an opaque byte array and accessed the si_addr field using unsafe (and wrong on 386 and arm!) pointer arithmetic. Since si_addr is the only field we use from this union, this replaces the opaque byte array with an explicit declaration of the si_addr field and accesses it directly. LGTM=minux, rsc R=rsc, minux CC=golang-codereviews https://codereview.appspot.com/179970044
| * | | | | | | | | | | | [dev.cc] runtime: decode power64 branch instructions the way the CPU doesAustin Clements2014-11-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, this used the top 8 bits of an instruction as a sort-of opcode and ignored the top two bits of the relative PC. This worked because these jumps are always negative and never big enough for the top two bits of the relative PC (also the bottom 2 bits of the sort-of opcode) to be anything other than 0b11, but the code is confusing because it doesn't match the actual structure of the instruction. Instead, use the real 6 bit opcode and use all 24 bits of relative PC. LGTM=rsc R=rsc, dave CC=golang-codereviews https://codereview.appspot.com/179960043