]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
8 years agoruntime: don't free large spans until heapBitsSweepSpan returns go1.5beta2
Austin Clements [Thu, 16 Jul 2015 20:27:09 +0000 (16:27 -0400)]
runtime: don't free large spans until heapBitsSweepSpan returns

This fixes a race between 1) sweeping and freeing an unmarked large
span and 2) reusing that span and allocating from it. This race arises
because mSpan_Sweep returns spans for large objects to the heap
*before* heapBitsSweepSpan clears the mark bit on the object in the
span.

Specifically, the following sequence of events can lead to an
incorrectly zeroed bitmap byte, which causes the garbage collector to
not trace any pointers in that object (the pointer bits for the first
four words are cleared, and the scan bits are also cleared, so it
looks like a no-scan object).

1) P0 calls mSpan_Sweep on a large span S0 with an unmarked object on it.

2) mSpan_Sweep calls heapBitsSweepSpan, which invokes the callback for
   the one (unmarked) object on the span.

3) The callback calls mHeap_Free, which makes span S0 available for
   allocation, but this is too early.

4) P1 grabs this S0 from the heap to use for allocation.

5) P1 allocates an object on this span and writes that object's type
   bits to the bitmap.

6) P0 returns from the callback to heapBitsSweepSpan.
   heapBitsSweepSpan clears the byte containing the mark, even though
   this span is now owned by P1 and this byte contains important
   bitmap information.

This fixes this problem by simply delaying the mHeap_Free until after
the heapBitsSweepSpan. I think the overall logic of mSpan_Sweep could
be simplified now, but this seems like the minimal change.

Fixes #11617.

Change-Id: I6b1382c7e7cc35f81984467c0772fe9848b7522a
Reviewed-on: https://go-review.googlesource.com/12320
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/fix: add gotypes module
Rob Pike [Thu, 16 Jul 2015 03:47:01 +0000 (13:47 +1000)]
cmd/fix: add gotypes module

Adjusts for the move from golang.org/x/tools/go/types and .../go/exact
to go/types and go/constant in the main repository.

Change-Id: I0da7248c540939e3e9b09c915b0a296937f1be73
Reviewed-on: https://go-review.googlesource.com/12284
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/go: don't put mycmd in wrong directory
Mikio Hara [Thu, 16 Jul 2015 06:41:34 +0000 (15:41 +0900)]
cmd/go: don't put mycmd in wrong directory

Change-Id: Ia7cc1d52211b32a2eb2b3888d621b28d6932aca9
Reviewed-on: https://go-review.googlesource.com/12290
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/mail: add example to package
Carlos C [Thu, 9 Jul 2015 13:08:39 +0000 (15:08 +0200)]
net/mail: add example to package

Change-Id: I912cafc66463f81cde839afc8f06b7eadcbf6f57
Reviewed-on: https://go-review.googlesource.com/11992
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoA+C: more updates
Brad Fitzpatrick [Thu, 16 Jul 2015 21:40:35 +0000 (14:40 -0700)]
A+C: more updates

Update #10639

Change-Id: I2d7817ac0aefb5dd2569d7e83afbc51851e24b42
Reviewed-on: https://go-review.googlesource.com/12321
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet: RFC 6724 address selection
Brad Fitzpatrick [Thu, 16 Jul 2015 00:02:06 +0000 (17:02 -0700)]
net: RFC 6724 address selection

At least the most important parts, I think.

Fixes #10552

Change-Id: I1a03c5405bdbef337e0245d226e9247d3d067393
Reviewed-on: https://go-review.googlesource.com/12246
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agocrypto/x509: iOS build tag
David Crawshaw [Thu, 16 Jul 2015 17:14:56 +0000 (13:14 -0400)]
crypto/x509: iOS build tag

The iOS simulator compiles with GOOS=darwin GOARCH=386, and x509
sets the inappropriate flag -mmacosx-version-min=10.6. Condition
its compilation on the absence of an "ios" build tag.

Fixes #11736.

Change-Id: I4aa230643347320c3cb9d03b972734b2e0db930e
Reviewed-on: https://go-review.googlesource.com/12301
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agonet/url: add example to URL.ResolveReference
Carlos C [Thu, 9 Jul 2015 13:08:39 +0000 (15:08 +0200)]
net/url: add example to URL.ResolveReference

Change-Id: I9db1997b8dc7e06e9d124753ead6221470a1edf9
Reviewed-on: https://go-review.googlesource.com/12254
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agodoc: describe tracing, mention go fix
Rob Pike [Thu, 16 Jul 2015 04:45:46 +0000 (14:45 +1000)]
doc: describe tracing, mention go fix

Also add a link to a couple of the talks from GopherCon 2015.

Change-Id: I11e1c550e999553163d3fb5e900f167c849ce33f
Reviewed-on: https://go-review.googlesource.com/12287
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoflag: add comment stating that Set is called in sequence across the command line
Rob Pike [Thu, 16 Jul 2015 04:30:15 +0000 (14:30 +1000)]
flag: add comment stating that Set is called in sequence across the command line

No code changes.

Change-Id: I3b78b1048318a4b80747fde8cab919282fc444a8
Reviewed-on: https://go-review.googlesource.com/12285
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agotest/fixedbugs: disable issue11656.go on arm64
Russ Cox [Thu, 16 Jul 2015 02:08:27 +0000 (22:08 -0400)]
test/fixedbugs: disable issue11656.go on arm64

For #11656.

Change-Id: I8365d33a15419bd0e54f71182ad0994e41650264
Reviewed-on: https://go-review.googlesource.com/12248
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoRevert "runtime: diagnose invalid pointers during GC"
Russ Cox [Thu, 16 Jul 2015 01:49:47 +0000 (01:49 +0000)]
Revert "runtime: diagnose invalid pointers during GC"

Broke arm64. Update #9880.

This reverts commit 38d9b2a3a942892193195a6912ab23cdaff23e20.

Change-Id: I35fa21005af2183828a9d8b195ebcfbe45ec5138
Reviewed-on: https://go-review.googlesource.com/12247
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoimage/color: fix format typo in the tests.
Nigel Tao [Thu, 16 Jul 2015 01:13:42 +0000 (11:13 +1000)]
image/color: fix format typo in the tests.

Change-Id: I6f79d201aa4e8c0e3be8d965f14ed36518536036
Reviewed-on: https://go-review.googlesource.com/12281
Reviewed-by: Rob Pike <r@golang.org>
8 years agoA+C: Add missing entries, full names.
Chris Broadfoot [Thu, 16 Jul 2015 00:12:43 +0000 (10:12 +1000)]
A+C: Add missing entries, full names.

