1
0
mirror of https://github.com/golang/go synced 2024-09-25 05:20:13 -06:00
Commit Graph

18200 Commits

Author SHA1 Message Date
Aram Hăvărneanu
6d0d08b849 os, os/exec, os/user: add support for GOOS=solaris
R=golang-codereviews, dave, minux.ma, gobot, jsing
CC=golang-codereviews
https://golang.org/cl/36020043
2014-01-10 02:49:37 +11:00
Ian Lance Taylor
7e639c0229 runtime: change errorCString to a struct
This prevents callers from using reflect to create a new
instance of errorCString with an arbitrary value and calling
the Error method to examine arbitrary memory.

Fixes #7084.

R=golang-codereviews, minux.ma, bradfitz
CC=golang-codereviews
https://golang.org/cl/49600043
2014-01-08 21:40:33 -08:00
Russ Cox
2d55fdb507 debug/goobj: add String methods for SymID and SymKind
R=iant
CC=golang-codereviews
https://golang.org/cl/48890044
2014-01-08 20:37:41 -05:00
Russ Cox
06c0280440 libmach: use different names for different Ureg types
Everything was doing this already with #defines.
Do it right.

R=golang-codereviews, jsing, 0intro, iant
CC=golang-codereviews
https://golang.org/cl/49090043
2014-01-08 20:37:27 -05:00
Rob Pike
fca453e062 cmd/nm: add -sort=size
When printing the size, we often want to sort on that key.
Because it's used when looking for large things, make the
sort go from largest to smallest.

Perfect recreation of CL 45150044, which was lost to some blunder.

R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/48500044
2014-01-08 15:56:40 -08:00
David du Colombier
43108ee53a libmach: use Go's ureg headers on Plan 9
The CL 49090043 renamed Ureg structures to Ureg386,
    UregArm and UregAmd64. This broke build on Plan 9,
    since ureg_x86.h includes /386/include/ureg.h, which
    declares a structure named Ureg instead of Ureg386.

R=golang-codereviews, bradfitz
CC=golang-codereviews, rsc
https://golang.org/cl/49260043
2014-01-08 23:34:11 +01:00
Keith Randall
e7d010a6a7 runtime: deallocate specials before deallocating the underlying object.
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/48840043
2014-01-08 12:41:26 -08:00
Ian Lance Taylor
89c5d17878 runtime: handle gdb breakpoint in x86 traceback
This lets stack splits work correctly when running under gdb
when gdb has inserted a breakpoint somewhere on the call
stack.

Fixes #6834.

R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/48650043
2014-01-08 12:36:31 -08:00
Jeff Sickel
a03e8a5be0 plan9: lookup query must seek to offset 0 before reading or
writing /net/dns or /net/cs (see nbd(8)).

R=golang-codereviews
CC=0intro, golang-codereviews, rsc
https://golang.org/cl/49060043
2014-01-08 21:22:18 +01:00
Brad Fitzpatrick
e7c21703a8 archive/zip: new test for earlier zip64 fix
Update #7069

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/49180043
2014-01-08 11:28:40 -08:00
Aram Hăvărneanu
f952d45508 all: add solaris build tags
R=golang-codereviews, minux.ma, gobot, rsc, dave
CC=golang-codereviews
https://golang.org/cl/36040043
2014-01-07 23:53:30 -05:00
Michael Hudson-Doyle
7178c05d05 cmd/go: test: do not put object files where later steps will find them
When recompiling a package whose basename is the name of a standard
package for testing with gccgo, a .o file with the basename of the
package being tested was being placed in the _test/ directory where the
compilation of the test binary then found it when looking for the
standard library package.

This change puts the object files in a separate directory.

Fixes #6793

R=golang-codereviews, dave, gobot, rsc, iant
CC=golang-codereviews
https://golang.org/cl/27650045
2014-01-07 23:53:16 -05:00
Keith Randall
020b39c3f3 runtime: use special records hung off the MSpan to
record finalizers and heap profile info.  Enables
removing the special bit from the heap bitmap.  Also
provides a generic mechanism for annotating occasional
heap objects.

finalizers
        overhead      per obj
old	680 B	      80 B avg
new	16 B/span     48 B

