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

12388 Commits

Author SHA1 Message Date
Rob Pike
b42c8294eb fmt: fix crash for Printf("%.", 3)
Fixes #5311

R=golang-dev, bradfitz, iant
CC=golang-dev
https://golang.org/cl/8961050
2013-04-29 13:52:07 -07:00
Shenghou Ma
5b78cee376 runtime: fix stack pointer corruption in runtime.cgocallback_gofunc()
runtime.setmg() calls another function (cgo_save_gm), so it must save
LR onto stack.
Re-enabled TestCthread test in misc/cgo/test.

Fixes #4863.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9019043
2013-04-30 04:13:32 +08:00
Ian Lance Taylor
806dea82d4 fmt: document that if String or Error panics, that value is printed
Fixes #5350.

R=r, minux.ma
CC=golang-dev
https://golang.org/cl/8950043
2013-04-29 12:01:32 -07:00
Andrew Gerrand
13721cf688 net/http/httptest: fix incorrectly-named ResponseRecorder example
R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/8545047
2013-04-29 17:34:47 +02:00
Brad Fitzpatrick
e9546a01dc math/rand: fix typo and add better crash message
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9000043
2013-04-27 18:50:38 -07:00
Dave Cheney
d09f34cc55 runtime: tune appendCrossover for arm
Turns out the optimal value is 8 on cortex-A9 systems (pandaboard)

benchmark                     old ns/op    new ns/op    delta
BenchmarkAppend                     907          908   +0.11%
BenchmarkAppend1Byte                101          101   +0.00%
BenchmarkAppend4Bytes               116          116   +0.00%
BenchmarkAppend8Bytes               139          138   -0.72%
BenchmarkAppend16Bytes              185          158  -14.59%
BenchmarkAppend32Bytes              131          131   +0.00%
BenchmarkAppendStr1Byte              72           72   +0.00%
BenchmarkAppendStr4Bytes             93           93   -0.21%
BenchmarkAppendStr8Bytes            116          116   +0.00%
BenchmarkAppendStr16Bytes           161          125  -22.36%
BenchmarkAppendStr32Bytes           102          102   +0.00%
BenchmarkAppendSpecialCase          613          613   +0.00%

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8863045
2013-04-28 00:18:11 +10:00
Brad Fitzpatrick
3cef6979ee database/sql/driver: try to unstutter Value docs
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8981043
2013-04-26 11:42:58 -07:00
Dmitriy Vyukov
489addd250 time: stop 1ns timer in test
R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/8819046
2013-04-26 11:08:50 +04:00
Brad Fitzpatrick
277047f52a database/sql: fix driver Conn refcounting with prepared statements
The refcounting of driver Conns was completedly busted and
would leak (be held open forever) with any reasonable
load. This was a significant regression from Go 1.0.

The core of this patch is removing one line:

     s.db.addDep(dc, s)

A database conn (dc) is a resource that be re-created any time
(but cached for speed) should not be held open forever with a
dependency refcount just because the Stmt (s) is alive (which
typically last for long periods of time, like forever).

The meat of the patch is new tests. In fixing the real issue,
a lot of tests then failed due to the fakedb_test.go's paranoia
about closing a fakeConn while it has open fakeStmts on it. I
could've ignored that, but that's been a problem in the past for
other bugs.

Instead, I now track per-Conn open statements and close them
when the the conn closes.  The proper way to do this would've
been making *driverStmt a finalCloser and using the dep mechanism,
but it was much more invasive. Added a TODO instead.

I'd like to give a way for drivers to opt-out of caring about
driver.Stmt closes before a driver.Conn close, but that's a TODO
for the future, and that TODO is added in this CL.

I know this is very late for Go 1.1, but database/sql is
currently nearly useless without this.

I'd like to believe all these database/sql bugs in the past
release cycle are the result of increased usage, number of
drivers, and good feedback from increasingly-capable Go
developers, and not the result of me sucking.  It's also hard
with all the real drivers being out-of-tree, so I'm having to
add more and more hooks to fakedb_test.go to simulate things
which real drivers end up doing.

Fixes #5323