Updates #10639

Change-Id: Ifece75b8d1d822869df8abf654725a00bef4fc25
Reviewed-on: https://go-review.googlesource.com/12280
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoRevert "cmd/internal/obj: fix pc/sp information for prologue"
Russ Cox [Wed, 15 Jul 2015 23:28:31 +0000 (23:28 +0000)]
Revert "cmd/internal/obj: fix pc/sp information for prologue"

This seems to have broken arm64 in a mysterious way. Will try again later.

This reverts commit 0a3c991fd330276f6876c401541dcbacbb860985.

Change-Id: Ic1b53413c4168977a27381d9cc6fb8d9d7cbb780
Reviewed-on: https://go-review.googlesource.com/12245
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agonet/http: don't reuse conns after incomplete 100-continue requests
Brad Fitzpatrick [Sun, 5 Jul 2015 16:15:11 +0000 (09:15 -0700)]
net/http: don't reuse conns after incomplete 100-continue requests

If we receive an HTTP request with "Expect: 100-continue" and the
Handler never read to EOF, the conn is in an unknown state.
Don't reuse that connection.

Fixes #11549

Change-Id: I5be93e7a54e899d615b05f72bdcf12b25304bc60
Reviewed-on: https://go-review.googlesource.com/12262
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agoA+C: more updates, including Medium corporate CLA
Brad Fitzpatrick [Wed, 15 Jul 2015 21:42:14 +0000 (14:42 -0700)]
A+C: more updates, including Medium corporate CLA

Updates #10639

Change-Id: I0958e150f6eab122095bfc148746a38028b72dbc
Reviewed-on: https://go-review.googlesource.com/12263
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/go: fix parsing of Git SCP-like remotes
Andrew Gerrand [Wed, 15 Jul 2015 08:36:49 +0000 (18:36 +1000)]
cmd/go: fix parsing of Git SCP-like remotes

Now that we care about the protocol of Git remotes (for the -insecure
flag), we need to recognize and parse the SCP-like remote format.

Fixes golang/go#11457

Change-Id: Ia26132274fafb1cbfefe2475f7ac5f17ccd6da40
Reviewed-on: https://go-review.googlesource.com/12226
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: fix saved PC/SP after safe-point function in syscall
Austin Clements [Mon, 13 Jul 2015 22:30:10 +0000 (18:30 -0400)]
runtime: fix saved PC/SP after safe-point function in syscall

Running a safe-point function on syscall entry uses systemstack() and
hence clobbers g.sched.pc and g.sched.sp. Fix this by re-saving them
after the systemstack, just like in the other uses of systemstack in
reentersyscall.

Change-Id: I47868a53eba24d81919fda56ef6bbcf72f1f922e
Reviewed-on: https://go-review.googlesource.com/12125
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: run safe-point function before entering _Psyscall
Austin Clements [Mon, 13 Jul 2015 22:27:24 +0000 (18:27 -0400)]
runtime: run safe-point function before entering _Psyscall

Currently, we run a P's safe-point function immediately after entering
_Psyscall state. This is unsafe, since as soon as we put the P in
_Psyscall, we no longer control the P and another M may claim it.
We'll still run the safe-point function only once (because doing so
races on an atomic), but the P may no longer be at a safe-point when
we do so.

In particular, this means that the use of forEachP to dispose all P's
gcw caches is unsafe. A P may enter a syscall, run the safe-point
function, and dispose the P's gcw cache concurrently with another M
claiming the P and attempting to use its gcw cache. If this happens,
we may empty the gcw's workbuf after putting it on
work.{full,partial}, or add pointers to it after putting it in
work.empty. This will cause an assertion failure when we later pop the
workbuf from the list and its object count is inconsistent with the
list we got it from.

Fix this by running the safe-point function just before putting the P
in _Psyscall.

Related to #11640. This probably fixes this issue, but while I'm able
to show that we can enter a bad safe-point state as a result of this,
I can't reproduce that specific failure.

Change-Id: I6989c8ca7ef2a4a941ae1931e9a0748cbbb59434
Reviewed-on: https://go-review.googlesource.com/12124
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: fix go:nowritebarrier annotation on gcmarkwb_m
Matthew Dempsky [Wed, 15 Jul 2015 20:27:30 +0000 (13:27 -0700)]
runtime: fix go:nowritebarrier annotation on gcmarkwb_m

Change-Id: I945d46d3bb63f1992bce0d0b1e89e75cac9bbd54
Reviewed-on: https://go-review.googlesource.com/12271
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: recognize embedded field in inlined function
Ian Lance Taylor [Wed, 15 Jul 2015 05:17:41 +0000 (22:17 -0700)]
cmd/compile: recognize embedded field in inlined function

There was already special code to recognize "?" in hidden_structdcl,
which is used for inlined types and variables.  This recognizes "?" in
structdcl as well, a case that arises when a struct type appears
within an inlined function body.

Fixes #10219.

Change-Id: Ic5257ae54f817e0d4a189c2294dcd633c9f2101a
Reviewed-on: https://go-review.googlesource.com/12241
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoencoding/json: document and test overwrite of slice, map during Unmarshal
Russ Cox [Wed, 15 Jul 2015 01:32:47 +0000 (21:32 -0400)]
encoding/json: document and test overwrite of slice, map during Unmarshal

Fixes #8837.

Change-Id: Iaaecbb0b324004cb74b16b764126b01315e6a16e
Reviewed-on: https://go-review.googlesource.com/12209
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoasm: fix error messages and comments for "register pair"
Rob Pike [Wed, 15 Jul 2015 02:41:08 +0000 (12:41 +1000)]
asm: fix error messages and comments for "register pair"

The parser treats (R1+R2) on ppc64 the same as (R1,R2) on arm,
but it is not strictly a "register pair". Improve the text.

No semantic change.

Change-Id: Ib8b14881c6467add0d53150a901c01e962afb28b
Reviewed-on: https://go-review.googlesource.com/12212
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: diagnose invalid pointers during GC
Russ Cox [Mon, 8 Jun 2015 03:42:03 +0000 (23:42 -0400)]
runtime: diagnose invalid pointers during GC

For #9880. Let's see what breaks.

Change-Id: Ic8b99a604e60177a448af5f7173595feed607875
Reviewed-on: https://go-review.googlesource.com/10818
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>