profile
        overhead      per obj
old	32KB	      24 B + hash tables
new	16 B/span     24 B

R=cshapiro, khr, dvyukov, gobot
CC=golang-codereviews
https://golang.org/cl/13314053
2014-01-07 13:45:50 -08:00
Brad Fitzpatrick
affab3f312 net/http: fix data race when sharing request body between client and server
A server Handler (e.g. a proxy) can receive a Request, and
then turn around and give a copy of that Request.Body out to
the Transport. So then two goroutines own that Request.Body
(the server and the http client), and both think they can
close it on failure.  Therefore, all incoming server requests
bodies (always *http.body from transfer.go) need to be
thread-safe.

Fixes #6995

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/46570043
2014-01-07 10:40:56 -08:00
Shawn Smith
39a396d2ba encoding/csv: test that carriage return is handled in Write
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/46310043
2014-01-07 09:32:15 -08:00
Rémy Oudompheng
095de8795a cmd/gc: add missing dupok flag for interface method wrappers.
R=rsc
CC=golang-codereviews
https://golang.org/cl/48420044
2014-01-07 18:25:11 +01:00
Joel Sing
9a7fb68359 crypto/sha512: avoid duplicate block declaration on 386
Unbreak the build - we do not have a sha512 block implementation in
386 assembly (yet).

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/48520043
2014-01-07 23:50:31 +11:00
Rémy Oudompheng
f303921251 cmd/gc: do not omit wrapper for expression (interface{...}).F
Fixes #6723.

R=rsc
CC=golang-codereviews
https://golang.org/cl/41570047
2014-01-07 13:26:48 +01:00
Joel Sing
0a37002367 crypto/sha512: block implementation in amd64 assembly
Benchmark on Intel(R) Xeon(R) CPU X5650  @ 2.67GHz

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1779         1114  -37.38%
BenchmarkHash1K             9848         4894  -50.30%
BenchmarkHash8K            68513        32187  -53.02%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         4.50         7.18    1.60x
BenchmarkHash1K           103.97       209.19    2.01x
BenchmarkHash8K           119.57       254.51    2.13x

R=agl
CC=golang-codereviews
https://golang.org/cl/37150044
2014-01-07 23:16:46 +11:00
Aram Hăvărneanu
901e7bfe53 lib9, libmach, cmd/dist, go/build: add support for GOOS=solaris
This change adds solaris to the list of supported operating
systems and allows cmd/dist to be built on Solaris.

This CL has to come first because we want the tools to ignore
solaris-specific files until the whole port is integrated.

R=golang-codereviews, jsing, rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/35900045
2014-01-07 23:12:12 +11:00
Joel Sing
8f9844348f syscall: include mmap constants in netbsd zerror* files
Include the <sys/mman.h> header for NetBSD mkerrors.sh. This brings
in constants used with mmap(2), msync(2) and mlockall(2).

The regeneration of the NetBSD zerror* files also picks clone(2)
related constants.

Update #4929.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/45510044
2014-01-07 23:04:17 +11:00
Russ Cox
d227d680ec cmd/gc: use 100x less memory for []byte("string")
[]byte("string") was simplifying to
[]byte{0: 0x73, 1: 0x74, 2: 0x72, 3: 0x69, 4: 0x6e, 5: 0x67},
but that latter form takes up much more memory in the compiler.
Preserve the string form and recognize it to turn global variables
initialized this way into linker-initialized data.

Reduces the compiler memory footprint for a large []byte initialized
this way from approximately 10 kB/B to under 100 B/B.

See also issue 6643.

R=golang-codereviews, r, iant, oleku.konko, dave, gobot, bradfitz
CC=golang-codereviews
https://golang.org/cl/15930045
2014-01-06 20:43:44 -05:00
Adam Langley
78c16c9b16 crypto/rsa: support unpadded signatures.
Usually when a message is signed it's first hashed because RSA has low
limits on the size of messages that it can sign. However, some
protocols sign short messages directly. This isn't a great idea because
the messages that can be signed suddenly depend on the size of the RSA
key, but several people on golang-nuts have requested support for
this and it's very easy to do.