R=golang-dev, snaury, gwenn.kahz, google, r
CC=golang-dev
https://golang.org/cl/8836045
2013-04-25 14:45:56 -07:00
Jan Ziak
13cbf41a7f cmd/gc: initialize t->width in dgcsym() if required
Update #5291.

R=golang-dev, daniel.morsing, iant, r
CC=golang-dev
https://golang.org/cl/8663052
2013-04-25 18:47:12 +02:00
Jan Ziak
db1c218d4f undo CL 8954044 / ad3c2ffb16d7
It works on i386, but fails on amd64 and arm.

««« original CL description
runtime: prevent the GC from seeing the content of a frame in runfinq()

Fixes #5348.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/8954044
»»»

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8695051
2013-04-25 18:12:09 +02:00
Jan Ziak
e9bbe3a8da runtime: prevent the GC from seeing the content of a frame in runfinq()
Fixes #5348.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/8954044
2013-04-25 13:39:09 +02:00
Mikio Hara
2bd17bca07 net: deflake raw IP protocol entry test on Windows
Update #5344

R=golang-dev, dave, r, alex.brainman
CC=golang-dev
https://golang.org/cl/8934043
2013-04-25 13:23:24 +09:00
Rob Pike
2c5e477f48 cmd/vet: clean up the test
- clean up the notypes version of the test so it's quiet
- change the package in the buildtag test to avoid confusing godoc

R=golang-dev, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/8671049
2013-04-24 10:40:29 -07:00
Ian Lance Taylor
578dc3a96c cmd/5g, cmd/6g, cmd/8g: more nil ptr to large struct checks
R=r, ken, khr, daniel.morsing
CC=dsymonds, golang-dev, rickyz
https://golang.org/cl/8925043
2013-04-24 08:13:01 -07:00
Mikio Hara
73417e4098 net: add missing File method document
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/8698049
2013-04-24 08:32:11 +09:00
Anthony Martin
d33f09bcc0 cmd/dist: fix line numbers in goc2c generated files
We have to reset the global lineno variable before
processing each file otherwise line numbers will be
offset by the number of lines in the previous file.

The following examples are from the beginning of the
ztime_linux_amd64.c file which is generated from
time.goc in the runtime package.

