««« backport 008d345d81e0
cmd/yacc/units.txt: fix exchange rates
In the example "units" program for goyacc, the exchange rates were
reciprocals of the correct amounts. Turn them right-side-up
and update them to current figures.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6495053
Dave Cheney [Fri, 21 Sep 2012 19:54:50 +0000 (05:54 +1000)]
[release-branch.go1] net/http/httputil: fix race in DumpRequestOut
««« backport 3b78b41a4b50
net/http/httputil: fix race in DumpRequestOut
Fixes #3892.
Swapping the order of the writers inside the MultiWriter ensures
the request will be written to buf before http.ReadRequest completes.
The fencedBuffer is not required to make the test pass on
any machine that I have access too, but as the buf is shared
across goroutines, I think it is necessary for correctness.
[release-branch.go1] misc/vim: fix for autocompletion
««« backport 7fb0e868dc39
misc/vim: fix for autocompletion
Vim autocompletion respects the $GOPATH variable and does not
ignore dashes ('-'), dots ('.') and underscores ('_') like found
in many remote packages.
Environment variable $GOROOT is determined by calling
'go env GOROOT' instead of relying on the user's environment
variables.
[release-branch.go1] database/sql: stop reuse of bad connections
««« backport b397807815a6
database/sql: stop reuse of bad connections
The second parameter for sql.putConn() (err) is always nil. As a result bad
connections are reused, even if the driver returns an driver.ErrBadConn.
Unsing a pointer to err instead achievs the desired behavior.
See http://code.google.com/p/go/issues/detail?id=3777 for more details.
Fixes #3777.
««« backport 5972fe3f4418
cmd/6g: fix float32/64->uint64 conversion
CVTSS2SQ's rounding mode is controlled by the RC field of MXCSR;
as we specifically need truncate semantic, we should use CVTTSS2SQ.
Fixes #3804.
R=rsc, r
CC=golang-dev
https://golang.org/cl/6352079
Shenghou Ma [Fri, 21 Sep 2012 19:54:45 +0000 (05:54 +1000)]
[release-branch.go1] cmd/ld: set ELF header flags for our Linux/ARM binary
««« backport 1f9e023245d4
cmd/ld: set ELF header flags for our Linux/ARM binary
To make it more compliant.
This won't affect the behavior of running on OABI-only kernels.
Alex Brainman [Fri, 21 Sep 2012 19:54:39 +0000 (05:54 +1000)]
[release-branch.go1] pprof: make it work on windows again
««« backport 7c5f4dad8fae
pprof: make it work on windows again
- pprof is a perl script, so go command should invoke
perl instead of trying to run pprof directly;
- pprof should use "go tool nm" unconditionally on windows,
no one else can extract symbols from Go program;
- pprof should use "go tool nm" instead of "6nm".
Fixes #3879.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6445082
Rob Pike [Fri, 21 Sep 2012 19:54:39 +0000 (05:54 +1000)]
[release-branch.go1] all: move defers to after error check to avoid nil indirection
««« backport 8f0c8f604ee0
all: move defers to after error check to avoid nil indirection
Only affects some tests and none seem likely to be problematic, but let's fix them.
Fixes #3971.
Robert Griesemer [Fri, 21 Sep 2012 19:54:32 +0000 (05:54 +1000)]
[release-branch.go1] godoc: make id attributes unique
««« backport b5dd89dce002
godoc: make id attributes unique
Some browsers (e.g. IE9) ignore the case of 'id' attributes
which can lead to conflicts. Prefix non-generated 'id's with
"pkg-" to make them different from any generated attribute.
Also: Added missing entry for "Other packages" to top-level
index.
Nigel Tao [Fri, 21 Sep 2012 19:54:32 +0000 (05:54 +1000)]
[release-branch.go1] image/jpeg: send a correct Start Of Scan (SOS) header.
««« backport 4a67b1f1e771
image/jpeg: send a correct Start Of Scan (SOS) header.
Section B.2.3 of http://www.w3.org/Graphics/JPEG/itu-t81.pdf discusses
the End of spectral selection (Se) byte.
Apparently many JPEG decoders ignore the Se byte (or let it through
with a warning), but some configurations reject them. For example,
http://download.blender.org/source/chest/blender_2.03_tree/jpeg/jcmaster.c
has these lines:
if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
Shenghou Ma [Fri, 21 Sep 2012 19:54:29 +0000 (05:54 +1000)]
[release-branch.go1] math, runtime: use a NaN that matches gcc's
««« backport 1f62df249175
math, runtime: use a NaN that matches gcc's
our old choice is not working properly at least on VFPv2 in
ARM1136JF-S (it's not preserved across float64->float32 conversions).
[release-branch.go1] cmd/gc: accept switches on comparable arrays.
««« backport d68605d10a6b
cmd/gc: accept switches on comparable arrays.
The compiler is incorrectly rejecting switches on arrays of
comparable types. It also doesn't catch incomparable structs
when typechecking the switch, leading to unreadable errors
during typechecking of the generated code.
Shenghou Ma [Fri, 21 Sep 2012 19:54:22 +0000 (05:54 +1000)]
[release-branch.go1] cmd/cgo: use 1 as last entry for __cgodebug_data
««« backport aeaab9df5600
cmd/cgo: use 1 as last entry for __cgodebug_data
LLVM-based gcc will place all-zero data in a zero-filled
section, but our debug/macho can't handle that.
Fixes #3821.
[release-branch.go1] syscall: workaround accept() bug on Darwin
««« backport 0eae95b0307a
syscall: workaround accept() bug on Darwin
Darwin kernels have a bug in accept() where error result from
an internal call is not checked and socket is accepted instead
of ECONNABORTED error. However, such sockets have no sockaddr,
which results in EAFNOSUPPORT error from anyToSockaddr, making
Go http servers running on Mac OS X easily susceptible to
denial of service from simple port scans with nmap.
Fixes #3849.
If a factored import group has a blank line, assume it is dividing
separate groups of imports (e.g. standard library vs. site-specific).
import (
"bytes"
"io"
"mycorp/package"
)
The most common case is inserting new standard library imports,
which are usually (stylistically) the first group, so we should drop
"net" in the above example immediately after "io".
Since this logic is getting non-trivial, add a test.
Shenghou Ma [Fri, 21 Sep 2012 19:54:16 +0000 (05:54 +1000)]
[release-branch.go1] log/syslog: don't append \n if there is one
««« backport 6556a8d85dd6
log/syslog: don't append \n if there is one
pkg log already appends a linefeed to the log message,
so log/syslog doesn't need to append another.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/6441048
Ian Lance Taylor [Fri, 21 Sep 2012 19:54:14 +0000 (05:54 +1000)]
[release-branch.go1] runtime: ignore signal 33 == SIGSETXID on GNU/Linux
««« backport bfa4e1f1027f
runtime: ignore signal 33 == SIGSETXID on GNU/Linux
When a cgo program calls setuid, setgid, etc., the GNU/Linux
pthread library sends signal SIGSETXID to each thread to tell
it to update its UID info. If Go is permitted to intercept
the default SIGSETXID signal handler, the program will hang.
This patch tells the runtime package to not try to intercept
SIGSETXID on GNU/Linux. This will be odd if a Go program
wants to try to use that signal, but it means that cgo
programs that call setuid, etc., won't hang.
Robert Griesemer [Fri, 21 Sep 2012 19:54:14 +0000 (05:54 +1000)]
[release-branch.go1] go/printer: don't crash if ast.FuncType.Params is nil
««« backport 7f6a0510d3c9
go/printer: don't crash if ast.FuncType.Params is nil
The go/ast comment for FuncType.Params says that the field may be nil.
Make sure the printer accepts such a value. The go/parser always sets
the field (to provide parenthesis position information), but a program
creating a Go AST from scatch may not.
Added corresponding test case.
Fixes #3870.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6448060
Rob Pike [Fri, 21 Sep 2012 19:54:11 +0000 (05:54 +1000)]
[release-branch.go1] text/template: fix bug in map indexing
««« backport 0748cd92ed76
text/template: fix bug in map indexing
If the key is not present, return value of the type of the element
not the type of the key. Also fix a test that should have caught this case.
Rob Pike [Fri, 21 Sep 2012 19:54:11 +0000 (05:54 +1000)]
[release-branch.go1] encoding/gob: revert 6348067, which broke compatibility
««« backport 3357d8d34ab8
encoding/gob: revert 6348067, which broke compatibility
Add commentary to explain better what's going on, but the
code change is a simple one-line reversal to the previous
form.
OpenSSL requires that RSA signatures be exactly the same byte-length
as the modulus. Currently it'll reject ~1/256 of our signatures: those
that end up a byte shorter.
Fixes #3796.
R=golang-dev, edsrzf, r
CC=golang-dev
https://golang.org/cl/6352093