8 years agocmd/compile: fix PtrTo(t) for unnamed t with embedded fields
Russ Cox [Wed, 15 Jul 2015 04:01:54 +0000 (00:01 -0400)]
cmd/compile: fix PtrTo(t) for unnamed t with embedded fields

Fixes #8427.

Change-Id: I826a3bc4519845ad30d6dbaf058fe7ed7bee8db0
Reviewed-on: https://go-review.googlesource.com/12233
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agomath: fix Log2 test failures on ppc64 (and s390)
Russ Cox [Wed, 15 Jul 2015 02:42:16 +0000 (22:42 -0400)]
math: fix Log2 test failures on ppc64 (and s390)

- Make Log2 exact for powers of two.
- Fix error tolerance function to make tolerance
  a function of the correct (expected) value.

Fixes #9066.

Change-Id: I0320a93ce4130deed1c7b7685627d51acb7bc56d
Reviewed-on: https://go-review.googlesource.com/12230
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoencoding/json: fix out of phase error unmarshaling non-string into TextUnmarshaler
Russ Cox [Tue, 14 Jul 2015 23:31:44 +0000 (19:31 -0400)]
encoding/json: fix out of phase error unmarshaling non-string into TextUnmarshaler

Fixes #9650.

Change-Id: I45b879124691e485b86c1e99a3227032283850d2
Reviewed-on: https://go-review.googlesource.com/12208
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agonet/smtp: give example addrs in docs
Russ Cox [Wed, 15 Jul 2015 03:33:29 +0000 (23:33 -0400)]
net/smtp: give example addrs in docs

Fixes #9140.

Change-Id: I3b85053262cac3c30358f8e03a5aca65dbc67623
Reviewed-on: https://go-review.googlesource.com/12231
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: print all test flags in "go test -h"
Russ Cox [Tue, 14 Jul 2015 05:08:30 +0000 (01:08 -0400)]
cmd/go: print all test flags in "go test -h"

Originally 'go test -h' printed the output of 'go help test'.
Then issue #6576 was filed, because that output didn't list (for example) -bench.
CL 14502065 changed 'go test -h' to print the output of 'go help testflag'.
Then issue #9209 was filed, because that output didn't list (for example) -c.

To print all the relevant flags, parts of both 'go help test' and 'go help testflag'
are needed. Refactor the help messages to make those parts available
and print them.

Fixes #9209.

Change-Id: Ie8205b8fb37d00c10d25b3fc98f14286ec46c4e3
Reviewed-on: https://go-review.googlesource.com/12173
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/dist: diagnose lack of gcc earlier in build
Russ Cox [Tue, 14 Jul 2015 02:27:10 +0000 (22:27 -0400)]
cmd/dist: diagnose lack of gcc earlier in build

Fixes #10731.

Change-Id: I105629b03fd3323c0a2ca5b6b0fd35ee92b7fd2e
Reviewed-on: https://go-review.googlesource.com/12146
Reviewed-by: Rob Pike <r@golang.org>
8 years agoimage/color: tweak the YCbCr to RGBA conversion formula.
Nigel Tao [Wed, 15 Jul 2015 04:55:02 +0000 (14:55 +1000)]
image/color: tweak the YCbCr to RGBA conversion formula.

Before, calling the RGBA method of YCbCr color would return red values
in the range [0x0080, 0xff80]. After, the range is [0x0000, 0xffff] and
is consistent with what Gray colors' RGBA method returns. In particular,
pure black, pure white and every Gray color in between are now exactly
representable as a YCbCr color.

This fixes a regression from Go 1.4 (where YCbCr{0x00, 0x80, 0x80} was
no longer equivalent to pure black), introduced by golang.org/cl/8073 in
the Go 1.5 development cycle. In Go 1.4, the +0x80 rounding was not
noticable when Cb == 0x80 && Cr == 0x80, because the YCbCr to RGBA
conversion truncated to 8 bits before multiplying by 0x101, so the
output range was [0x0000, 0xffff].

The TestYCbCrRoundtrip fuzzy-match tolerance grows from 1 to 2 because
the YCbCr to RGB conversion now maps to an ever-so-slightly larger
range, along with the usual imprecision of accumulating rounding errors.

Also s/int/int32/ in ycbcr.go. The conversion shouldn't overflow either
way, as int is always at least 32 bits, but it does make it clearer that
the computation doesn't depend on sizeof(int).

Fixes #11691

Change-Id: I538ca0adf7e040fa96c5bc8b3aef4454535126b9
Reviewed-on: https://go-review.googlesource.com/12220
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: fix nocgo builder
Russ Cox [Wed, 15 Jul 2015 05:16:47 +0000 (01:16 -0400)]
cmd/go: fix nocgo builder

Change-Id: I0f167d9769d9b6b9888c13fcb48e538fc87aa1b7
Reviewed-on: https://go-review.googlesource.com/12240
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agotime: make it clearer how to format a fractional second
Rob Pike [Wed, 15 Jul 2015 05:02:38 +0000 (15:02 +1000)]
time: make it clearer how to format a fractional second

Fixes #10963.

Change-Id: I8d769b4d25b306f2df41f882ec01d97bbd63171d
Reviewed-on: https://go-review.googlesource.com/12221
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoos/exec: document that Cmd.Wait waits for stdin I/O
Russ Cox [Wed, 15 Jul 2015 03:48:34 +0000 (23:48 -0400)]
os/exec: document that Cmd.Wait waits for stdin I/O

Fixes #10338.

Change-Id: Ib86cb9a6c694b1e442a9957153c7ca38a7d11c3e
Reviewed-on: https://go-review.googlesource.com/12232
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoreflect: wait longer before declaring select test stuck
Russ Cox [Wed, 15 Jul 2015 04:04:27 +0000 (00:04 -0400)]
reflect: wait longer before declaring select test stuck

Fixes #9427.

Change-Id: If8094d4d4f6737c03d83e08e177c2a7f0ff9d89f
Reviewed-on: https://go-review.googlesource.com/12234
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/go: add test for issue 3652
Russ Cox [Tue, 14 Jul 2015 19:24:26 +0000 (15:24 -0400)]
cmd/go: add test for issue 3652

Fixes #3652. (Well, already fixed, but tests that it stays fixed.)

Change-Id: I4e17f595ee2ad513de86ac3861e8e66b1230b3be
Reviewed-on: https://go-review.googlesource.com/12195
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: fix build
Russ Cox [Wed, 15 Jul 2015 04:51:24 +0000 (00:51 -0400)]
cmd/go: fix build

Failures noted by dashboard.