Before:
    #line 2483 "/home/apm/src/go/src/pkg/runtime/time.goc"
    static Timers timers;
    static void addtimer ( Timer* ) ;
    void
    time·Sleep(int64 ns)
    {
    #line 2492 "/home/apm/src/go/src/pkg/runtime/time.goc"

After:
    #line 16 "/home/apm/src/go/src/pkg/runtime/time.goc"
    static Timers timers;
    static void addtimer ( Timer* ) ;
    void
    time·Sleep(int64 ns)
    {
    #line 25 "/home/apm/src/go/src/pkg/runtime/time.goc"

R=golang-dev, minux.ma, iant, r, adg
CC=golang-dev
https://golang.org/cl/8653045
2013-04-23 16:02:50 -07:00
Shenghou Ma
7bec1a6033 all: fix typos
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8896045
2013-04-24 04:46:14 +08:00
Mikio Hara
3828316b9f net: fix protocol number for IPv6 test
The protocol number of ICMP for IPv6 is 58, not 1.

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/8663048
2013-04-23 20:30:42 +09:00
Christian Himpel
237cee7834 time: fix typo in comment
R=r
CC=golang-dev
https://golang.org/cl/8889045
2013-04-22 22:09:11 -07:00
Rob Pike
14234c23a8 time: fix typo in comment
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8915043
2013-04-22 15:41:06 -07:00
Shenghou Ma
8c72b81132 misc/cgo/testso: enable test on windows
Depends on CL 8715043 and CL 8676050.
Fixes #5273.

R=alex.brainman, r
CC=gobot, golang-dev
https://golang.org/cl/8764043
2013-04-23 04:42:04 +08:00
Rob Pike
c285789059 time: improve the explanation of the working of Format and Parse
Change the term 'standard time', which already means something,
to 'reference time', and add a couple of sentences and clarifications.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8799047
2013-04-22 11:36:17 -07:00
Brad Fitzpatrick
61ed384a96 net/http: make CloseNotifier channel buffered to not leak goroutines
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8911044
2013-04-22 10:32:10 -07:00
Brad Fitzpatrick
4b091c533e sort: don't depend on math
No reason to pull in math just for x != x.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8886043
2013-04-20 17:20:41 -07:00
Brad Fitzpatrick
8b29f158ad net/http: fix a panic in Redirect
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/8721045
2013-04-20 17:20:14 -07:00
Alex Brainman
782a57811f cmd/ld: do not relocate ignored PE sections
This should have been part of CL8715043.

Update #5106

R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/8676050
2013-04-20 17:42:14 +10:00
Mikio Hara
41451dd92b net: enable test for runtime.PollDesc leak
Update #5219.

R=golang-dev, dvyukov, r
CC=golang-dev
https://golang.org/cl/8602047
2013-04-20 09:04:20 +09:00
Shenghou Ma
0c2b980c49 cmd/ld: don't show cursym in gcc invocation failure message
before:
fmt.statictmp_0731:/usr/local/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100
now:
/usr/local/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/8827045
2013-04-20 02:44:16 +08:00
Rob Pike
591d4a47ae bufio.Scan: don't stop after Read returns 0, nil
But stop eventually if the reader misbehaves.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8757045
2013-04-18 17:37:21 -07:00
Rob Pike
5fbb54eaca io: explain what (0,nil) means from Read
Also add a new variable ErrNoProgress that io.Readers can use to
report ineffectual Read calls.
Fixes #5310.

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/8845043
2013-04-18 17:36:25 -07:00
Robert Griesemer
8457afbe00 builtin: document true and false.
Fixes #5315.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8841048
2013-04-18 14:36:08 -07:00
Rémy Oudompheng
b08a3164c0 crypto/rand: better panic message for invalid Int argument.
Also document the panic to be consistent with math/rand.

Fixes #5187.

R=golang-dev, dave, bradfitz, r
CC=golang-dev
https://golang.org/cl/8303043
2013-04-17 23:21:15 -07:00
Brad Fitzpatrick
24555c7b8c mime/multipart: don't strip leading space/tab in quoted-printable decoding
Late bug fix, but this is arguably a regression from Go 1.0,
since we added this transparent decoding since then. Without
this fix, Go 1.0 users could decode this correctly, but Go 1.1
users would not be able to.

The newly added test is from the RFC itself.

The updated tests had the wrong "want" values before. They
were there to test \r\n vs \n equivalence (which is
unchanged), not leading whitespace.

The skipWhite decoder struct field was added in the battles of
Issue 4771 in revision b3bb265bfecf. It was just a wrong
strategy, from an earlier round of attempts in
https://golang.org/cl/7300092/

Update #4771
Fixes #5295

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8536045
2013-04-17 20:04:58 -07:00
Brad Fitzpatrick
32f2fd15df doc/go1.1.html, mime/multipart: document quoted-printable decoding
Fixes #5293

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8840043
2013-04-17 13:25:28 -07:00
Brad Fitzpatrick
b95c48918c archive/zip: add docs on type of slashes in paths
Fixes #5307

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8676046
2013-04-17 13:25:12 -07:00
Alexei Sholik
d00a646e70 go/token: fix grammar for precedence consts
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8662045
2013-04-17 11:46:30 -07:00
Shenghou Ma
a5fe79ef78 cmd/dist, make.bash: pass -mmacosx-version-min=10.6 to gcc on Darwin
Fixes #5261.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8798044
2013-04-16 13:30:52 -07:00
Ian Lance Taylor
9ad236ab72 runtime: if span was scavenged, mark it as needing to be zeroed
Update #4979.

R=dvyukov, r, bradfitz
CC=golang-dev
https://golang.org/cl/8697045
2013-04-16 09:08:06 -07:00
Brad Fitzpatrick
36d3bef8a3 database/sql: close driver Stmt before releasing Conn
From the issue, which describes it as well as I could:

database/sql assumes that driver.Stmt.Close does not need the
connection.

see database/sql/sql.go:1308:

This puts the Rows' connection back into the idle pool, and
then calls the driver.Stmt.Close method of the Stmt it belongs
to.  In the postgresql driver implementation
(https://github.com/lib/pq), Stmt.Close communicates with the
server (on the connection that was just put back into the idle
pool).  Most of the time, this causes no problems, but if
another goroutine makes a query at the right (wrong?) time,
chaos results.

In any case, traffic is being sent on "free" connections
shortly after they are freed, leading to race conditions that
kill the driver code.

Fixes #5283

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8633044
2013-04-15 14:06:41 -07:00
Shenghou Ma
83b7b0e24f net/http/cookiejar: mention go.net/publicsuffix.
R=golang-dev, r, gary.burd, dr.volker.dobler
CC=golang-dev
https://golang.org/cl/8660046
2013-04-16 04:29:55 +08:00
Ian Lance Taylor
9ca4a25f4b cmd/ld: ignore PE sections that are not code or data
Update #5106
Update #5273

R=minux.ma, r
CC=golang-dev
https://golang.org/cl/8715043
2013-04-15 10:35:37 -07:00
Joel Sing
804ef381db runtime: fix build on openbsd/386
R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/8569043
2013-04-15 10:20:24 -07:00
Brad Fitzpatrick
03640c58e3 crypto/ecdsa: doc cleanup
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/8592044
2013-04-13 23:09:08 -07:00
Daniel Morsing
7b8e08617e cmd/gc: disable inlining of method values
They caused internal compiler errors and they're expensive enough that inlining them doesn't make sense.

Fixes #5259.

R=golang-dev, r, iant, remyoudompheng
CC=golang-dev
https://golang.org/cl/8636043
2013-04-13 08:22:16 +02:00
Robert Griesemer
968732b677 go/scanner: reject BOMs that are not at the beginning
For compliance with gc. See also issue 5265.
Not Go1.1 critical, but harmless.

R=r
CC=golang-dev
https://golang.org/cl/8736043
2013-04-12 21:28:38 -07:00
Alexei Sholik
d4d063580f testing/iotest: rephrase DataErrReader's description
R=r
CC=golang-dev
https://golang.org/cl/8650044
2013-04-12 16:08:56 -07:00
Volker Dobler
18ff727487 cmd/go: quote command line arguments in debug output
Debug output from go test -x may contain empty arguments.
This CL quotes arguments if needed. E.g. the output of
go test -x is now
  .../6g -o ./_go_.6 -p testmain -complete -D "" -I . -I $WORK ./_testmain.go
which is easier to grasp.

R=golang-dev, bradfitz, minux.ma, r
CC=golang-dev
https://golang.org/cl/8633043
2013-04-12 14:05:14 -07:00
Volker Dobler
ce64f7365f cmd/go: quote command line arguments in debug output
Debug output from go test -x may contain empty arguments.
This CL quotes arguments if needed. E.g. the output of
go test -x is now
  .../6g -o ./_go_.6 -p testmain -complete -D "" -I . -I $WORK ./_testmain.go
which is easier to grasp.

R=golang-dev, bradfitz, minux.ma, r
CC=golang-dev
https://golang.org/cl/8633043
2013-04-12 14:04:00 -07:00
Ian Lance Taylor
696901204f cmd/ld: always do external link for -linkmode=external
There are tests in run.bash for -linkmode=external.

Fixes #5238.

R=golang-dev, bradfitz, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/8716044
2013-04-12 13:21:17 -07:00
Ian Lance Taylor
813590b145 cmd/ld: if we fail from an unexpected PE flags value, print it
R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/8709043
2013-04-12 07:58:50 -07:00
Ian Lance Taylor
709e03f43d runtime: add a hook to disable precise GC
This will let us ask people to rebuild the Go system without
precise GC, and then rebuild and retest their program, to see
if precise GC is causing whatever problem they are having.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8700043
2013-04-12 05:23:38 -07:00
Ian Lance Taylor
9fe8681df6 runtime: use UMTX_OP_WAIT_UINT on FreeBSD
UMTX_OP_WAIT expects that the address points to a uintptr, but
the code in lock_futex.c uses a uint32.  UMTX_OP_WAIT_UINT is
just like UMTX_OP_WAIT, but the address points to a uint32.
This almost certainly makes no difference on a little-endian
system, but since the kernel supports it we should do the
right thing.  And, who knows, maybe it matters.

R=golang-dev, bradfitz, r, ality
CC=golang-dev
https://golang.org/cl/8699043
2013-04-12 05:20:15 -07:00
Rob Pike
88f9ab8926 encoding/json: documentation regarding anonymous fields.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8545046
2013-04-11 12:46:23 -07:00
Volker Dobler
a9f1569e7b gc: escape unicode BOM in exported string literals
Fixes #5260.

R=golang-dev, minux.ma, 0xjnml, r
CC=golang-dev
https://golang.org/cl/8658043
2013-04-11 11:45:18 -07:00
Andrew Wilkins
d06be395cc cmd/cgo, cmd/go: remove #cgo directive parsing from cmd/cgo
This change removes processing of #cgo directives from cmd/cgo,
pushing the onus back on cmd/go to pass all necessary flags.

Fixes #5224. See comments for rationale.

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/8610044
2013-04-10 21:41:54 -07:00
Rob Pike
082a4a8a47 bufio/Scan: fix error handling at EOF
Fixes #5268.

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/8646045
2013-04-10 20:58:19 -07:00
Anthony Martin
7ac20853fc cmd/ld: fix scope of static objects in symbol table
All symbols are currently marked with global scope.
The correct behavior was lost when the symbol table
format was changed.

R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/8625043
2013-04-10 18:47:58 -07:00
Rob Pike
bb195f6793 fmt: tweak the explanation of Stringer to be more correct and less specific
The String method is called whenever the printing operation wants a string,
not just for %s and %v.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8638043
2013-04-10 14:05:34 -07:00
Robert Griesemer
d06313e8ce go/ast: distinguish between methods and functions in filtering
Go1.1 harmless, but not critical.

Fixes #5249.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8609043
2013-04-10 13:39:20 -07:00
Rob Pike
5fd708c000 encoding/json: different decision on tags and shadowing
If there are no tags, the rules are the same as before.
If there is a tagged field, choose it if there is exactly one
at the top level of all fields.
More tests. The old tests were clearly inadequate, since
they all pass as is. The new tests only work with the new code.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8617044
2013-04-10 13:05:34 -07:00
Shenghou Ma
f0fc16abd7 cmd/ld: fix argument passing in doc.go
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8622043
2013-04-11 04:04:02 +08:00
Rémy Oudompheng
0e76a943c9 cmd/ld: fix inconsistency in internal linking of common symbols.
Some variables declared in C could end up as undefined symbols
in the final binary and have null address.

Fixes #5114.
Fixes #5227.

R=golang-dev, iant, ajstarks, dave, r
CC=golang-dev
https://golang.org/cl/8602044
2013-04-10 07:15:49 +02:00
Rob Pike
357e37dc94 encoding/json: fix handling of anonymous fields
The old code was incorrect and also broken. It passed the tests by accident.
The new algorithm is:
        1) Sort the fields in order of names.
        2) For all fields with the same name, sort in increasing depth.
        3) Choose the single field with shortest depth.
