summaryrefslogtreecommitdiff
path: root/src/pkg/runtime
AgeCommit message (Collapse)AuthorFilesLines
2010-05-03runtime: update godefs usage comment for GOARCH=386 GOOS={darwin,freebsd}Giles Lean4-4/+4
When trying to regenerate src/pkg/runtime/darwin/386/defs.h on a 64 bit capable Snow Leopard (OS X 10.6.3) system I needed to add -f -m32 to godefs, as this OS and hardware combination defaults to 64 bit compilation. For safety, make the same change to the 32 bit FreeBSD instructions in .../freebsd/defs.c. (Tested OK and no problems introduced.) R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/1052042 Committer: Russ Cox <rsc@golang.org>
2010-05-01gc: be pickier about slice, chan, array, and map sizesRuss Cox4-16/+25
Fixes issue 589. R=ken2 CC=golang-dev http://codereview.appspot.com/1032044
2010-04-29rename GOOS=mingw to GOOS=windowsAlex Brainman13-11/+11
R=rsc, Joe Poirier CC=golang-dev http://codereview.appspot.com/1015043 Committer: Russ Cox <rsc@golang.org>
2010-04-28darwin: bsdthread_create can fail; print good errorRuss Cox4-6/+11
Fixes issue 549. R=adg CC=golang-dev http://codereview.appspot.com/1019042
2010-04-275l, 6l, 8l, runtime: make -s binaries workRuss Cox1-17/+8
5l, 6l, 8l: change ELF header so that strip doesn't destroy binary Fixes issue 261. R=iant, r CC=golang-dev http://codereview.appspot.com/994044
2010-04-22runtime: closures, defer bug fix for Native ClientRuss Cox6-14/+299
Enable package tests for Native Client build. R=r CC=golang-dev http://codereview.appspot.com/957042
2010-04-21runtime: switch state back to Grunning after recoveryRuss Cox2-2/+3
Fixes issue 733. R=r CC=golang-dev http://codereview.appspot.com/958041
2010-04-20runtime: rename cgo2c, *.cgo to goc2c, *.gocRuss Cox10-4/+4
to avoid confusion with real cgo R=r CC=golang-dev http://codereview.appspot.com/904046
2010-04-15support for printing floats:Kai Backman3-17/+400
fmt.Printf("float32 %f\n", float32(1234.56789)) fmt.Printf("float64 %f\n", float64(1234.56789)) -> float32 1234.567871 float64 1234.567890 this is a snapshot. extended instruction support, corner cases and fixes coming in subseuent cls. R=rsc CC=dpx, golang-dev http://codereview.appspot.com/876045
2010-04-13runtime: better trace for fault due to nil pointer callRuss Cox7-20/+72
R=r CC=golang-dev http://codereview.appspot.com/854048
2010-04-09runtime: delete malx, skip_depth argument to mallocRuss Cox8-28/+21
remove internal functions from traces in gopprof instead. R=r CC=golang-dev http://codereview.appspot.com/855046
2010-04-09Run initcgo for all amd64 targets, not just GNU/Linux.Ian Lance Taylor2-8/+8
This is required to make cgo export work on Darwin. Note that this corrects the stack alignment when calling initcgo to that required by gcc on amd64. R=rsc CC=golang-dev http://codereview.appspot.com/907041
2010-04-09Library support for cgo export.Ian Lance Taylor5-5/+116
These functions are used to call from a C function back to a Go function. This only includes 386 support. R=rsc CC=golang-dev http://codereview.appspot.com/834045
2010-04-09Support cgo export on amd64.Ian Lance Taylor1-6/+42
R=rsc CC=golang-dev http://codereview.appspot.com/857045
2010-04-08runtime: fix build (panic) for FreeBSDRuss Cox7-9/+101
R=adg CC=golang-dev http://codereview.appspot.com/867046
2010-04-08runtime: turn divide by zero, nil dereference into panicsRuss Cox27-70/+759
tested on linux/amd64, linux/386, linux/arm, darwin/amd64, darwin/386. freebsd untested; will finish in a separate CL. for now all the panics are errorStrings. richer structures can be added as necessary once the mechanism is shaked out. R=r CC=golang-dev http://codereview.appspot.com/906041
2010-04-08runtime: fix bad status throwRuss Cox3-3/+11
when garbage collector sees recovering goroutine Fixes issue 711. R=r CC=golang-dev http://codereview.appspot.com/869045
2010-04-08runtime: work around kernel bug in Snow Leopard signal handlingRuss Cox2-63/+22
Could not take a signal on threads other than the main thread. If you look at the spinning binary with dtrace, you can see a fault happening over and over: $ dtrace -n ' fbt::user_trap:entry /execname=="boot32" && self->count < 10/ { self->count++; printf("%s %x %x %x %x", probefunc, arg1, arg2, arg3, arg4); stack(); tracemem(arg4, 256); }' dtrace: description 'fbt::user_trap:entry ' matched 1 probe CPU ID FUNCTION:NAME 1 17015 user_trap:entry user_trap 0 10 79af0a0 79af0a0 mach_kernel`lo_alltraps+0x12a 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 0: 0e 00 00 00 37 00 00 00 00 00 00 00 1f 00 00 00 ....7........... 10: 1f 00 00 00 a8 33 00 00 00 00 00 01 00 00 00 00 .....3.......... 20: 98 ba dc fe 07 09 00 00 00 00 00 00 98 ba dc fe ................ 30: 06 00 00 00 0d 00 00 00 34 00 00 00 9e 1c 00 00 ........4....... 40: 17 00 00 00 00 02 00 00 ac 30 00 00 1f 00 00 00 .........0...... 50: 00 00 00 00 00 00 00 00 0d 00 00 00 e0 e6 29 00 ..............). 60: 34 00 00 00 00 00 00 00 9e 1c 00 00 00 00 00 00 4............... 70: 17 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 ................ 80: ac 30 00 00 00 00 00 00 1f 00 00 00 00 00 00 00 .0.............. 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0: 48 00 00 00 10 00 00 00 85 00 00 00 a0 f2 29 00 H.............). b0: 69 01 00 02 00 00 00 00 e6 93 04 82 ff 7f 00 00 i............... c0: 2f 00 00 00 00 00 00 00 06 02 00 00 00 00 00 00 /............... d0: 78 ee 42 01 01 00 00 00 1f 00 00 00 00 00 00 00 x.B............. e0: 00 ed 9a 07 00 00 00 00 00 00 00 00 00 00 00 00 ................ f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... The memory dump shows a 32-bit exception frame: x86_saved_state32 gs = 0x37 fs = 0 es = 0x1f ds = 0x1f edi = 0x33a8 esi = 0x01000000 ebp = 0 cr2 = 0xfedcba98 ebx = 0x0907 edx = 0 ecx = 0xfedcba98 eax = 0x06 trapno = 0x0d err = 0x34 eip = 0x1c9e cs = 0x17 efl = 0x0200 uesp = 0x30ac ss = 0x1f The cr2 of 0xfedcba98 is the address that the new thread read to cause the fault, but note that the trap is now a GP fault with error code 0x34, meaning it's moved past the cr2 problem and on to an invaild segment selector. The 0x34 is suspiciously similar to the 0x37 in gs, and sure enough, OS X forces gs to have that value in the signal handler, and if your thread hasn't set up that segment (known as USER_CTHREAD), you'll fault on the IRET into the signal handler and never be able to handle a signal. The kernel bug is that it forces segment 0x37 without making sure it is a valid segment. Leopard also forced 0x37 but had the courtesy to set it up first. Since OS X requires us to set up that segment (using the thread_fast_set_cthread_self system call), we might as well use it instead of the more complicated i386_set_ldt call to set up our per-OS thread storage. Also add some more zeros to bsdthread_register for new arguments in Snow Leopard (apparently unnecessary, but being careful). Fixes issue 510. R=r CC=golang-dev http://codereview.appspot.com/824046
2010-04-07runtime: use explicit flag when finalizer goroutine is waitingRuss Cox1-1/+6
Avoids spurious wakeups during other sleeping by that goroutine. Fixes issue 711. R=r CC=golang-dev http://codereview.appspot.com/902041
2010-04-06another try at clearingKen Thompson1-9/+6
channel recv data. R=rsc CC=golang-dev http://codereview.appspot.com/896041
2010-04-06change channel read to clearKen Thompson1-3/+12
data just read from the channel. this will make it easier to recognize when to garbage collect and finalize. R=rsc CC=golang-dev http://codereview.appspot.com/882043
2010-04-06runtime: two proc bug fixesRuss Cox1-6/+13
1. Fix bug in GOMAXPROCS when trying to cut number of procs Race could happen on any system but was manifesting only on Xen hosted Linux. 2. Fix recover on ARM, where FP != caller SP. R=r CC=golang-dev http://codereview.appspot.com/880043
2010-04-05runtime: fix CallerRuss Cox1-1/+1
log: add test of Caller New regexp in log test is picky and will require some maintenance, but it catches off-by-one mistakes too. Fixes issue 710. R=gri CC=esko.luontola, golang-dev http://codereview.appspot.com/887043
2010-04-05runtime: handle malloc > 2GB correctlyRuss Cox4-18/+18
R=ken2 CC=golang-dev http://codereview.appspot.com/821048
2010-04-05runtime: various arm fixesRuss Cox28-196/+393
* correct symbol table size * do not reorder functions in output * traceback * signal handling * use same code for go + defer * handle leaf functions in symbol table R=kaib, dpx CC=golang-dev http://codereview.appspot.com/884041
2010-04-01runtime: turn run time errors checks into panicsRuss Cox8-94/+76
R=ken2, r CC=golang-dev http://codereview.appspot.com/871042 Committer: Russ Cox <rsc@golang.org>
2010-04-01runtime: correct memory leak in selectRuss Cox1-179/+125
* adds pass 3 to dequeue from channels eagerly various other cleanup/churn: * use switch on cas->send in each pass to factor out common code. * longer goto labels, commented at target * be more agressive about can't happen: throw instead of print + cope. * use "select" instead of "selectgo" in errors * use printf for debug prints when possible R=ken2, ken3 CC=golang-dev, r http://codereview.appspot.com/875041
2010-03-31runtime: make type assertion a runtime.Error, the first of manyRuss Cox9-127/+162
R=r CC=golang-dev http://codereview.appspot.com/805043
2010-03-31gc: implement panic and recoverRuss Cox3-11/+184
R=ken2, r, ken3 CC=golang-dev http://codereview.appspot.com/831042
2010-03-30runtime: fix arm build, slightly.Russ Cox1-1/+1
R=r CC=golang-dev http://codereview.appspot.com/842042
2010-03-30gc: add panic and recover (still unimplemented in runtime)Russ Cox6-20/+138
main semantic change is to enforce single argument to panic. runtime: change to 1-argument panic. use String method on argument if it has one. R=ken2, r CC=golang-dev http://codereview.appspot.com/812043
2010-03-29runtime: Remove unused runtime.write from linux/amd64Christopher Wedgwood1-17/+9
Also minor reformatting. R=rsc CC=golang-dev http://codereview.appspot.com/845041 Committer: Russ Cox <rsc@golang.org>
2010-03-29runtime: run deferred calls at GoexitRuss Cox6-52/+110
baby step toward panic+recover. Fixes issue 349. R=r CC=golang-dev http://codereview.appspot.com/825043
2010-03-29runtime: a couple more memory stats.Russ Cox7-1/+14
now runtime.MemStats.Sys really is the sum of all the other Sys fields. R=r CC=golang-dev http://codereview.appspot.com/843041
2010-03-29runtime: more malloc statisticsRuss Cox6-30/+103
expvar: default publishings for cmdline, memstats godoc: import expvar R=r CC=golang-dev http://codereview.appspot.com/815041
2010-03-26pprof: dump extra heap information at end of heap profileRuss Cox1-0/+24
R=r CC=golang-dev http://codereview.appspot.com/786041
2010-03-26runtime: run all finalizers in a single goroutine.Russ Cox7-121/+152
eliminate second pass of mark+sweep by scanning finalizer table specially. R=r CC=golang-dev http://codereview.appspot.com/782041
2010-03-24runtime: fix mingw build, implement missing destroylock()Alex Brainman1-0/+5
R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/747041 Committer: Russ Cox <rsc@golang.org>
2010-03-24runtime: malloc sampling, pprof interfaceRuss Cox9-40/+286
R=r CC=golang-dev http://codereview.appspot.com/719041
2010-03-23runtime: add memory profiling, disabled.Russ Cox11-31/+344
no way to get the data out yet. add prototype for runtime.Callers, missing from last CL. R=r CC=golang-dev http://codereview.appspot.com/713041
2010-03-23runtime: add CallersRuss Cox7-393/+121
cut copies of traceback from 6 to 1. R=r CC=golang-dev http://codereview.appspot.com/703041
2010-03-23maps access to a missing keyKen Thompson1-2/+4
will return the "zero" value R=rsc CC=golang-dev http://codereview.appspot.com/700041
2010-03-19syscall: mksyscall_mingw.sh emitting shorter calls (to Syscall or Syscall6) ↵Alex Brainman1-15/+12
when there are fewer arguments R=rsc CC=golang-dev http://codereview.appspot.com/622041 Committer: Russ Cox <rsc@golang.org>
2010-03-17Fix build: don't assume that . is on PATH.Ian Lance Taylor1-1/+1
R=rsc TBR=rsc CC=golang-dev http://codereview.appspot.com/610043
2010-03-16runtime: add GOROOT and VersionRuss Cox4-1/+52
R=r CC=golang-dev http://codereview.appspot.com/608041
2010-03-16syscall: more changes to mingw versionAlex Brainman1-8/+19
- mkall now generates syscall stabs automatically - we can call unicode versions of winapi now - introduce GetErrstr function to fetch error text given errno - general cleanup R=rsc CC=golang-dev http://codereview.appspot.com/562041 Committer: Russ Cox <rsc@golang.org>
2010-03-16gofmt: more consistent formatting of const/var declsRobert Griesemer1-3/+3
- gofmt -w src misc - only manually modified file: src/pkg/go/printer/nodes.go R=rsc CC=golang-dev, r http://codereview.appspot.com/606041
2010-03-15runtime: lock finalizer table accessesRuss Cox1-4/+18
R=r CC=golang-dev http://codereview.appspot.com/462043
2010-03-09syscall: minimal mingw version of syscall to call windows dllsAlex Brainman4-2/+47
lots of missing parts, but builds and can call dlls, see a sample code in syscall_mingw.go R=rsc CC=golang-dev http://codereview.appspot.com/218042 Committer: Russ Cox <rsc@golang.org>
2010-03-09identical complex implementationKen Thompson2-0/+37
for 6g and 8g. can also be used for 5g. 5g is still a stub. R=rsc CC=golang-dev http://codereview.appspot.com/362041