Change-Id: I22f90120c6687b64b9efff9df7a7fa8f26d24bac
Reviewed-on: https://go-review.googlesource.com/12207
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/go: accept go get domain.root
Russ Cox [Tue, 14 Jul 2015 19:08:10 +0000 (15:08 -0400)]
cmd/go: accept go get domain.root

Fixes #9357.

Change-Id: I11f0652758c4ea80debec29c3b99a72baca6d745
Reviewed-on: https://go-review.googlesource.com/12193
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: fix go get -u handling of changing dependencies
Russ Cox [Tue, 14 Jul 2015 18:52:04 +0000 (14:52 -0400)]
cmd/go: fix go get -u handling of changing dependencies

Fixes #9224.

Change-Id: Ie0f4f14407099e4fa7ebe361a95b6492012928a2
Reviewed-on: https://go-review.googlesource.com/12192
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: disable password prompt when running git
Russ Cox [Tue, 14 Jul 2015 05:22:53 +0000 (01:22 -0400)]
cmd/go: disable password prompt when running git

This fix only works on Git 2.3.0 and later.

There appears to be no portable way to fix the earlier versions.
We already run git with stdin closed, but on Unix git calls getpass,
which opens /dev/tty itself. We could do package syscall-specific
things to get /dev/tty invalidated during the exec, but I'd really
rather not. And on Windows, Git opens "CONIN$" and "CONOUT$"
itself, and I have no idea how to invalidate those.

Fix the problem for newish Git versions and wait for people to update.
Best we can do.

Fixes #9341.

Change-Id: I576579b106764029853e0f74d411e19108deecf5
Reviewed-on: https://go-review.googlesource.com/12175
Reviewed-by: Rob Pike <r@golang.org>
8 years agodatabase/sql: document closing requirements for Stmts
Russ Cox [Tue, 14 Jul 2015 20:28:28 +0000 (16:28 -0400)]
database/sql: document closing requirements for Stmts

Fixes #8952.

Change-Id: I678f9706eccb5a344eeb0244f45b7b7669830bdc
Reviewed-on: https://go-review.googlesource.com/12204
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocrypto/x509: add /etc/ssl/cacert.pem to OmniOS cert search list
Russ Cox [Tue, 14 Jul 2015 20:20:13 +0000 (16:20 -0400)]
crypto/x509: add /etc/ssl/cacert.pem to OmniOS cert search list

Fixes #9146.

Change-Id: If5cb5ae92a201825b9ff32b3d0edfa032b9a0965
Reviewed-on: https://go-review.googlesource.com/12203
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/pprof: store temporary files in temporary directory
Russ Cox [Tue, 14 Jul 2015 19:43:33 +0000 (15:43 -0400)]
cmd/pprof: store temporary files in temporary directory

Fixes #9180.

Change-Id: Id5adaea0ca9005946fb89c88a10c6f59d8c0943c
Reviewed-on: https://go-review.googlesource.com/12202
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/pprof: run $BROWSER and system browser before Chrome
Russ Cox [Tue, 14 Jul 2015 19:38:46 +0000 (15:38 -0400)]
cmd/pprof: run $BROWSER and system browser before Chrome

Fixes #10259.

Change-Id: Ica6b8301cc8291785a3c496fb513050813b2d8df
Reviewed-on: https://go-review.googlesource.com/12201
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/go: fix TestVendorRun when $GOROOT is inside a symlinked path
Russ Cox [Tue, 14 Jul 2015 19:15:37 +0000 (15:15 -0400)]
cmd/go: fix TestVendorRun when $GOROOT is inside a symlinked path

Fixes #11305.

Change-Id: Icaa3a009aa4ab214c9aaf74f52c3e622fa266a9d
Reviewed-on: https://go-review.googlesource.com/12194
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: reject missing source code in go get -d, same as go get -d -u
Russ Cox [Tue, 14 Jul 2015 06:17:39 +0000 (02:17 -0400)]
cmd/go: reject missing source code in go get -d, same as go get -d -u

Fixes #11090.

Change-Id: I1518df7a48346b175ec80079a07225901fdd51fb
Reviewed-on: https://go-review.googlesource.com/12177
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: give full import stack for errors in dependencies of test dependencies
Russ Cox [Tue, 14 Jul 2015 05:56:51 +0000 (01:56 -0400)]
cmd/go: give full import stack for errors in dependencies of test dependencies

Fixes #9558.

Change-Id: I68506af58088155d38d492b49b19c5fc2048b087
Reviewed-on: https://go-review.googlesource.com/12176
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: go test -race -i runtime/race must not install race-enabled cmd/cgo
Russ Cox [Tue, 14 Jul 2015 05:14:08 +0000 (01:14 -0400)]
cmd/go: go test -race -i runtime/race must not install race-enabled cmd/cgo

Fix now uses same test as 'go build'.

Fixes #10500.

Change-Id: I2fcf2d95430643370aa29165d89a188988dee446
Reviewed-on: https://go-review.googlesource.com/12174
Reviewed-by: Rob Pike <r@golang.org>
8 years agodoc: add cmd/go's -pkgdir build option
Russ Cox [Tue, 14 Jul 2015 04:34:36 +0000 (00:34 -0400)]
doc: add cmd/go's -pkgdir build option

Also use more consistent language for the new build options.

Change-Id: I88cbe200c13f452713be73d2e00337ddb793b8c6
Reviewed-on: https://go-review.googlesource.com/12172
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: add -pkgdir build flag
Russ Cox [Tue, 14 Jul 2015 04:27:59 +0000 (00:27 -0400)]
cmd/go: add -pkgdir build flag

Fixes #10210.

Change-Id: I82ddd665bca31773b1fb1b056338c04818ef68f5
Reviewed-on: https://go-review.googlesource.com/12171
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: remove duplication of build flag info in testflag.go
Russ Cox [Tue, 14 Jul 2015 04:04:50 +0000 (00:04 -0400)]
cmd/go: remove duplication of build flag info in testflag.go

Also adds to 'go test' all the build flags that were missing
due to inconsistency in the duplication (for example, -toolexec).

Fixes #10504.

Change-Id: I1935b5caa13d5e551a0483904adffa8877087df7
Reviewed-on: https://go-review.googlesource.com/12170
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: fix error for go run with files in different directories
Russ Cox [Tue, 14 Jul 2015 03:31:14 +0000 (23:31 -0400)]
cmd/go: fix error for go run with files in different directories

Fixes #9853.