If any of the fields of a given name has a tag, do the above using
tagged fields of that name only.
Fixes #5245.

R=iant
CC=golang-dev
https://golang.org/cl/8583044
2013-04-09 15:00:21 -07:00
Brad Fitzpatrick
8691f90cc5 io: document non-guarantees of io.Closer
R=r, golang-dev
CC=golang-dev
https://golang.org/cl/8575043
2013-04-09 10:17:35 -07:00
Ian Lance Taylor
0d932d434b lib9: add newline to exec error message
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/8573043
2013-04-09 10:03:14 -07:00
Mikio Hara
e13341edd1 net: fix possible runtime.PollDesc leak when connect or listen fails
Makes it possible to return the spent runtime.PollDesc to
runtime.pollcache descriptor pool when netFD.connect or
syscall.Listen fails.

Fixes #5219.

R=dvyukov, dave, bradfitz, adg
CC=golang-dev
https://golang.org/cl/8318044
2013-04-09 12:41:58 +09:00
Alex Brainman
384b72e94b run.bat: make windows runtime test timeout same as other os
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/8551043
2013-04-09 13:01:09 +10:00
Dmitriy Vyukov
c8b2b725e0 runtime: fix integer overflow in hashmap
The test is problematic, because it requires 8GB+ of RAM.
Fixes #5239.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8550043
2013-04-08 18:56:38 -07:00
Dave Cheney
77a0b96f2f net: add test for runtime.PollDesc leak
See 8318044

