1
0
mirror of https://github.com/golang/go synced 2024-09-30 18:08:33 -06:00
Commit Graph

16826 Commits

Author SHA1 Message Date
Russ Cox
5d340de1f6 cmd/dist: generate offsets for P structure
So far no checked-in assembly needs these,
but it matches having them for M and G.
I needed these for some manual testing.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/11595043
2013-07-19 15:40:32 -04:00
Keith Randall
c38173bcbd debug/gosym: put pclinetest file in temporary directory
where it belongs.

R=rsc
CC=golang-dev
https://golang.org/cl/11596043
2013-07-19 12:31:42 -07:00
Keith Randall
6fc49c1854 runtime: cleanup: use ArgsSizeUnknown to mark all functions
whose argument size is unknown (C vararg functions, and
assembly code without an explicit specification).

We used to use 0 to mean "unknown" and 1 to mean "zero".
Now we use ArgsSizeUnknown (0x80000000) to mean "unknown".

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11590043
2013-07-19 11:19:18 -07:00
Dmitriy Vyukov
eb04df75cd runtime: prevent GC from seeing the contents of a frame in runfinq
This holds the last finalized object and arguments to its finalizer.
Fixes #5348.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11454044
2013-07-19 18:01:33 +04:00
Dmitriy Vyukov
e242562506 test: fix error output in the test
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11432046
2013-07-19 17:48:19 +04:00
Dmitriy Vyukov
2a6520c2d3 runtime: hide mheap from GC
It contains pointers to first blocks of lots of spans.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11416046
2013-07-19 17:47:40 +04:00
Dmitriy Vyukov
6857264457 runtime: prevent sysmon from polling network excessivly
If the network is not polled for 10ms, sysmon starts polling network
on every iteration (every 20us) until another thread blocks in netpoll.
Fixes #5922.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11569043
2013-07-19 17:45:34 +04:00
David Symonds
9bfb69187f regexp: exclude exhaustive RE2 test from running under race detector.
It is an expensive test to run, and even more so with -race,
and causes timeouts on builders. It is doubtful that it would
find a race that other tests in this package wouldn't, so there
is little loss in excluding it.

Update #5837.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/11568043
2013-07-19 23:44:22 +10:00
Russ Cox
df3e6ce4b1 runtime: disable preemption during runtime.settype
It assumes that the m will not change, and the m may
change if the goroutine is preempted.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11560043
2013-07-18 22:58:49 -04:00
Brad Fitzpatrick
b2b15d1230 net/http: document and test Client.Post treating Reader body as ReadCloser
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11542044
2013-07-19 12:02:54 +10:00
Dmitriy Vyukov
bc31bcccd3 runtime: preempt long-running goroutines
If a goroutine runs for more than 10ms, preempt it.
Update #543.

R=rsc
CC=golang-dev
https://golang.org/cl/10796043
2013-07-19 01:22:26 +04:00
Russ Cox
58f12ffd79 runtime: handle morestack/lessstack in stack trace
If we start a garbage collection on g0 during a
stack split or unsplit, we'll see morestack or lessstack
at the top of the stack. Record an argument frame size
for those, and record that they terminate the stack.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/11533043
2013-07-18 16:53:45 -04:00
Russ Cox
8c741c97f7 cmd/6a, cmd/6l: make FUNCDATA work
R=ken2
CC=golang-dev
https://golang.org/cl/11397043
2013-07-18 15:38:19 -04:00
Daniel Morsing
b6f841733b regexp/syntax: update documentation for Parse.
Syntax description was moved to the top level comment of this package.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11536043
2013-07-18 21:28:00 +02:00
Russ Cox
ef12bbfc9d runtime: disable preemption during deferreturn
Deferreturn is synthesizing a new call frame.
It must not be interrupted between copying the args there
and fixing up the program counter, or else the stack will
be in an inconsistent state, one that will confuse the
garbage collector.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/11522043
2013-07-18 12:26:47 -04:00
Russ Cox
8166b2da19 runtime: record full frame size for arm _sfloat2
With preemption, _sfloat2 can show up in stack traces.
Write the function prototype in a way that accurately
shows the frame size and the fact that it might contain
pointers.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/11523043
2013-07-18 12:23:38 -04:00
Russ Cox
249f807c39 runtime: mark concatstring as variadic (fixes 386 build)
Windows was the only one seeing this bug reliably in the builder,
but it was easy to reproduce using 'GOGC=1 go test strconv'.
concatstring looked like it took only one string, but in fact it
takes a long list of strings. Add an explicit ... so that the traceback
will not use the "fixed" frame size and instead look at the
frame size metadata recorded by the caller.