Change-Id: Ic4803aa499ca20215085a87bad649014984d84c8
Reviewed-on: https://go-review.googlesource.com/12149
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: document that <meta> tags should be early in the HTML for go get
Russ Cox [Tue, 14 Jul 2015 02:55:26 +0000 (22:55 -0400)]
cmd/go: document that <meta> tags should be early in the HTML for go get

While we are here, fix a few things not updated for -insecure.

Fixes #8163.

Change-Id: Ib80c9ac00d6b61cce26c3d20bee3d30ab9af1331
Reviewed-on: https://go-review.googlesource.com/12148
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: diagnose trivial test import cycle
Russ Cox [Tue, 14 Jul 2015 02:39:17 +0000 (22:39 -0400)]
cmd/go: diagnose trivial test import cycle

Was detecting only non-trivial ones.

Fixes #9690.

Change-Id: I662d81dd4818ddf29592057c090805772c84287b
Reviewed-on: https://go-review.googlesource.com/12147
Reviewed-by: Rob Pike <r@golang.org>
8 years agoRevert "cmd/compile: define func value symbols at declaration"
Russ Cox [Wed, 15 Jul 2015 04:11:26 +0000 (04:11 +0000)]
Revert "cmd/compile: define func value symbols at declaration"

This reverts commit 3b411bf1a1bb08d6868083981cecba8088dc7aea.

Change-Id: I321a43fa378a43b3e4d7aa97e0222775640af64b
Reviewed-on: https://go-review.googlesource.com/12205
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: define func value symbols at declaration
Russ Cox [Tue, 14 Jul 2015 00:50:51 +0000 (20:50 -0400)]
cmd/compile: define func value symbols at declaration

These used to be defined at use, but that breaks when shared libraries
are involved.

For #11480.

Change-Id: I416a848754fb615c0d75f9f0ccc00723d07f7f01
Reviewed-on: https://go-review.googlesource.com/12145
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/internal/obj: fix pc/sp information for prologue
Russ Cox [Tue, 14 Jul 2015 01:21:49 +0000 (21:21 -0400)]
cmd/internal/obj: fix pc/sp information for prologue

When the prologue call to morestack was moved down to the
bottom of the function, the pc/sp tables were not updated.
If a traceback through a call to morestack is needed, it would
get confused at and stop at morestack.

Confirmed the fix by adding //go:systemstack (which calls
morestackc, but same issue) where it did not belong
and inspecting the crash.

Change-Id: Id0294bb9dba51ef1a49154637228fb57f1086a94
Reviewed-on: https://go-review.googlesource.com/12144
Reviewed-by: Rob Pike <r@golang.org>
8 years agonet/http: do not allow space or slash in Host headers
Jeff R. Allen [Thu, 18 Jun 2015 10:37:26 +0000 (12:37 +0200)]
net/http: do not allow space or slash in Host headers

A malformed Host header can result in a malformed HTTP request.
Clean them to avoid this.

Updates #11206. We may come back and make this stricter for 1.6.

Change-Id: I23c7d821cd9dbf66c3c15d26750f305e3672d984
Reviewed-on: https://go-review.googlesource.com/11241
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agonet: fix setKeepAlivePeriod on Plan 9
David du Colombier [Thu, 2 Jul 2015 06:36:45 +0000 (08:36 +0200)]
net: fix setKeepAlivePeriod on Plan 9

The interface to set TCP keepalive on Plan 9 is
writing the "keepalive n" string to the TCP ctl file,
where n is the milliseconds between keepalives.

Fixes #11266.

Change-Id: Ic96f6c584063665a1ddf921a9a4ddfa13cc7501b
Reviewed-on: https://go-review.googlesource.com/11860
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agodoc: add a few more details about arm and ppc64 to asm.html
Rob Pike [Tue, 14 Jul 2015 00:24:40 +0000 (10:24 +1000)]
doc: add a few more details about arm and ppc64 to asm.html

Update #10096

Arm64 and Ppc64 are still pretty sketchy.

Change-Id: Iaf821b0f17bad8c71d338d45de75d4a345cac2dd
Reviewed-on: https://go-review.googlesource.com/12160
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agogo/types: fix internal inInteger operand predicate
Robert Griesemer [Fri, 10 Jul 2015 22:11:06 +0000 (16:11 -0600)]
go/types: fix internal inInteger operand predicate

When testing if a value is an integer, if the value is a constant,
don't ignore the type if it has one.

Fixes #11594.

Change-Id: I2ff387e4f9e8ab7cae35c4838350e0a1fce2e625
Reviewed-on: https://go-review.googlesource.com/12045
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agoencoding/xml: improve marshaller sanity checks of directives
Didier Spezia [Sat, 27 Jun 2015 13:07:22 +0000 (13:07 +0000)]
encoding/xml: improve marshaller sanity checks of directives

When building a directive, the current sanity check prevents
a '>' to be used, which makes a DOCTYPE directive with an
internal subset be rejected. It is accepted by the parser
though, so what can be parsed cannot be encoded.

Improved the corresponding sanity check to mirror the behavior
of the parser (in the way it handles angle brackets, quotes,
and comments).

Fixes #10158

Change-Id: Ieffea9f870f2694548e12897f8f47babc0ea4414
Reviewed-on: https://go-review.googlesource.com/11630
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agodoc/go1.5.html: fix and expand crypto/tls changes
Jonathan Rudenberg [Tue, 14 Jul 2015 23:16:01 +0000 (19:16 -0400)]
doc/go1.5.html: fix and expand crypto/tls changes

- Fix incomplete description of minimum protocol version.
- Add mention of the new ConnectionState.OCSPResponse field.
- Clarify session ticket key rotation description.

Change-Id: I6b62d30a4d0e0f84fd2c0e70e8f66ec14e6a5a90
Reviewed-on: https://go-review.googlesource.com/12197
Reviewed-by: Rob Pike <r@golang.org>
8 years agoA+C: more updates before release
Brad Fitzpatrick [Wed, 15 Jul 2015 01:29:49 +0000 (18:29 -0700)]
A+C: more updates before release

Includes subrepos and some special cases.

Updates #10639

Change-Id: I3c9ad4f6ec689903f88ccf5599d93a338e3eec4d
Reviewed-on: https://go-review.googlesource.com/12211
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoencoding/json: Only allow string option for valid types
Larz Conwell [Sun, 17 May 2015 03:01:39 +0000 (23:01 -0400)]
encoding/json: Only allow string option for valid types

The "string" option only applies for strings, floats, integers, and
booleans as per the documentation. So when decoding ignore the "string"
option if the value is not of one of the types mentioned. This matches
the Marshal step which also ignores the "string" option for invalid
types.