R=bradfitz
CC=golang-dev
https://golang.org/cl/8547043
2013-04-09 11:14:22 +10:00
Andrew Wilkins
afb49aada5 cmd/cgo: record CGO_LDFLAGS env var in _cgo_flags
cgo stores cgo LDFLAGS in _cgo_flags and _cgo_defun.c.
The _cgo_defun.c records the flags via
"#pragma cgo_ldflag <flag>", which external linking
relies upon for passing libraries (and search paths)
to the host linker.

The go command will allow LDFLAGS for cgo to be passed
through the environment (CGO_LDFLAGS); cgo ignores
this environment variable, and so its value doesn't
make it into the above mentioned files. This CL changes
cgo to record CGO_LDFLAGS also.

Fixes #5205.

R=iant, minux.ma
CC=golang-dev
https://golang.org/cl/8465043
2013-04-09 07:35:06 +08:00
Rémy Oudompheng
5bb3a66a97 sync, sync/atomic: do not corrupt race detector after a nil dereference.
The race detector uses a global lock to analyze atomic
operations. A panic in the middle of the code leaves the
lock acquired.

Similarly, the sync package may leave the race detectro
inconsistent when methods are called on nil pointers.

R=golang-dev, r, minux.ma, dvyukov, rsc, adg
CC=golang-dev
https://golang.org/cl/7981043
2013-04-08 23:46:54 +02:00
Dmitriy Vyukov
bd1cd1ddea runtime: poor man's heap type info checker
It's not trivial to make a comprehensive check
due to inferior pointers, reflect, gob, etc.
But this is essentially what I've used to debug
the GC issues.
Update #5193.