R=golang-dev
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/11531043
2013-07-18 12:19:38 -04:00
Russ Cox
ff52cadc01 cmd/ld: refine test for history stack pop (fix Windows build)
This should fix the Windows build, or at least
what's breaking it at the moment.

Fixes #5904.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/11519044
2013-07-18 11:40:59 -04:00
Russ Cox
72bd1a7e36 debug/gosym: avoid test failure on Windows
Would fix build if build hadn't already been broken with something else.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/11525043
2013-07-18 11:01:58 -04:00
Russ Cox
c3de91bb15 cmd/ld, runtime: use new contiguous pcln table
R=golang-dev, r, dave
CC=golang-dev
https://golang.org/cl/11494043
2013-07-18 10:43:22 -04:00
Russ Cox
08ce3c3133 libmach: update for Go 1.2 pcln table
The change to addr2line makes it easy to test by hand.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11485044
2013-07-18 10:12:28 -04:00
Russ Cox
d7b4a09ca8 debug/gosym: update for Go 1.2 pcln table
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11495043
2013-07-18 10:12:14 -04:00
Brad Fitzpatrick
39100543ff io: let SectionReader seek past the end; document Seeker semantics more
Be consistent with os.File, strings.Reader, bytes.Reader, etc,
which all allow seeks past the end.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/11403043
2013-07-18 13:03:26 +10:00
Andrew Bonventre
a6f95ad34e image/gif: don't write superfluous global color table
R=r, nigeltao
CC=golang-dev
https://golang.org/cl/11446043
2013-07-18 11:11:23 +10:00
Ian Lance Taylor
c5c52f072b cmd/cgo: don't emit #pragma declarations when using gccgo
Update #5905

Don't emit #pragma cgo_ldflag and cgo_import_static
declarations that gccgo doesn't understand and can't use.

R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/11490043
2013-07-17 18:02:21 -07:00
Dave Cheney
9094941a40 cmd/ld: trivial: fix unused parameter pedantry
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/11436043
2013-07-18 10:11:43 +10:00
Brad Fitzpatrick
4aa6d35306 net/http: document NewRequest treating Reader as ReadCloser
R=golang-dev, dsymonds, rogpeppe
CC=golang-dev
https://golang.org/cl/11432044
2013-07-18 10:10:10 +10:00
Ian Lance Taylor
1da96a3039 runtime: disable preemption again to fix linux build
Otherwise the tests in pkg/runtime fail:

runtime: unknown argument frame size for runtime.deferreturn called from 0x48657b [runtime_test.func·022]
fatal error: invalid stack
...

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/11483043
2013-07-17 16:15:46 -07:00
Dominik Honnef
58ce655fd2 misc/emacs: Add godef-jump-other-window
This will behave like similar "*-other-window" functions in Emacs.

Default key bind is C-x 4 C-c C-j – while awkward, it follows both
the convention for other-window functions and the convention for
not using user- or emacs-reserved keys.

R=golang-dev, adonovan
CC=golang-dev
https://golang.org/cl/10707045
2013-07-17 18:16:44 -04:00
Russ Cox
b913cf84dc runtime: re-enable preemption
Update #543

I believe the runtime is strong enough now to reenable
preemption during the function prologue.
Assuming this is or can be made stable, it will be in Go 1.2.
More aggressive preemption is not planned for Go 1.2.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11433045
2013-07-17 14:03:27 -04:00
Dmitriy Vyukov
5887f142a3 runtime: more reliable preemption
Currently preemption signal g->stackguard0==StackPreempt
can be lost if it is received when preemption is disabled
(e.g. m->lock!=0). This change duplicates the preemption
signal in g->preempt and restores g->stackguard0
when preemption is enabled.
Update #543.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10792043
2013-07-17 12:52:37 -04:00
Russ Cox
a83748596c runtime: use new frame argument size information
With this CL, I believe the runtime always knows
the frame size during the gc walk. There is no fallback
to "assume entire stack frame of caller" anymore.

R=golang-dev, khr, cshapiro, dvyukov
CC=golang-dev
https://golang.org/cl/11374044
2013-07-17 12:47:18 -04:00
Joel Sing
7b7dac5e23 crypto/tls: Add support for ECDHE-ECDSA
Add support for ECDHE-ECDSA (RFC4492), which uses an ephemeral server
key pair to perform ECDH with ECDSA signatures. Like ECDHE-RSA,
ECDHE-ECDSA also provides PFS.

R=agl
CC=golang-dev
https://golang.org/cl/7006047
2013-07-17 12:33:16 -04:00
Daniel Morsing
85a7c090c4 cmd/8g: Make clearfat non-interleaved with pointer calculations.
clearfat (used to zero initialize structures) will use AX for x86 block ops. If we write to AX while calculating the dest pointer, we will fill the structure with incorrect values.
Since 64-bit arithmetic uses AX to synthesize a 64-bit register, getting an adress by indexing with 64-bit ops can clobber the register.