R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/44400043
2014-01-06 16:11:58 -05:00
Brad Fitzpatrick
90e9669c50 undo CL 44150043 / 198bdc0984dd
See https://golang.org/cl/44150043/

««« original CL description
regexp: use sync.Pool

For machines, not threads.

Update #4720

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/44150043
»»»

TBR=golang-dev
CC=golang-codereviews
https://golang.org/cl/48190043
2014-01-06 12:38:04 -08:00
Brad Fitzpatrick
02a15e7165 archive/zip: fix bug reading zip64 files
ZIP64 Extra records are variably sized, but we weren't capping
our reading of the extra fields at its previously-declared
size.

No test because I don't know how to easily create such files
and don't feel like manually construction one.  But all
existing tests pass, and this is "obviously correct" (queue
laughter).

Fixes #7069

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/48150043
2014-01-06 10:43:56 -08:00
Matthew Cottingham
991e9a8331 net/http: Add more call order tests for request form parsing.
Adds tests for branches handling call ordering which
were shown to be untested by the cover tool.

This is part of the refactoring of form parsing discussed
in CL 44040043. These tests may need to be changed later but
should help lock in the current behaviour.

R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/46750043
2014-01-06 10:36:04 -08:00
Bill Thiede
6576757927 hash/fnv: fix overview link currently returning 404.
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/47570043
2014-01-06 10:34:24 -08:00
Shawn Smith
16134060de time: add tests for Tick, NewTicker with negative duration
R=golang-codereviews, gobot, r, bradfitz
CC=golang-codereviews
https://golang.org/cl/37660044
2014-01-06 10:32:07 -08:00
Joel Sing
232a4e89a4 crypto/sha256: block implementation in 386 assembly
Benchmark on Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz (albeit in a VM)

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes         1606          699  -56.48%
BenchmarkHash1K            21920         7268  -66.84%
BenchmarkHash8K           165696        53756  -67.56%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes         4.98        11.44    2.30x
BenchmarkHash1K            46.72       140.88    3.02x
BenchmarkHash8K            49.44       152.39    3.08x

R=agl, cldorian
CC=golang-codereviews
https://golang.org/cl/44800044
2014-01-06 13:31:22 -05:00
Volker Dobler
939b3fa39e net/http: remove todos from cookie code
The Domain and Path field of a parsed cookie have been
the unprocessed wire data since Go 1.0; this seems to
be okay for most applications so let's keep it.

Returning the unprocessed wire data makes it easy to
handle nonstandard or even broken clients without
consulting Raw or Unparsed of a cookie.

The RFC 6265 parsing rules for domain and path are
currently buried in net/http/cookiejar but could be
exposed in net/http if necessary.

R=bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/48060043
2014-01-06 10:00:58 -08:00
Volker Dobler
eb93f86275 net/http/cookiejar: document format of domain in PublicSuffix
Document what values a PublicSuffixList must accept as
a domain in a call to PublicSuffix.

R=bradfitz, nigeltao
CC=golang-codereviews
https://golang.org/cl/47560044
2014-01-06 10:00:20 -08:00
Emil Hessman
aeeda707ff runtime: Fix panic when trying to stop CPU profiling with profiler turned off
Fixes #7063.

R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/47950043
2014-01-06 09:53:55 -08:00
Dominik Honnef
79653e4121 misc/emacs: fontify type switch correctly
Require at least one space after "type" and do not fontify closing
parenthesis of type switch as a type.

R=adonovan
CC=golang-codereviews
https://golang.org/cl/37720050
2014-01-06 11:11:03 -05:00
Dominik Honnef
81cab4c3d3 misc/emacs: minor cleanups
R=adonovan
CC=golang-codereviews
https://golang.org/cl/23290044
2014-01-06 10:48:06 -05:00
Joel Sing
29fe067ba7 crypto/sha1, crypto/sha256, crypto/sha512: use copy for partial block
Use copy rather than a hand rolled loop when moving a partial input
block to the scratch area. This results in a reasonable performance
gain when partial blocks are written.

Benchmarks on Intel(R) Xeon(R) CPU X5650  @ 2.67GHz with Go amd64:

       benchmark               old MB/s     new MB/s  speedup