R=golang-dev, iant, 0xe2.0x9a.0x9b, r
CC=golang-dev
https://golang.org/cl/8455043
2013-04-08 13:36:35 -07:00
Rémy Oudompheng
20e05303fe cmd/gc: properly set variadic flag on method values.
Fixes #5231.

R=golang-dev, daniel.morsing, adg
CC=golang-dev
https://golang.org/cl/8275044
2013-04-08 08:59:33 +02:00
Rob Pike
18ca86ebb3 cmd/go: fix a misleading sentence
Apologies for not reviewing the previous CL; I was on the road.
The text was misleading; execution is no more separate than with
any other test. Rewritten. Dropped the odd adverb.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8439045
2013-04-07 23:27:26 -07:00
Andrew Gerrand
212cb0375a cmd/go: clarify what "pkg.test" means wrt the -c flag
Fixes #5230.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8507043
2013-04-08 16:03:19 +10:00
Andrew Gerrand
bfcd2d1e80 archive/zip: handle trailing data after the end of directory header
The spec doesn't explicitly say that trailing data is okay, but a lot
of people do this and most unzippers will handle it just fine. In any
case, this makes the package more useful, and led me to make the
directory parsing code marginally more robust.

Fixes #5228.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/8504044
2013-04-08 15:38:06 +10:00
Kamil Kisiel
091970c551 cmd/go: document usage of external test packages
Fixes #5144

R=golang-dev, r, dave, adg
CC=golang-dev
https://golang.org/cl/8171044
2013-04-08 14:42:06 +10:00
Rob Pike
092c481c1b reflect: document the unreliability of StringHeader and SliceHeader
R=golang-dev, adg, dvyukov
CC=golang-dev
https://golang.org/cl/8494045
2013-04-07 18:42:47 -07:00
Andrew Gerrand
78c4d50d25 doc: document go1.1 build tag
Fixes #5235.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8426048
2013-04-08 11:41:01 +10:00
Dmitriy Vyukov
b6bfc92df3 runtime: fix race on hashmap flags field
Use atomic operations on flags field to make sure we aren't
losing a flag update during parallel map operations.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/8377046
2013-04-07 18:19:16 -07:00
Alexei Sholik
f4de042e2c go/ast: fix typo in Fprint documentation
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8499043
2013-04-07 16:50:23 -07:00
David Symonds
2be84a8c2b undo CL 8363045 / a3ce42f9748b
It changes an exported API, and breaks the build.

««« original CL description
reflect: use unsafe.Pointer in StringHeader and SliceHeader

