]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agoA+C: David Calavera (individual CLA)
Adam Langley [Fri, 2 May 2014 17:54:50 +0000 (10:54 -0700)]
A+C: David Calavera (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/90970048

11 years agoruntime: fix bug in GOTRACEBACK=crash causing suppression of core dumps.
Alan Donovan [Fri, 2 May 2014 17:06:58 +0000 (13:06 -0400)]
runtime: fix bug in GOTRACEBACK=crash causing suppression of core dumps.

Because gotraceback is called early and often, its cache commits to the value of getenv("GOTRACEBACK") before getenv is even ready.  So now we reset its cache once getenv becomes ready.  Panicking programs now dump core again.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/97800045

11 years agoruntime: do not set m->locks around memory allocation
Dmitriy Vyukov [Fri, 2 May 2014 16:39:25 +0000 (17:39 +0100)]
runtime: do not set m->locks around memory allocation
If slice append is the only place where a program allocates,
then it will consume all available memory w/o triggering GC.
This was demonstrated in the issue.
Fixes #7922.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews, iant, khr
https://golang.org/cl/91010048

11 years agoruntime: make MemStats.LastGC Unix time again
Dmitriy Vyukov [Fri, 2 May 2014 16:32:42 +0000 (17:32 +0100)]
runtime: make MemStats.LastGC Unix time again
The monotonic clock patch changed all runtime times
to abstract monotonic time. As the result user-visible
MemStats.LastGC become monotonic time as well.
Restore Unix time for LastGC.

This is the simplest way to expose time.now to runtime that I found.
Another option would be to change time.now to C called
int64 runtime.unixnanotime() and then express time.now in terms of it.
But this would require to introduce 2 64-bit divisions into time.now.
Another option would be to change time.now to C called
void runtime.unixnanotime1(struct {int64 sec, int32 nsec} *now)
and then express both time.now and runtime.unixnanotime in terms of it.

Fixes #7852.

LGTM=minux.ma, iant
R=minux.ma, rsc, iant
CC=golang-codereviews
https://golang.org/cl/93720045

11 years agoos: cut limited read to 1 GB
Russ Cox [Fri, 2 May 2014 16:12:40 +0000 (12:12 -0400)]
os: cut limited read to 1 GB

If systems actually read that much, using 2GB-1 will
result in misaligned subsequent reads. Use 1GB instead,
which will certainly keep reads aligned and which is
plenty large enough.

Update #7812.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/94070044

11 years agohtml: fix small typo
Robert Hencke [Thu, 1 May 2014 20:29:34 +0000 (16:29 -0400)]
html: fix small typo

LGTM=dsymonds, adg, crawshaw, r, bradfitz, campoy, nigeltao, sameer, iant, robsc, djd, michael.j.fromberger, gmlewis, adonovan, rsc
R=golang-codereviews, dsymonds, adg, crawshaw, r, nigeltao, sameer, iant, robsc, djd, michael.j.fromberger, gmlewis, adonovan, rsc
CC=golang-codereviews
https://golang.org/cl/98880043

11 years agogo/build: add go1.3 release tag
Brad Fitzpatrick [Thu, 1 May 2014 16:16:03 +0000 (12:16 -0400)]
go/build: add go1.3 release tag

Fixes #7918

LGTM=dave
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/91980043

11 years agocmd/dist: permit go* tag in main branch when it includes "beta"
Andrew Gerrand [Thu, 1 May 2014 16:13:32 +0000 (12:13 -0400)]
cmd/dist: permit go* tag in main branch when it includes "beta"

This change allows us to give an hg tag such as "go1.3beta1" to
revisions in the main branch without breaking the build.

This is helpful for community members who want to build the beta
from source.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/90190044

11 years agoruntime: correctly type interface data.
Keith Randall [Thu, 1 May 2014 13:37:55 +0000 (09:37 -0400)]
runtime: correctly type interface data.

The backing memory for >1 word interfaces was being scanned
conservatively.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/94000043

11 years agocmd/go: test: clean up all temporary directories
Michael Fraenkel [Wed, 30 Apr 2014 17:03:38 +0000 (13:03 -0400)]
cmd/go: test: clean up all temporary directories

go test may call builder.init() multiple times which will create a new work directory.  The cleanup needs to hoist the current work directory.
Fixes #7904.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/95900044

11 years agoA+C: Michael Fraenkel (individual CLA)
Ian Lance Taylor [Wed, 30 Apr 2014 16:59:33 +0000 (09:59 -0700)]
A+C: Michael Fraenkel (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/90950044

11 years agotime: MeST is a time zone name
Rui Ueyama [Wed, 30 Apr 2014 15:30:36 +0000 (11:30 -0400)]
time: MeST is a time zone name

Not only ChST but also MeST (America/Metlakatla) is a zone
name containing a lower case letter.

LGTM=robert.hencke, r
R=golang-codereviews, robert.hencke, bradfitz, r
CC=golang-codereviews
https://golang.org/cl/99910043

11 years agonet: enable builtin dns resolver tests on solaris
Mikio Hara [Wed, 30 Apr 2014 14:26:07 +0000 (23:26 +0900)]
net: enable builtin dns resolver tests on solaris

LGTM=aram
R=golang-codereviews, aram
CC=golang-codereviews
https://golang.org/cl/99890045

11 years agolib/time: update time zone info to v.2014b
Robert Hencke [Wed, 30 Apr 2014 01:41:54 +0000 (21:41 -0400)]
lib/time: update time zone info to v.2014b

Fixes #7412.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/92850043

11 years agodoc/go1.3.html: update for FreeBSD/ARM support.
Shenghou Ma [Tue, 29 Apr 2014 19:54:37 +0000 (15:54 -0400)]
doc/go1.3.html: update for FreeBSD/ARM support.
FreeBSD 10 is fully supported.

LGTM=r
R=golang-codereviews, bradfitz, r
CC=dave, golang-codereviews
https://golang.org/cl/99810044

11 years agorun.bash: skip -static cgo test if -static linking isn't possible.
Shenghou Ma [Tue, 29 Apr 2014 18:43:10 +0000 (14:43 -0400)]
run.bash: skip -static cgo test if -static linking isn't possible.
Some system doesn't have libc.a available.

While we're at here, also export GOROOT in run.bash, so that
one doesn't need to set GOROOT to run run.bash.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/99870043

11 years agoall: spelling tweaks, A-G
Robert Hencke [Tue, 29 Apr 2014 16:44:40 +0000 (12:44 -0400)]
all: spelling tweaks, A-G

LGTM=ruiu, bradfitz
R=golang-codereviews, bradfitz, ruiu
CC=golang-codereviews
https://golang.org/cl/91840044

11 years agocmd/cgo: for gccgo add #define to cgo_export.h for expected name
Ian Lance Taylor [Tue, 29 Apr 2014 12:53:38 +0000 (08:53 -0400)]
cmd/cgo: for gccgo add #define to cgo_export.h for expected name

For gccgo we rename exported functions so that the compiler
will make them visible.  This CL adds a #define so that C
functions that #include "cgo_export.h" can use the expected
names of the function.

The test for this is the existing issue6833 test in
misc/cgo/test.  Without this CL it fails when using
-compiler=gccgo.

LGTM=minux.ma, rsc
R=golang-codereviews, gobot, rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/91830046

11 years agomake.bash: if CC is not set, and gcc doesn't exist, try clang/clang++.
Shenghou Ma [Tue, 29 Apr 2014 04:32:16 +0000 (00:32 -0400)]
make.bash: if CC is not set, and gcc doesn't exist, try clang/clang++.
This should make Go build without setting CC and CXX on newer FreeBSDs.

LGTM=iant
R=golang-codereviews, dave, gobot, iant
CC=golang-codereviews
https://golang.org/cl/89230045

11 years agonet: make WriteTo, WriteToIP and WriteMsgIP fail when IPConn is already connected
Mikio Hara [Tue, 29 Apr 2014 03:37:16 +0000 (12:37 +0900)]
net: make WriteTo, WriteToIP and WriteMsgIP fail when IPConn is already connected

This CL tries to fill the gap between Linux and other Unix-like systems
in the same way UDPConn and UnixConn already did.

Fixes #7887.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/97810043

11 years agolog/syslog: document if network=="" for Dial, it will connect to local syslog server.
Shenghou Ma [Mon, 28 Apr 2014 18:29:45 +0000 (14:29 -0400)]
log/syslog: document if network=="" for Dial, it will connect to local syslog server.
Fixes #7828.

LGTM=robert.hencke, iant, bradfitz
R=golang-codereviews, robert.hencke, iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/97780045

11 years agomisc/vim/readme.txt: workaround weird OS X vim bug.
Shenghou Ma [Mon, 28 Apr 2014 18:24:14 +0000 (14:24 -0400)]
misc/vim/readme.txt: workaround weird OS X vim bug.
The vi bundled with OS X has a weird bug in that if you turn off
filetype in .vimrc when it's not turned on, even a clean exit of
vi will return 1 which breaks almost everything.

While we're at it, add hint to change $GOROOT to its actual value
in .vimrc.

Fixes #7865.

LGTM=robert.hencke, dsymonds
R=golang-codereviews, robert.hencke, gobot, dsymonds
CC=golang-codereviews
https://golang.org/cl/96800046

11 years agoruntime: clean up scanning of Gs
Keith Randall [Mon, 28 Apr 2014 16:47:09 +0000 (12:47 -0400)]
runtime: clean up scanning of Gs

Use a real type for Gs instead of scanning them conservatively.
Zero the schedlink pointer when it is dead.

Update #7820

LGTM=rsc
R=rsc, dvyukov
CC=golang-codereviews
https://golang.org/cl/89360043

11 years agoruntime: heapdump - make sure spans are swept before dumping.
Keith Randall [Mon, 28 Apr 2014 16:45:00 +0000 (12:45 -0400)]
runtime: heapdump - make sure spans are swept before dumping.

LGTM=rsc
R=golang-codereviews, adonovan, rsc
CC=golang-codereviews
https://golang.org/cl/90440043

11 years agodoc: fix link to Mercurial download
Robert Hencke [Mon, 28 Apr 2014 13:59:27 +0000 (06:59 -0700)]
doc: fix link to Mercurial download

Oddly, 404s with the trailing slash.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/90790045

11 years agodoc: fix broken link to RTEMS Go wiki page
Robert Hencke [Mon, 28 Apr 2014 13:27:22 +0000 (06:27 -0700)]
doc: fix broken link to RTEMS Go wiki page

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/98740046

11 years agosyscall: don't display syscall prototype lines on godoc
Mikio Hara [Mon, 28 Apr 2014 04:38:23 +0000 (13:38 +0900)]
syscall: don't display syscall prototype lines on godoc

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/90810045

11 years agosyscall: add missing SendmsgN for NaCl
Mikio Hara [Mon, 28 Apr 2014 02:34:52 +0000 (11:34 +0900)]
syscall: add missing SendmsgN for NaCl

Update #7645

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/98790044

11 years agonet/tcp: fix check for openbsd in test
Robert Hencke [Mon, 28 Apr 2014 00:39:13 +0000 (17:39 -0700)]
net/tcp: fix check for openbsd in test

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/98740045

11 years agodoc: fix an article
Brad Fitzpatrick [Sun, 27 Apr 2014 14:40:48 +0000 (07:40 -0700)]
doc: fix an article

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/91770050

11 years agosyscall: fix handling socket control messages on dragonfly
Mikio Hara [Sun, 27 Apr 2014 13:28:41 +0000 (22:28 +0900)]
syscall: fix handling socket control messages on dragonfly

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/91860043

11 years agomisc/cgo/test/backdoor: add gccgo version of backdoor function
Ian Lance Taylor [Sun, 27 Apr 2014 05:31:32 +0000 (22:31 -0700)]
misc/cgo/test/backdoor: add gccgo version of backdoor function

For the gc compiler the Go function Issue7695 is defined in
runtime.c, but there is no way to do that for gccgo, because
there is no way to get the correct pkgpath.  The test is not
important for gccgo in any case.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/93870044

11 years agocmd/cgo: fix C.CString for strings containing null terminators under gccgo
Peter Collingbourne [Sun, 27 Apr 2014 05:16:38 +0000 (22:16 -0700)]
cmd/cgo: fix C.CString for strings containing null terminators under gccgo

Previously we used strndup(3) to implement C.CString for gccgo. This
is wrong because strndup assumes the string to be null terminated,
and stops at the first null terminator. Instead, use malloc
and memmove to create a copy of the string, as we do in the
gc implementation.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/96790047

11 years agonet/http/httputil: tell people not to use ClientConn and ServerConn
Brad Fitzpatrick [Sun, 27 Apr 2014 05:14:39 +0000 (22:14 -0700)]
net/http/httputil: tell people not to use ClientConn and ServerConn

A very smart developer at Gophercon just asked me to help debug
a problem and I was horrified to learn that he was using httputil's
ClientConn. I forgot ClientConn and ServerConn were even included
in Go 1! They should've been deleted.

Scare people away from using them. The net/http package does
not use them and they're unused, unmaintained and untouched in
4+ years.

LGTM=r
R=r, adg
CC=golang-codereviews
https://golang.org/cl/92790043

11 years agonet: Remove an unmatched unlock of ForkLock
Robert Obryk [Sun, 27 Apr 2014 02:59:00 +0000 (19:59 -0700)]
net: Remove an unmatched unlock of ForkLock

Remove an RUnlock of syscall.ForkLock with no matching RLock.
Holding ForkLock in netFD.dup is unnecessary: dupCloseOnExecOld
locks and unlocks the lock on its own and dupCloseOnExec doesn't
need the ForkLock to be held.

LGTM=iant
R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/99800044

11 years agoencoding/ascii85: handle non-data bytes correctly
Rui Ueyama [Sun, 27 Apr 2014 02:56:06 +0000 (19:56 -0700)]
encoding/ascii85: handle non-data bytes correctly

Previously Read wouldn't return once its internal input buffer
is filled with non-data bytes.
Fixes #7875.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/90820043

11 years agosrc: fix issues found by go vet std
Robert Hencke [Sun, 27 Apr 2014 02:54:48 +0000 (19:54 -0700)]
src: fix issues found by go vet std

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/96850043

11 years agoos: cap reads and writes to 2GB on Darwin and FreeBSD
Brad Fitzpatrick [Sat, 26 Apr 2014 17:34:33 +0000 (10:34 -0700)]
os: cap reads and writes to 2GB on Darwin and FreeBSD

Fixes #7812

LGTM=josharian, iant
R=rsc, iant, adg, ruiu, minux.ma, josharian
CC=golang-codereviews
https://golang.org/cl/89900044

11 years ago encoding/gob: handle interface types in isZero() by returning true for nil...
Jonathan Allie [Sat, 26 Apr 2014 16:25:16 +0000 (10:25 -0600)]
  encoding/gob: handle interface types in isZero() by returning true for nil interfaces.

Fixes #7741.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/96830044

11 years agodoc/debugging_with_gdb.html: add introductory disclaimer
Rob Pike [Sat, 26 Apr 2014 16:18:17 +0000 (10:18 -0600)]
doc/debugging_with_gdb.html: add introductory disclaimer
The instructions in this document are useful but not reliable.
Explain the situation up top.

Fixes #7471.

LGTM=josharian, iant
R=golang-codereviews, josharian, iant
CC=golang-codereviews
https://golang.org/cl/96830045

11 years agodoc/contribute.html: link to wiki for more code review information
Robert Hencke [Sat, 26 Apr 2014 03:09:04 +0000 (20:09 -0700)]
doc/contribute.html: link to wiki for more code review information

(from the discussions on CL 89650044)

LGTM=minux.ma, iant
R=iant, minux.ma
CC=golang-codereviews
https://golang.org/cl/97770043

11 years agonet/http/httputil: don't leak goroutines in DumpRequestOut
Brad Fitzpatrick [Fri, 25 Apr 2014 22:19:32 +0000 (15:19 -0700)]
net/http/httputil: don't leak goroutines in DumpRequestOut

Fixes #7869

LGTM=dsymonds
R=golang-codereviews
CC=adg, dsymonds, golang-codereviews, rsc
https://golang.org/cl/91770048

11 years agonet: make WriteMsg{IP,UDP,Unix} return the correct number of bytes transferred
Mikio Hara [Fri, 25 Apr 2014 21:52:37 +0000 (06:52 +0900)]
net: make WriteMsg{IP,UDP,Unix} return the correct number of bytes transferred

Fixes #7645

LGTM=iant, bradfitz
R=iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/90170046

11 years agobufio: make all read functions UnreadByte-friendly
Robert Griesemer [Fri, 25 Apr 2014 15:46:07 +0000 (09:46 -0600)]
bufio: make all read functions UnreadByte-friendly

Fixes #7844.

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/90620045

11 years agonet/http, strings, bytes: fix http race, revert part of Reader behavior change
Brad Fitzpatrick [Fri, 25 Apr 2014 13:44:51 +0000 (06:44 -0700)]
net/http, strings, bytes: fix http race, revert part of Reader behavior change

I fixed this data race regression in two ways: in net/http itself, and also
partially reverting the change from https://golang.org/cl/77580046 .
Previously a Read from a strings.Reader or bytes.Reader returning 0 bytes
would not be a memory write. After 77580046 it was. This reverts that back
in case others depended on that. Also adds tests.

Fixes #7856

LGTM=ruiu, iant
R=iant, ruiu
CC=golang-codereviews, gri
https://golang.org/cl/94740044

11 years agonet: fix confusing typo in comment
Rui Ueyama [Thu, 24 Apr 2014 19:24:22 +0000 (12:24 -0700)]
net: fix confusing typo in comment

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/93750043

11 years agomath/cmpx: change space to tab in the Pow docs for better formatting
Rob Pike [Wed, 23 Apr 2014 04:12:15 +0000 (21:12 -0700)]
math/cmpx: change space to tab in the Pow docs for better formatting
Godoc makes it look better this way; before, it all ran together into nonsense.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/90400045

11 years agoos/exec: deflake a test on Linux
Brad Fitzpatrick [Wed, 23 Apr 2014 00:13:38 +0000 (17:13 -0700)]
os/exec: deflake a test on Linux

Work around buggy(?) Linux /proc filesystem.

Fixes #7808

LGTM=iant
R=golang-codereviews, iant
CC=adg, golang-codereviews
https://golang.org/cl/90400044

11 years agostrings: fix off-by-one error in test go1.3beta1
Rui Ueyama [Tue, 22 Apr 2014 00:00:27 +0000 (17:00 -0700)]
strings: fix off-by-one error in test

Previously it would panic because of out-of-bound access
if s1 is longer than s2.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/90110043

11 years agomath/big: fix Int.Exp
Robert Griesemer [Mon, 21 Apr 2014 22:54:51 +0000 (15:54 -0700)]
math/big: fix Int.Exp

Fixes #7814.

LGTM=agl, adonovan
R=agl, adonovan
CC=golang-codereviews
https://golang.org/cl/90080043

11 years agonet: extend TestVariousDeadlines1Proc timeout
Josh Bleecher Snyder [Mon, 21 Apr 2014 20:07:51 +0000 (13:07 -0700)]
net: extend TestVariousDeadlines1Proc timeout

TestVariousDeadlines1Proc was flaky on my system,
failing on about 5% of runs.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/89830045

11 years agoruntime: fix typo in error message
Mark Zavislak [Mon, 21 Apr 2014 15:55:23 +0000 (08:55 -0700)]
runtime: fix typo in error message

LGTM=robert.hencke, iant
R=golang-codereviews, robert.hencke, iant
CC=golang-codereviews
https://golang.org/cl/89760043

11 years agoruntime/race: add test for issue 7561.
Rémy Oudompheng [Mon, 21 Apr 2014 15:21:09 +0000 (17:21 +0200)]
runtime/race: add test for issue 7561.

LGTM=dvyukov
R=rsc, iant, khr, dvyukov
CC=golang-codereviews
https://golang.org/cl/76520045

11 years agocmd/nm: do not fail TestNM if symbol has less then 3 columns in nm output
Alex Brainman [Mon, 21 Apr 2014 11:12:18 +0000 (21:12 +1000)]
cmd/nm: do not fail TestNM if symbol has less then 3 columns in nm output

Fixes #7829

LGTM=dave
R=golang-codereviews, aram, dave
CC=golang-codereviews
https://golang.org/cl/89830043

11 years agocmd/nm: disable TestNM on darwin, linux and solaris
Alex Brainman [Mon, 21 Apr 2014 10:36:35 +0000 (20:36 +1000)]
cmd/nm: disable TestNM on darwin, linux and solaris

Update #7829

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/89810043

11 years agocmd/ld: correct addresses in windows pe symbol table
Alex Brainman [Mon, 21 Apr 2014 09:28:02 +0000 (19:28 +1000)]
cmd/ld: correct addresses in windows pe symbol table

This should have been part of 36eb4a62fbb6,
but I later discovered that addresses are all wrong.
Appropriate test added now.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/89470043

11 years agoruntime, go/build: re-enable cgo on FreeBSD.
Shenghou Ma [Mon, 21 Apr 2014 04:09:22 +0000 (00:09 -0400)]
runtime, go/build: re-enable cgo on FreeBSD.
Fixes #7331.

LGTM=dave, iant
R=golang-codereviews, dave, gobot, iant
CC=golang-codereviews
https://golang.org/cl/89150043

11 years agoruntime, cmd/ld, cmd/5l, run.bash: enable external linking on FreeBSD/ARM.
Shenghou Ma [Mon, 21 Apr 2014 04:08:59 +0000 (00:08 -0400)]
runtime, cmd/ld, cmd/5l, run.bash: enable external linking on FreeBSD/ARM.
Update #7331

LGTM=dave, iant
R=golang-codereviews, dave, gobot, iant
CC=golang-codereviews
https://golang.org/cl/89520043

11 years agolib9: restore argv0 initialization code.
Shenghou Ma [Mon, 21 Apr 2014 04:08:39 +0000 (00:08 -0400)]
lib9: restore argv0 initialization code.
`GOARCH=arm go tool 6c` used to give "<prog>: cannot use 6c with GOARCH=arm"

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/89330043

11 years agocmd/go: handle -ccflags in 'go test'
Shenghou Ma [Mon, 21 Apr 2014 04:02:21 +0000 (00:02 -0400)]
cmd/go: handle -ccflags in 'go test'
CL 89050043 only allows -ccflags for 'go test', this
CL really handles the flag like the other -??flags.
Many thanks to Dobrosław Żybort for pointing this out.
Fixes #7810 (again).

LGTM=iant, matrixik
R=golang-codereviews, iant, matrixik
CC=golang-codereviews
https://golang.org/cl/89230044

11 years agodoc/go1.3.html: fix Goexit link
David du Colombier [Sun, 20 Apr 2014 18:29:17 +0000 (20:29 +0200)]
doc/go1.3.html: fix Goexit link

LGTM=minux.ma
R=r, minux.ma
CC=golang-codereviews
https://golang.org/cl/89710043

11 years agocmd/gc: avoid %L in error message
Jan Ziak [Sun, 20 Apr 2014 09:02:01 +0000 (11:02 +0200)]
cmd/gc: avoid %L in error message

Fixes #7783

LGTM=minux.ma
R=rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/89290043

11 years agoinclude/plan9: make mklibc.rc compatible with 9atom
David du Colombier [Sat, 19 Apr 2014 07:55:09 +0000 (09:55 +0200)]
include/plan9: make mklibc.rc compatible with 9atom

Since there is no Runemask constant in UTF-8 enum in
9atom, removing the other constants leads to an empty
enum, which is illegal. Thus, we remove enum entirely.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/82660044

11 years agocmd/nm: print symbol sizes for windows pe executables
Alex Brainman [Sat, 19 Apr 2014 04:47:20 +0000 (14:47 +1000)]
cmd/nm: print symbol sizes for windows pe executables

Fixes #6973

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/88820043

11 years agocmd/ld: don't delete output binary if not "ordinary" file (redux).
Mike Andrews [Fri, 18 Apr 2014 22:37:55 +0000 (15:37 -0700)]
cmd/ld: don't delete output binary if not "ordinary" file (redux).

following on CL https://golang.org/cl/76810045 and
issue 7563, i now see there's another "remove(outfile)" a few
dozen lines down that also needs fixing.

LGTM=iant
R=golang-codereviews, iant
CC=0intro, golang-codereviews, r
https://golang.org/cl/89030043

11 years agodoc/go1.3.html: Plan 9 support
David du Colombier [Fri, 18 Apr 2014 19:40:55 +0000 (21:40 +0200)]
doc/go1.3.html: Plan 9 support

LGTM=aram, r
R=r, aram, bradfitz
CC=golang-codereviews, rsc
https://golang.org/cl/89130045

11 years agodoc/go1.3.html: go test always builds
Rob Pike [Fri, 18 Apr 2014 18:00:38 +0000 (11:00 -0700)]
doc/go1.3.html: go test always builds

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/89370043

11 years agopkg/reflect/value.go: Correction in comment, the argument is "typ", not "t".
Lucio De Re [Fri, 18 Apr 2014 15:11:31 +0000 (08:11 -0700)]
pkg/reflect/value.go: Correction in comment, the argument is "typ", not "t".

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/89270043

11 years agodoc/go1.3.html: new package debug/plan9obj
David du Colombier [Fri, 18 Apr 2014 08:50:06 +0000 (10:50 +0200)]
doc/go1.3.html: new package debug/plan9obj

LGTM=r
R=r
CC=golang-codereviews, rsc
https://golang.org/cl/86180046

11 years agoos: change return variable name for Getwd to avoid confusion
Shenghou Ma [Fri, 18 Apr 2014 03:17:15 +0000 (23:17 -0400)]
os: change return variable name for Getwd to avoid confusion
changed (pwd string) to (dir string), as some think pwd means passwd.
Fixes #7811.

LGTM=iant
R=golang-codereviews, iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/89100043

11 years agocmd/go: support -ccflags in 'go test'
Shenghou Ma [Fri, 18 Apr 2014 03:16:11 +0000 (23:16 -0400)]
cmd/go: support -ccflags in 'go test'
Fixes #7810.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/89050043

11 years agonet/http/httputil: include Content-Length in DumpResponse output
Brad Fitzpatrick [Thu, 17 Apr 2014 21:03:05 +0000 (14:03 -0700)]
net/http/httputil: include Content-Length in DumpResponse output

Fixes #5357

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/87910050

11 years agonet: fix probabilities in DNS SRV shuffleByWeight
Brad Fitzpatrick [Thu, 17 Apr 2014 20:28:40 +0000 (13:28 -0700)]
net: fix probabilities in DNS SRV shuffleByWeight

Patch from msolo. Just moving it to a CL.
The test fails before and passes with the fix.

Fixes #7098

LGTM=msolo, rsc
R=rsc, iant, msolo
CC=golang-codereviews
https://golang.org/cl/88900044

11 years agocmd/pack: avoid ./ import in test (fix Windows build)
Russ Cox [Thu, 17 Apr 2014 20:25:38 +0000 (16:25 -0400)]
cmd/pack: avoid ./ import in test (fix Windows build)

It is possible to use ./ imports on Windows but it
requires some extra command-line work
('go build' does this automatically, but we can't use 'go build' here).

Instead, use an ordinary import and -I/-L, which are easier to use.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/89040043

11 years agocmd/pack: handle very long lines in pkgdef
Ian Lance Taylor [Thu, 17 Apr 2014 18:47:12 +0000 (11:47 -0700)]
cmd/pack: handle very long lines in pkgdef

LGTM=rsc, bradfitz
R=golang-codereviews, rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/88170049

11 years agonet/http: allow commas and spaces in cookie values
Volker Dobler [Thu, 17 Apr 2014 06:01:02 +0000 (23:01 -0700)]
net/http: allow commas and spaces in cookie values

According to RFC 6265 a cookie value may contain neither
commas nor spaces but such values are very common in the
wild and browsers handle them very well so we'll allow
both commas and spaces.
Values starting or ending in a comma or a space are
sent in the quoted form to prevent missinterpetations.

RFC 6265 conforming values are handled as before and
semicolons, backslashes and double-quotes are still
disallowed.

Fixes #7243

LGTM=nigeltao
R=nigeltao
CC=bradfitz, golang-codereviews
https://golang.org/cl/86050045

11 years agodoc/effective_go: mention that b.Write is a shorthand for (&b).Write when b is addres...
Shenghou Ma [Thu, 17 Apr 2014 05:40:04 +0000 (01:40 -0400)]
doc/effective_go: mention that b.Write is a shorthand for (&b).Write when b is addressable.

The rewrite is due to Rob.

LGTM=r, bradfitz, josharian
R=golang-codereviews, bradfitz, r, josharian
CC=golang-codereviews
https://golang.org/cl/87410043

11 years agocmd/ld: don't pass -rdynamic to external linker if -static is used
Ian Lance Taylor [Thu, 17 Apr 2014 03:28:53 +0000 (20:28 -0700)]
cmd/ld: don't pass -rdynamic to external linker if -static is used

Fixes #7800.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/87790051

11 years agocmd/gc: fix segfault in isgoconst.
Shenghou Ma [Thu, 17 Apr 2014 03:12:06 +0000 (23:12 -0400)]
cmd/gc: fix segfault in isgoconst.

Variables declared with 'var' have no sym->def.

Fixes #7794.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/88360043

11 years agotest: demo for issue 7695
Russ Cox [Thu, 17 Apr 2014 03:06:37 +0000 (23:06 -0400)]
test: demo for issue 7695

Cgo writes C function declarations pretending every arg is a pointer.
If the C function is deferred, it does not inhibit stack copying on split.
The stack copying code believes the C declaration, possibly misinterpreting
integers as pointers.

Probably the right fix for Go 1.3 is to make deferred C functions inhibit
stack copying.

For Go 1.4 and beyond we probably need to make cgo generate Go code
for 6g here, not C code for 6c.

Update #7695

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/83820043

11 years agocompress/gzip: add Reset method to Reader
Robert Daniel Kortschak [Thu, 17 Apr 2014 02:43:44 +0000 (22:43 -0400)]
compress/gzip: add Reset method to Reader

Fixes #6364.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc, gobot
CC=golang-codereviews
https://golang.org/cl/13512052

11 years agoencoding/json: document Encoder will terminate each JSON value with '\n'
Shenghou Ma [Thu, 17 Apr 2014 02:42:24 +0000 (22:42 -0400)]
encoding/json: document Encoder will terminate each JSON value with '\n'
Fixes #7767.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/87420043

11 years agocmd/gc: fewer errors for wrong argument count
Jan Ziak [Thu, 17 Apr 2014 02:42:09 +0000 (22:42 -0400)]
cmd/gc: fewer errors for wrong argument count

Fixes #7675

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/85040044

11 years agocmd/ld: restore the call graph dump
Anthony Martin [Thu, 17 Apr 2014 02:42:02 +0000 (22:42 -0400)]
cmd/ld: restore the call graph dump

Before the switch to liblink, the linkers accepted the -c flag
to print the call graph. This change restores the functionality.

This came in handy when I was trying to audit the use of SSE
instructions inside the Plan 9 note handler.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/73990043

11 years agocmd/go: reapply doc change from CL 60590044.
Russ Cox [Thu, 17 Apr 2014 02:30:10 +0000 (22:30 -0400)]
cmd/go: reapply doc change from CL 60590044.

https://golang.org/cl/60590044 edited
doc.go without editing the file it is generated from.
The edit was lost at the next mkdoc.sh.
Make the change in help.go and rerun mkdoc.sh.

Pointed out in the review of CL 68580043.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/88760043

11 years agocmd/ld: populate pe symbol table with Go symbols
Alex Brainman [Thu, 17 Apr 2014 02:25:40 +0000 (22:25 -0400)]
cmd/ld: populate pe symbol table with Go symbols

Fixes #6936

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/87770048

11 years agocmd/nm: windows pe handling fixes
Alex Brainman [Thu, 17 Apr 2014 02:17:38 +0000 (22:17 -0400)]
cmd/nm: windows pe handling fixes

- output absolute addresses, not relative;
- accept negative section numbers.

Update #6936
Fixes #7738

LGTM=rsc
R=golang-codereviews, bradfitz, ruiu, rsc
CC=golang-codereviews
https://golang.org/cl/85240046

11 years agodebug/pe: add optional header to File
Alex Brainman [Thu, 17 Apr 2014 02:10:59 +0000 (22:10 -0400)]
debug/pe: add optional header to File

This information is required by cmd/nm
to calculate absolute symbol addresses.

Update #6936
Update #7738

LGTM=rsc
R=golang-codereviews, bradfitz, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/87500043

11 years agoliblink, cmd/ld: reenable nosplit checking and test
Russ Cox [Thu, 17 Apr 2014 02:08:00 +0000 (22:08 -0400)]
liblink, cmd/ld: reenable nosplit checking and test

The new code is adapted from the Go 1.2 nosplit code,
but it does not have the bug reported in issue 7623:

g% go run nosplit.go
g% go1.2 run nosplit.go
BUG
rejected incorrectly:
        main 0 call f; f 120

        linker output:
        # _/tmp/go-test-nosplit021064539
        main.main: nosplit stack overflow
                120 guaranteed after split check in main.main
                112 on entry to main.f
                -8 after main.f uses 120

g%

Fixes #6931.
Fixes #7623.

LGTM=iant
R=golang-codereviews, iant, ality
CC=golang-codereviews, r
https://golang.org/cl/88190043

11 years agoencoding/xml: document NewDecoder buffering
Brad Fitzpatrick [Thu, 17 Apr 2014 00:16:08 +0000 (17:16 -0700)]
encoding/xml: document NewDecoder buffering

Fixes #7225

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, rsc
https://golang.org/cl/88710043

11 years agoflag: document that Bool also accepts "T" and "F"
Rob Pike [Thu, 17 Apr 2014 00:14:48 +0000 (17:14 -0700)]
flag: document that Bool also accepts "T" and "F"
Fixes #7752.

LGTM=bradfitz, ruiu
R=golang-codereviews, bradfitz, ruiu
CC=golang-codereviews
https://golang.org/cl/88690043

11 years agoall: fix typos
Rui Ueyama [Wed, 16 Apr 2014 23:57:25 +0000 (16:57 -0700)]
all: fix typos

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/88670043

11 years agoliblink, cmd/gc, cmd/{5,6,8}{a,c}: rename linkwriteobj to writeobj
Ian Lance Taylor [Wed, 16 Apr 2014 21:36:44 +0000 (14:36 -0700)]
liblink, cmd/gc, cmd/{5,6,8}{a,c}: rename linkwriteobj to writeobj

The name linkwriteobj is misleading because it implies that
the function has something to do with the linker, which it
does not.  The name is historical: the function performs an
operation that was previously performed by the linker, but no
longer is.

LGTM=rsc
R=rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/88210045

11 years agoliblink: add leaf bit to object file format
Russ Cox [Wed, 16 Apr 2014 21:11:44 +0000 (17:11 -0400)]
liblink: add leaf bit to object file format

Without the leaf bit, the linker cannot record
the correct frame size in the symbol table, and
then stack traces get mangled. (Only for ARM.)

Fixes #7338.
Fixes #7347.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/88550043

11 years agogo/scanner: interpret //line directives sans filename sensibly, second try.
Alan Donovan [Wed, 16 Apr 2014 20:17:50 +0000 (16:17 -0400)]
go/scanner: interpret //line directives sans filename sensibly, second try.

A //line directive without a filename now denotes the empty
filename, not the current directory (the Go 1.2 behaviour) nor
the previous //line's filename (the behaviour since CL
86990044).

They should never appear (but they do, e.g. due to a bug in godoc).

Fixes #7765

LGTM=gri, rsc
R=rsc, gri
CC=golang-codereviews
https://golang.org/cl/88160050

11 years agodoc/go1.3.html: fix id anchor for FreeBSD
Emil Hessman [Wed, 16 Apr 2014 19:15:39 +0000 (12:15 -0700)]
doc/go1.3.html: fix id anchor for FreeBSD

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/88000047

11 years agogo/scanner: interpret //line directives sans filename sensibly
Alan Donovan [Wed, 16 Apr 2014 18:51:33 +0000 (14:51 -0400)]
go/scanner: interpret //line directives sans filename sensibly

A //line directive without a filename now denotes the same
filename as the previous line (as in C).
Previously it denoted the file's directory (!).

Fixes #7765

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/86990044

11 years agoencoding/base64: don't lose a byte of output when encountering trailing garbage
Brad Fitzpatrick [Wed, 16 Apr 2014 18:32:41 +0000 (11:32 -0700)]
encoding/base64: don't lose a byte of output when encountering trailing garbage

Fixes #7733

LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews, nigeltao, r, rsc
https://golang.org/cl/88330044

11 years agonet/http: fix data race in TestTransportResponseHeaderTimeout
Brad Fitzpatrick [Wed, 16 Apr 2014 18:32:16 +0000 (11:32 -0700)]
net/http: fix data race in TestTransportResponseHeaderTimeout

Fixes #7264

LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/87970045

11 years agocmd/5g, cmd/6g, cmd/8g: preserve wide values in large functions
Russ Cox [Wed, 16 Apr 2014 17:59:42 +0000 (13:59 -0400)]
cmd/5g, cmd/6g, cmd/8g: preserve wide values in large functions

In large functions with many variables, the register optimizer
may give up and choose not to track certain variables at all.
In this case, the "nextinnode" information linking together
all the words from a given variable will be incomplete, and
the result may be that only some of a multiword value is
preserved across a call. That confuses the garbage collector,
so don't do that. Instead, mark those variables as having
their address taken, so that they will be preserved at all
calls. It's overkill, but correct.

Tested by hand using the 6g -S output to see that it does fix
the buggy generated code leading to the issue 7726 failure.

There is no automated test because I managed to break the
compiler while writing a test (see issue 7727). I will check
in a test along with the fix to issue 7727.

Fixes #7726.

LGTM=khr
R=khr, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/85200043