Fixes #9812

Change-Id: I0fb2b43d0668bc0e2985886d989abbf2252070e2
Reviewed-on: https://go-review.googlesource.com/10183
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoA+C: update for release
Brad Fitzpatrick [Wed, 15 Jul 2015 00:35:58 +0000 (17:35 -0700)]
A+C: update for release

This is an automated update for the main branch of the main repo.
Some special cases and other repos will follow.

Updates #10639

Change-Id: I4b149c037e9292b7e323a9f4c009092ce6b70ce5
Reviewed-on: https://go-review.googlesource.com/12159
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc/go1.5.html: fix typo
Jonathan Rudenberg [Tue, 14 Jul 2015 23:22:24 +0000 (19:22 -0400)]
doc/go1.5.html: fix typo

This is the first mention of the fmt package in the changes list.

Change-Id: I5d378d8707e6735e0e590527db4196b517fefd72
Reviewed-on: https://go-review.googlesource.com/12198
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc/go1.5.html: fix typo
Jonathan Rudenberg [Tue, 14 Jul 2015 22:53:13 +0000 (18:53 -0400)]
doc/go1.5.html: fix typo

Change-Id: I8bbdf6c769e089fca8458166dffff5aea0f74675
Reviewed-on: https://go-review.googlesource.com/12196
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocrypto: add SHA-512/224 and SHA-512/256 as described in FIPS 180-4
Nevins Bartolomeo [Wed, 3 Jun 2015 20:55:41 +0000 (16:55 -0400)]
crypto: add SHA-512/224 and SHA-512/256 as described in FIPS 180-4

Change-Id: Ifbab8203dea1eb0df4c834df22e12cb7c37c14fd
Reviewed-on: https://go-review.googlesource.com/10683
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

8 years agocmd/go: do not create subdirs of $GOBIN
David Crawshaw [Sat, 11 Jul 2015 15:28:16 +0000 (11:28 -0400)]
cmd/go: do not create subdirs of $GOBIN

Fixes #9769.

Change-Id: I2959906c71d0ce62cdb750dab78eab631a26f229
Reviewed-on: https://go-review.googlesource.com/12080
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/go: warn on get from code.google.com that it is shutting down
Ian Lance Taylor [Sat, 11 Jul 2015 13:42:48 +0000 (06:42 -0700)]
cmd/go: warn on get from code.google.com that it is shutting down

Fixes #10193.

Change-Id: Ibbb747babb697a66b943e5da76b0ada41f1fb14f
Reviewed-on: https://go-review.googlesource.com/12070
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agodoc/go1.5.html: fix typo.
Ian Lance Taylor [Tue, 14 Jul 2015 15:14:03 +0000 (08:14 -0700)]
doc/go1.5.html: fix typo.

Fixes #11704.

Change-Id: If103f8eca7e53b0120885e2ec086db12176ea078
Reviewed-on: https://go-review.googlesource.com/12155
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agoimage/jpeg: don't unread a byte if we've already taken bits from it.
Nigel Tao [Tue, 14 Jul 2015 05:46:18 +0000 (15:46 +1000)]
image/jpeg: don't unread a byte if we've already taken bits from it.

This rolls back most of golang.org/cl/8841, aka 2f98bac310, and makes a
different fix. It keeps the TestTruncatedSOSDataDoesntPanic test
introduced by that other CL, which obviously still passes after this CL.

Fixes #11650, a regression (introduced by cl/8841) from Go 1.4.

The original cl/8841 changed the image/jpeg not to panic on an input
given in #10387. We still do not panic on that input, after this CL.

I have a corpus of over 160,000 JPEG images, a sample of a web crawl.
The image/jpeg code ran happily over that whole corpus both before and
after this CL, although that corpus clearly didn't catch the regression
in the first place.

This code was otherwise tested manually. I don't think that it's trivial
to synthesize a JPEG input that happens to run out of Huffman data at
just the right place. The test image attached to #11650 obviously has
that property, but I don't think we can simply add that test image to
the repository: it's 227KiB, and I don't know its copyright status.

I also looked back over the issue tracker for problematic JPEGs that
people have filed. The Go code, after this CL, is still happy on these
files in my directory:
issue2362a.jpeg
issue3916.jpeg
issue3976.jpeg
issue4084.jpeg
issue4259.jpeg
issue4291.jpeg
issue4337.jpeg
issue4500.jpeg
issue4705.jpeg
issue4975.jpeg
issue5112.jpeg
issue6767.jpeg
issue9888.jpeg
issue10133.jpeg
issue10357.jpeg
issue10447.jpeg
issue11648.jpeg
issue11650.jpeg

There were other images attached in the issue tracker that aren't
actually valid JPEGs. They failed both before and after this CL:
broken-issue2362b.jpeg
broken-issue6450.jpeg
broken-issue8693.jpeg
broken-issue10154.jpeg
broken-issue10387.jpeg
broken-issue10388.jpeg
broken-issue10389.jpeg
broken-issue10413.jpeg

In summary, this CL fixes #11650 and, after some automated and manual
testing, I don't think introduces new regressions.

Change-Id: I30b67036e9b087f3051d57dac7ea05fb4fa36f66
Reviewed-on: https://go-review.googlesource.com/12163
Reviewed-by: Rob Pike <r@golang.org>
8 years agodoc: document behavior change in image/color in release notes
Rob Pike [Tue, 14 Jul 2015 05:20:19 +0000 (15:20 +1000)]
doc: document behavior change in image/color in release notes

Change-Id: I7ad90ab78abb8a39d56c837610d5c311a96b7039
Reviewed-on: https://go-review.googlesource.com/12162
Reviewed-by: Nigel Tao <nigeltao@golang.org>
8 years agoos/exec: fix plan9 build
Brad Fitzpatrick [Tue, 14 Jul 2015 05:13:32 +0000 (22:13 -0700)]
os/exec: fix plan9 build

Fixes build from https://golang.org/cl/12152