Relates to issue 5193.

R=r
CC=golang-dev
https://golang.org/cl/8363045
»»»

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8357051
2013-04-08 07:59:47 +10:00
Jan Ziak
487721fd0d reflect: use unsafe.Pointer in StringHeader and SliceHeader
Relates to issue 5193.

R=r
CC=golang-dev
https://golang.org/cl/8363045
2013-04-07 23:33:40 +02:00
Albert Strasheim
4235fa8f2a runtime, runtime/debug, runtime/race: deflake tests
R=golang-dev, dvyukov, bradfitz
CC=golang-dev
https://golang.org/cl/8366044
2013-04-07 11:37:37 -07:00
Albert Strasheim
dc7daa550a lib9: handle empty TMPDIR more gracefully.
Before, an empty TMPDIR would lead to:
cannot create <nil>/go.o: No such file or directory

R=golang-dev, iant, dave, bradfitz
CC=golang-dev
https://golang.org/cl/8355045
2013-04-07 11:16:15 -07:00
Albert Strasheim
114f20532e runtime: gofmt -s
R=golang-dev, iant, dave
CC=golang-dev
https://golang.org/cl/8253045
2013-04-07 18:37:32 +10:00
Dmitriy Vyukov
0b5d55984f runtime: fix deadlock in network poller
The invariant is that there must be at least one running P or a thread polling network.
It was broken.
Fixes #5216.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/8459043
2013-04-06 22:27:54 -07:00
Ian Lance Taylor
6732ad94c7 runtime: make CgoMal alloc field void*
This makes it an unsafe.Pointer in Go so the garbage collector
will treat it as a pointer to untyped data, not a pointer to
bytes.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/8286045
2013-04-06 20:18:15 -07:00
Dmitriy Vyukov
58030c541b runtime: change Note from union to struct
Unions can break precise GC.
Update #5193.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8362046
2013-04-06 20:09:02 -07:00
Dmitriy Vyukov
d617454379 runtime: change Lock from union to struct
Unions can break precise GC.
Update #5193.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8457043
2013-04-06 20:07:07 -07:00
Dmitriy Vyukov
60682c4f59 runtime: replace unions with structs
Unions can break precise GC.
Update #5193.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8456043
2013-04-06 20:02:49 -07:00
Dmitriy Vyukov
cfe336770b runtime: replace union in MHeap with a struct
Unions break precise GC.
Update #5193.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8368044
2013-04-06 20:02:03 -07:00
Dmitriy Vyukov
54340bf56f runtime: reset dangling typed pointer
+untype it because it can point to different types
Update #5193.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8454043
2013-04-06 20:01:28 -07:00
Dmitriy Vyukov
77354c39f9 runtime: reset typed dangling pointer
If for whatever reason seh points into Go heap region,
the dangling pointer will cause memory corruption during GC.
Update #5193.

R=golang-dev, alex.brainman, iant
CC=golang-dev
https://golang.org/cl/8402045
2013-04-06 20:00:45 -07:00
John Howard Palevich
1142c2f418 cmd/go: fix capitalization of Bitbucket, document Git support
Fixes #5226.

R=golang-dev, minux.ma, iant
CC=golang-dev
https://golang.org/cl/8320044
2013-04-07 04:06:11 +08:00
Jonathan Rudenberg
07c70629c2 net/http: fix typo in ErrMissingBoundary
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8429045
2013-04-05 15:23:03 -07:00
Rémy Oudompheng
2d3216f4a8 cmd/gc: fix Offsetof computation.
The offset of an embedded field s.X must be relative to s
and not to the implicit s.Field of which X is a direct field.
Moreover, no indirections may happen on the path.

Fixes #4909.

R=nigeltao, ality, daniel.morsing, iant, gri, r
CC=golang-dev
https://golang.org/cl/8287043
2013-04-05 21:24:07 +02:00
Volker Dobler
03048ae454 testing: structure package documentation
Makes finding the relevant information much easier.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/8353045
2013-04-05 13:43:18 +11:00
Brad Fitzpatrick
b6a39a2545 strconv: remove some test TODOs and adjust malloc limits lower
These no longer allocate.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/8340047
2013-04-04 17:04:18 -07:00