Fixes #5820.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11383043
2013-07-17 11:04:34 +02:00
Dave Cheney
deee03f17e doc/effective_go: stamp out stray GOROOT reference
Replaced with something more appropriate.

R=adg, r, minux.ma
CC=golang-dev
https://golang.org/cl/11421043
2013-07-17 18:48:55 +10:00
Keith Randall
cc84176108 runtime: print g0 stack if we throw on it and GOTRACEBACK>=2.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11385045
2013-07-16 16:44:24 -07:00
Adam Langley
ad477e4e20 crypto/rsa: remove obsolete TODO.
(PSS support is complete.)

Thanks to Frithjof Schulze for noting this.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10871046
2013-07-16 19:34:21 -04:00
Ian Lance Taylor
29d27671e5 test: add a compilation test that gccgo failed to compile
R=golang-dev, remyoudompheng
CC=golang-dev
https://golang.org/cl/11379044
2013-07-16 15:31:42 -07:00
Adam Langley
549802c776 CONTRIBUTORS: add Drew Hintz (Google CLA)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11386043
2013-07-16 17:37:22 -04:00
Russ Cox
7b3c8b7ac8 cmd/5g, cmd/6g, cmd/8g: insert arg size annotations on runtime calls
If calling a function in package runtime, emit argument size
information around the call in case the call is to a variadic C function.

R=ken2
CC=golang-dev
https://golang.org/cl/11371043
2013-07-16 16:25:10 -04:00
Russ Cox
4e141145b7 cmd/5c, cmd/6c, cmd/8c: record arg size for every call
R=ken2
CC=golang-dev
https://golang.org/cl/11364043
2013-07-16 16:24:43 -04:00
Russ Cox
9ddfb64365 runtime: record argument size in assembly functions
I have not done the system call stubs in sys_*.s.
I hope to avoid that, because those do not block, so those
frames will not appear in stack traces during garbage
collection.

R=golang-dev, dvyukov, khr
CC=golang-dev
https://golang.org/cl/11360043
2013-07-16 16:24:09 -04:00
Russ Cox
e69082ffdb syscall: record argument size for all assembly functions
While we're here, fix Syscall9 on NetBSD and OpenBSD:
it was storing the results into the wrong memory locations.
I guess no one uses that function's results on those systems.

Part of cleaning up stack traces and argument frame information.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/11355044
2013-07-16 16:23:53 -04:00
Russ Cox
47b89a37d9 cmd/5a, cmd/6a, cmd/8a: parse PCDATA
In cmd/5a, also add support for argument size in TEXT instruction.

R=ken2
CC=golang-dev
https://golang.org/cl/11357044
2013-07-16 16:23:28 -04:00
Russ Cox
567818224e cmd/5l, cmd/6l, cmd/8l: accept PCDATA instruction in input
The portable code in cmd/ld already knows how to process it,
we just have to ignore it during code generation.

R=ken2
CC=golang-dev
https://golang.org/cl/11363043
2013-07-16 16:23:11 -04:00
Alan Donovan
8fb6c3ac25 test: invert incorrect condition.
R=gri
CC=golang-dev
https://golang.org/cl/11359043
2013-07-16 12:18:00 -04:00
Dmitriy Vyukov
1d55685e26 runtime: minor cleanup of hashmap code
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11357043
2013-07-16 19:51:18 +04:00
Joel Sing
9bd32b48ca net: fix setsockopt for openbsd
s/TCP_KEEPALIVE/SO_KEEPALIVE/ to unbreak build on OpenBSD.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11345044
2013-07-16 08:35:06 -07:00
Russ Cox
5d363c6357 cmd/ld, runtime: new in-memory symbol table format
Design at http://golang.org/s/go12symtab.

This enables some cleanup of the garbage collector metadata
that will be done in future CLs.

This CL does not move the old symtab and pclntab back into
an unmapped section of the file. That's a bit tricky and will be
done separately.

Fixes #4020.

R=golang-dev, dave, cshapiro, iant, r
CC=golang-dev, nigeltao
https://golang.org/cl/11085043
2013-07-16 09:41:38 -04:00
Dmitriy Vyukov
63e0ddc7bf cmd/gc: do not race instrument syscall.forkAndExecInChild
Race instrumentation can allocate, switch stacks, preempt, etc.
All that is not allowed in between fork and exec.
Fixes #4840.

R=golang-dev, daniel.morsing, dave
CC=golang-dev
https://golang.org/cl/11324044
2013-07-16 15:35:03 +04:00