Plan 9 lacks syscall.EPIPE. I was misled by api/go1.txt and also
forgot to use the trybots. :(

Change-Id: I4982fe969ad4a8724090cb03009bfb21780d8aa7
Reviewed-on: https://go-review.googlesource.com/12153
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/go: mark ssh:// URLs as secure
Ross Light [Thu, 25 Jun 2015 20:14:28 +0000 (13:14 -0700)]
cmd/go: mark ssh:// URLs as secure

Add tests for isSecure function.

Change-Id: I49de9d2846b75d4c7be745484f85d351a6fd851d
Reviewed-on: https://go-review.googlesource.com/11514
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: fix build on non-x86 machines
Russ Cox [Tue, 14 Jul 2015 04:41:18 +0000 (00:41 -0400)]
runtime: fix build on non-x86 machines

Fixes #11656 (again).

Change-Id: I170ff10bfbdb0f34e57c11de42b6ee5291837813
Reviewed-on: https://go-review.googlesource.com/12142
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoos/exec: ignore pipe write errors when command completes successfully
Brad Fitzpatrick [Tue, 14 Jul 2015 00:17:24 +0000 (18:17 -0600)]
os/exec: ignore pipe write errors when command completes successfully

Fixes #9173

Change-Id: I83530533db84b07cb88dbf6ec690be48a06a9d7d
Reviewed-on: https://go-review.googlesource.com/12152
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc: update the architecture-specific information in asm.html
Rob Pike [Mon, 13 Jul 2015 05:22:35 +0000 (15:22 +1000)]
doc: update the architecture-specific information in asm.html

Still to do: ARM64 and PPC64. These architectures are woefully underdocumented.

Change-Id: Iedcf767a7e0e1c931812351940bc08f0c3821212
Reviewed-on: https://go-review.googlesource.com/12110
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/internal/obj: rename *.out.go to a.out.go
Rob Pike [Mon, 13 Jul 2015 03:44:01 +0000 (13:44 +1000)]
cmd/internal/obj: rename *.out.go to a.out.go

The old numerical names like 6.out.go are a relic from the old tools.
Easier to rename than explain.

The anames.go files were modified by go generate; no changes
beyond the explanatory comment at the top.

Change-Id: I84742c75c60e47724baa9d49a91fef1f8581f021
Reviewed-on: https://go-review.googlesource.com/12069
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: fix MemStats.{PauseNS,PauseEnd,PauseTotalNS,LastGC}
Austin Clements [Wed, 1 Jul 2015 15:04:19 +0000 (11:04 -0400)]
runtime: fix MemStats.{PauseNS,PauseEnd,PauseTotalNS,LastGC}

These memstats are currently being computed by gcMark, which was
appropriate in Go 1.4, but gcMark is now just one part of a bigger
picture. In particular, it can't account for the sweep termination
pause time, it can't account for all of the mark termination pause
time, and the reported "pause end" and "last GC" times will be
slightly earlier than they really are.

Lift computing of these statistics into func gc, which has the
appropriate visibility into the process to compute them correctly.

Fixes one of the issues in #10323. This does not add new statistics
appropriate to the concurrent collector; it simply fixes existing
statistics that are being misreported.

Change-Id: I670cb16594a8641f6b27acf4472db15b6e8e086e
Reviewed-on: https://go-review.googlesource.com/11794
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: report MemStats.PauseEnd in UNIX time
Austin Clements [Tue, 30 Jun 2015 22:20:13 +0000 (18:20 -0400)]
runtime: report MemStats.PauseEnd in UNIX time

Currently we report MemStats.PauseEnd in nanoseconds, but with no
particular 0 time. On Linux, the 0 time is when the host started. On
Darwin, it's the UNIX epoch. This is also inconsistent with the other
absolute time in MemStats, LastGC, which is always reported in
nanoseconds since 1970.

Fix PauseEnd so it's always reported in nanoseconds since 1970, like
LastGC.

Fixes one of the issues raised in #10323.

Change-Id: Ie2fe3169d45113992363a03b764f4e6c47e5c6a8
Reviewed-on: https://go-review.googlesource.com/11801
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: fix x86 stack trace for call to heap memory
Russ Cox [Fri, 10 Jul 2015 16:32:03 +0000 (12:32 -0400)]
runtime: fix x86 stack trace for call to heap memory

Fixes #11656.

Change-Id: Ib81d583e4b004e67dc9d2f898fd798112434e7a9
Reviewed-on: https://go-review.googlesource.com/12026
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

8 years agoruntime: fix race in TestChanSendBarrier
Russ Cox [Mon, 13 Jul 2015 19:23:59 +0000 (15:23 -0400)]
runtime: fix race in TestChanSendBarrier

Fixes race detector build.

Change-Id: I8bdc78d57487580e6b5b8c415df4653a1ba69e37
Reviewed-on: https://go-review.googlesource.com/12087
Reviewed-by: Austin Clements <austin@google.com>
8 years agonet: clean up builtin DNS stub resolver, fix tests
Mikio Hara [Thu, 11 Jun 2015 03:46:01 +0000 (12:46 +0900)]
net: clean up builtin DNS stub resolver, fix tests

This change does clean up as preparation for fixing #11081.

- renames cfg to resolvConf for clarification
- adds a new type resolverConfig and its methods: init, update,
  tryAcquireSema, releaseSema for mutual exclusion of resolv.conf data
- deflakes, simplifies tests for resolv.conf data; previously the tests
  sometimes left some garbage in the data

Change-Id: I277ced853fddc3791dde40ab54dbd5c78114b78c
Reviewed-on: https://go-review.googlesource.com/10931
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

8 years agocmd/go: fix go get -u with internal
Russ Cox [Fri, 10 Jul 2015 17:05:02 +0000 (13:05 -0400)]
cmd/go: fix go get -u with internal

Fixes #11307.
Fixes #11055.

Change-Id: I8d6b04cb509e62e27d6935b91ffe35fdaea4ebcd
Reviewed-on: https://go-review.googlesource.com/12028
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoruntime: add memory barrier for sync send in select
Russ Cox [Sat, 11 Jul 2015 15:53:58 +0000 (11:53 -0400)]
runtime: add memory barrier for sync send in select

Missed select case when adding the barrier last time.
All the more reason to refactor this code in Go 1.6.

Fixes #11643.

Change-Id: Ib0d19d6e0939296c0a3e06dda5e9b76f813bbc7e
Reviewed-on: https://go-review.googlesource.com/12086
Reviewed-by: Austin Clements <austin@google.com>
8 years agogo/internal/gcimporter: populate (*types.Package).Imports
Alan Donovan [Tue, 21 Apr 2015 19:05:18 +0000 (15:05 -0400)]
go/internal/gcimporter: populate (*types.Package).Imports

This is a copy of an upstream change to the tools repo:
https://go-review.googlesource.com/#/c/8924/

This is a second attempt at CL 8954, with the necessary change to
go/build's deps test.

Change-Id: Ib798498cf85fea0baec5667e9324d11f6ae8ad64
Reviewed-on: https://go-review.googlesource.com/9173
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoimage/png: don't read filter bytes for empty interlace passes.
Nigel Tao [Sun, 12 Jul 2015 11:02:13 +0000 (21:02 +1000)]
image/png: don't read filter bytes for empty interlace passes.

Fixes #11604

The gray-gradient.png image was created by a Go program:

----
package main

import (
"image"
"image/color"
"image/png"
"log"
"os"
)

func main() {
f, err := os.Create("a.png")
if err != nil {
log.Fatal(err)
}
defer f.Close()
m := image.NewGray(image.Rect(0, 0, 1, 16))
for i := 0; i < 16; i++ {
m.SetGray(0, i, color.Gray{uint8(i * 0x11)})
}
err = png.Encode(f, m)
if err != nil {
log.Fatal(err)
}
}
----

The equivalent gray-gradient.interlaced.png image was created via ImageMagick:
$ convert -interlace PNG gray-gradient.png gray-gradient.interlaced.png

As a sanity check:
$ file gray-gradient.*
gray-gradient.interlaced.png: PNG image data, 1 x 16, 4-bit grayscale, interlaced
gray-gradient.png:            PNG image data, 1 x 16, 8-bit grayscale, non-interlaced

Change-Id: I7700284f74d1ea30073aede3bce4d7651787bdbc
Reviewed-on: https://go-review.googlesource.com/12064
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/dist: actually disable testso and testsovar on ppc64
Michael Hudson-Doyle [Mon, 13 Jul 2015 03:20:12 +0000 (15:20 +1200)]
cmd/dist: actually disable testso and testsovar on ppc64

This is clearly what was intended all along. ./all.bash passes with this
change.

Change-Id: I16996da11cf1e4d2dc2a4434b7611a724691e8dc
Reviewed-on: https://go-review.googlesource.com/12068
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agodoc: add section about standard library to the FAQ
Brad Fitzpatrick [Sun, 5 Jul 2015 17:00:14 +0000 (10:00 -0700)]
doc: add section about standard library to the FAQ

Fixes #10246

Change-Id: Ifa698232a09e1c37f3a9340ffdc1f2650c06fe4c
Reviewed-on: https://go-review.googlesource.com/11900
Reviewed-by: Rob Pike <r@golang.org>
8 years agotime: document that time.Tick creates an unrecoverable resource
Rob Pike [Mon, 13 Jul 2015 01:13:15 +0000 (11:13 +1000)]
time: document that time.Tick creates an unrecoverable resource

Fixes #11662.

Change-Id: I8839b48a1cd3da4c29b6def03cb0c74c1c12942e
Reviewed-on: https://go-review.googlesource.com/12066
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agomisc/cgo/testshared: unset GOBIN during test
Ian Lance Taylor [Sun, 12 Jul 2015 17:18:32 +0000 (10:18 -0700)]
misc/cgo/testshared: unset GOBIN during test

Fixes #11273.

Change-Id: I409b6c4168711913076439036d65e8639ca3b06f
Reviewed-on: https://go-review.googlesource.com/12073
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
8 years agocmd/dist: disable misc/scgo/testsovar on netbsd
Alex Brainman [Sat, 11 Jul 2015 07:19:39 +0000 (17:19 +1000)]
cmd/dist: disable misc/scgo/testsovar on netbsd

Update #11654

Change-Id: Ia199b8dd349542ad8b92b463dd2f3734dd7e66a4
Reviewed-on: https://go-review.googlesource.com/12060
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoall: link to https for golang subdomains too
Brad Fitzpatrick [Sat, 11 Jul 2015 14:51:20 +0000 (08:51 -0600)]
all: link to https for golang subdomains too

The previous commit (git 2ae77376) just did golang.org.  This one
includes golang.org subdomains like blog, play, and build.

Change-Id: I4469f7b307ae2a12ea89323422044e604c5133ae
Reviewed-on: https://go-review.googlesource.com/12071
Reviewed-by: Rob Pike <r@golang.org>
8 years agoflag: Clarifies docs for Arg(int) and FlagSet.Arg(int)
Hariharan Srinath [Sat, 11 Jul 2015 08:50:14 +0000 (14:20 +0530)]
flag: Clarifies docs for Arg(int) and FlagSet.Arg(int)

Adds the clarification that these functions return empty
string if the requested element is not available

Added fullstops

Fixes #11664

Change-Id: I84173862bc785240f7d3ee75a5023673264d172b
Reviewed-on: https://go-review.googlesource.com/12061
Reviewed-by: Rob Pike <r@golang.org>
8 years agoall: link to https instead of http
Brad Fitzpatrick [Fri, 10 Jul 2015 23:17:11 +0000 (17:17 -0600)]
all: link to https instead of http

The one in misc/makerelease/makerelease.go is particularly bad and
probably warrants rotating our keys.

I didn't update old weekly notes, and reverted some changes involving
test code for now, since we're late in the Go 1.5 freeze. Otherwise,
the rest are all auto-generated changes, and all manually reviewed.

Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d
Reviewed-on: https://go-review.googlesource.com/12048
Reviewed-by: Rob Pike <r@golang.org>
8 years agonet/http/fcgi: fix race between serveRequest and cleanUp
Brad Fitzpatrick [Fri, 3 Jul 2015 19:32:40 +0000 (12:32 -0700)]
net/http/fcgi: fix race between serveRequest and cleanUp

Fixes #11552

Change-Id: I87904e9e3fb4bd1fb4c7075a4e2d0151e5bd37df
Reviewed-on: https://go-review.googlesource.com/11890
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agoruntime: abort on fatal errors and panics in c-shared and c-archive modes
Elias Naur [Sat, 11 Jul 2015 10:59:00 +0000 (12:59 +0200)]
runtime: abort on fatal errors and panics in c-shared and c-archive modes

The default behaviour for fatal errors and runtime panics is to dump
the goroutine stack traces and exit with code 2. However, when the process is
owned by foreign code, it is suprising and inappropriate to suddenly exit
the whole process, even on fatal errors. Instead, re-use the crash behaviour
from GOTRACEBACK=crash and abort.

The motivating use case is issue #11382, where an Android crash reporter
is confused by an exiting process, but I believe the aborting behaviour
is appropriate for all cases where Go does not own the process.

The change is simple and contained and will enable reliable crash reporting
for Android apps in Go 1.5, but I'll leave it to others to judge whether it
is too late for Go 1.5.

Fixes #11382

Change-Id: I477328e1092f483591c99da1fbb8bc4411911785
Reviewed-on: https://go-review.googlesource.com/12032
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>