SHA1   BenchmarkHash8Bytes        18.37        22.80    1.24x
SHA256 BenchmarkHash8Bytes        11.86        13.78    1.16x
SHA512 BenchmarkHash8Bytes         4.51         5.24    1.16x

       benchmark              old ns/op    new ns/op    delta
SHA1   BenchmarkHash8Bytes          435          350  -19.54%
SHA256 BenchmarkHash8Bytes          674          580  -13.95%
SHA512 BenchmarkHash8Bytes         1772         1526  -13.88%

R=agl, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/35840044
2014-01-06 01:34:56 +11:00
Shawn Smith
48334e3e91 container/list: improve test coverage
R=golang-codereviews, dave, gobot, bradfitz, gri
CC=golang-codereviews
https://golang.org/cl/46640043
2014-01-05 07:48:32 +11:00
Jeff Sickel
c136197ca8 runtime: plan 9 does have /dev/random
R=golang-codereviews, r, aram
CC=0intro, golang-codereviews, rsc
https://golang.org/cl/43420045
2014-01-04 10:53:22 -08:00
Rob Pike
82e2db70f6 spec: s/and/or/ for correctness and parallelism
No change to the meaning, just bad writing found by
Doug McIlroy.
Let's start the new year off with a bang.

R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/47110044
2014-01-04 10:52:59 -08:00
Keith Randall
f59ea4e58b runtime: Fix race detector checks to ignore KindNoPointers bit
when comparing kinds.

R=dvyukov, dave, khr
CC=golang-codereviews
https://golang.org/cl/41660045
2014-01-04 08:43:17 -08:00
Emil Hessman
13141315ad spec: Fix broken type identity link
Fixes #7003.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/47780043
2014-01-03 22:48:03 -08:00
Dave Cheney
30ba286c61 os: add tests for operations on nil *File methods
R=shawn.p.smith, gobot, r
CC=golang-codereviews
https://golang.org/cl/46820043
2014-01-04 09:58:04 +11:00
Dave Cheney
f2e946f9ed os: return ErrInvalid if receiver is nil.
Fixes #7043.

Test coming in https://golang.org/cl/46820043

R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/38330045
2014-01-04 08:25:09 +11:00
Daniel Morsing
f2e94b58a0 cmd/gc: silence assignment errors to undefined symbols
Fixes #6406.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46900043
2014-01-03 21:03:20 +01:00
Emil Hessman
880442f110 encoding/json: Fix missing error when trying to unmarshal null string into int, for successive ,string option
Fixes #7046.

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/47260043
2014-01-03 10:13:28 -08:00
Joel Sing
d180579170 syscall: handle varied path lengths for unix sockets
Most BSDs include the trailing NUL character of the socket path in the
length, however some do not (such as NetBSD 6.99). Handle this by only
subtracting the family and length bytes from the returned length, then
scanning the path and removing any terminating NUL bytes.

Fixes #6627.

R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/46420044
2014-01-04 00:29:20 +11:00
David Symonds
8778760a7e runtime: increase attempt count for map iteration order test.
Some builders broke on this test; I'm guessing that was because
this test didn't try hard enough to find a different iteration order.

Update #6719

R=dave
CC=golang-codereviews
https://golang.org/cl/47300043
2014-01-03 10:41:56 +11:00
David Symonds
d4c66a35ba runtime: add a test for randomised map iteration order.
Technically the spec does not guarantee that the iteration order is random,
but it is a property that we have consciously pursued, and so it seems
right to verify that our implementation does indeed randomise.

Update #6719.

R=khr, bradfitz
CC=golang-codereviews
https://golang.org/cl/47010043
2014-01-03 10:10:54 +11:00
Brad Fitzpatrick
3a765be98c A+C: Pavel Zinovkin (individual CLA)
Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/39780047
2014-01-02 11:00:14 -08:00
Shawn Smith
eaff83b98e encoding/hex: add Decode error test case
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/46880043
2014-01-02 10:34:21 -08:00
Shawn Smith
b38da05ab1 time: add tests for Duration.Nanoseconds, Duration.Minutes, and Duration.Hours
R=golang-codereviews, rsc, dave
CC=golang-codereviews
https://golang.org/cl/42440043
2014-01-02 21:01:18 +11:00