]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years agoruntime: use WriteConsole to implement print and panic on windows
Daniel Theophanes [Fri, 6 Nov 2015 06:47:45 +0000 (22:47 -0800)]
runtime: use WriteConsole to implement print and panic on windows

Fixes #7864

Change-Id: Id13369352aeccac8387876f0b911e383c543c28e
Reviewed-on: https://go-review.googlesource.com/16714
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agopath/filepath: in Rel use case-insensitive comparison on Windows
Yasuhiro Matsumoto [Wed, 11 Nov 2015 01:21:49 +0000 (10:21 +0900)]
path/filepath: in Rel use case-insensitive comparison on Windows

Fixes #10802

Compare Volume name and each path elements using strings.EqualFold.

Change-Id: Ibdefdb801d0326e53755bc9cc8c10eed998094e5
Reviewed-on: https://go-review.googlesource.com/16795
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist: copy textflag.h for runtime/internal/* too
Shenghou Ma [Thu, 12 Nov 2015 19:52:01 +0000 (14:52 -0500)]
cmd/dist: copy textflag.h for runtime/internal/* too

Change-Id: I22216df83898e560cfe6d97344f05e3678c2db99
Reviewed-on: https://go-review.googlesource.com/16872
Reviewed-by: Michael Matloob <matloob@golang.org>
9 years agoruntime: move arch_mips64(le)?.go into runtime/internal/sys
Michael Matloob [Thu, 12 Nov 2015 18:43:27 +0000 (13:43 -0500)]
runtime: move arch_mips64(le)?.go into runtime/internal/sys

Somehow these were left out of the orignial CL.

Updates #11647

Change-Id: I058a30eaa25fbb72d60e7fb6bc9ff0a3b54fdb2a
Reviewed-on: https://go-review.googlesource.com/16870
Reviewed-by: Minux Ma <minux@golang.org>
9 years agotesting: only call flag.Parse if it has not been called before
Alberto Bertogli [Fri, 6 Nov 2015 01:40:56 +0000 (01:40 +0000)]
testing: only call flag.Parse if it has not been called before

Calling flag.Parse twice can be problematic if other goroutines called
flag.Parsed in between: the race detector complains due to the
write after read from a different goroutine.

This can happen if TestMain calls flag.Parse and launches goroutines
that call flag.Parsed, for example if it initializes a server which
checks flags.

This patch makes testing.M.Run only parse the flags if they have not
been parsed already.

Change-Id: Id9f8c31c5f90614e3f34c63d1a32cf7e9055d68e
Reviewed-on: https://go-review.googlesource.com/16739
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agotest: really force heap profile update in heapsampling.go
Austin Clements [Thu, 12 Nov 2015 17:24:36 +0000 (12:24 -0500)]
test: really force heap profile update in heapsampling.go

The heap profile is only guaranteed to be up-to-date after two GC
cycles, so force two GCs instead of just one.

Updates #13098.

Change-Id: I4fb9287b698f4a3b90b8af9fc6a2efb3b082bfe5
Reviewed-on: https://go-review.googlesource.com/16848
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agoruntime/internal/atomic: delete arch1_*.go files
Michael Matloob [Thu, 12 Nov 2015 17:09:29 +0000 (12:09 -0500)]
runtime/internal/atomic: delete arch1_*.go files

I made a copy of the per-arch _CacheLineSize definitons when checking in
runtime/internal/atomic. Now that runtime/internal/sys is checked in,
we can use the definition there.

Change-Id: I7242f6b633e4164f033b67ff471416b9d71c64d2
Reviewed-on: https://go-review.googlesource.com/16847
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: make SIGPROF skip stacks that are being copied
Austin Clements [Wed, 11 Nov 2015 20:34:54 +0000 (15:34 -0500)]
runtime: make SIGPROF skip stacks that are being copied

sigprof tracebacks the stack across systemstack switches to make
profile tracebacks more complete. However, it does this even if the
user stack is currently being copied, which means it may be in an
inconsistent state that will cause the traceback to panic.

One specific way this can happen is during stack shrinking. Some
goroutine blocks for STW, then enters gchelper, which then assists
with root marking. If that root marking happens to pick the original
goroutine and its stack needs to be shrunk, it will begin to copy that
stack. During this copy, the stack is generally inconsistent and, in
particular, the actual locations of the stack barriers and their
recorded locations are temporarily out of sync. If a SIGPROF happens
during this inconsistency, it will walk the stack all the way back to
the blocked goroutine and panic when it fails to unwind the stack
barriers.

Fix this by disallowing jumping to the user stack during SIGPROF if
that user stack is in the process of being copied.

Fixes #12932.

Change-Id: I9ef694c2c01e3653e292ce22612418dd3daff1b4
Reviewed-on: https://go-review.googlesource.com/16819
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoRevert "cmd/go: use shallow clones for new git checkouts"
Burcu Dogan [Wed, 11 Nov 2015 23:45:09 +0000 (15:45 -0800)]
Revert "cmd/go: use shallow clones for new git checkouts"

This reverts commit bc1f9d20b40998b87c9a5f56f2b22595de65c2d4.

The current go-get strategy doesn't support cases that servers
cannot handle shallow clients.

Also, `go get -u` is broken and is not compatible with already
go-getted unshallow repos.

Fixes #13213.
Fixes #13206.

Change-Id: Ie89d7603d96d323db64ad82997793fda0972f709
Reviewed-on: https://go-review.googlesource.com/16832
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/compile: delete the runtime_internal_atomic.go builtin defs file
Michael Matloob [Thu, 12 Nov 2015 15:44:37 +0000 (10:44 -0500)]
cmd/compile: delete the runtime_internal_atomic.go builtin defs file

The file was automatically placed in the cl by a tool I had built.
Since the compiler doesn't hook into the atomic package, it's unnecessary.

Change-Id: I631fd876813b381bb12604865b00fc5b268dce84
Reviewed-on: https://go-review.googlesource.com/16844
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agomisc/sortac: add tool to sort the AUTHORS and CONTRIBUTORS files
Brad Fitzpatrick [Thu, 12 Nov 2015 11:50:24 +0000 (11:50 +0000)]
misc/sortac: add tool to sort the AUTHORS and CONTRIBUTORS files

I keep losing this utility, used as part of other tools to auto-update
the AUTHORS and CONTRIBUTORS files.  Check it in to the repo so I
don't lose it, and so others can use it as well.

Updates #12042

Change-Id: Ib5886b85799087aaaddcec4c81169e2726322c05
Reviewed-on: https://go-review.googlesource.com/16824
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist: remove race binaries when rebuilding everything
Russ Cox [Thu, 12 Nov 2015 16:28:07 +0000 (11:28 -0500)]
cmd/dist: remove race binaries when rebuilding everything

Fixes #13214.

Change-Id: Id8fbb252b8beadb0b41f839dcd85d6165dea86a3
Reviewed-on: https://go-review.googlesource.com/16845
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: break out system-specific constants into package sys
Michael Matloob [Wed, 11 Nov 2015 17:39:30 +0000 (12:39 -0500)]
runtime: break out system-specific constants into package sys

runtime/internal/sys will hold system-, architecture- and config-
specific constants.

Updates #11647

Change-Id: I6db29c312556087a42e8d2bdd9af40d157c56b54
Reviewed-on: https://go-review.googlesource.com/16817
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agotest: force heap profile update in heapsampling.go test
Austin Clements [Thu, 12 Nov 2015 16:30:26 +0000 (11:30 -0500)]
test: force heap profile update in heapsampling.go test

The heapsampling.go test occasionally fails on some architectures
because it finds zero heap samples in main.alloc. This happens because
the byte and object counts are only updated at a GC. Hence, if a GC
happens part way through allocInterleaved, but then doesn't happen
after we start calling main.alloc, checkAllocations will see buckets
for the lines in main.alloc (which are created eagerly), but the
object and byte counts will be zero.

Fix this by forcing a GC to update the profile before we collect it.

Fixes #13098.

Change-Id: Ia7a9918eea6399307f10499dd7abefd4f6d13cf6
Reviewed-on: https://go-review.googlesource.com/16846
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agocmd/go: subdirs of runtime other than runtime/internal do depend on runtime
Ian Lance Taylor [Thu, 12 Nov 2015 07:13:14 +0000 (23:13 -0800)]
cmd/go: subdirs of runtime other than runtime/internal do depend on runtime

Correct an error in the last change: it caused runtime/cgo and
runtime/race to not depend on runtime.

Fixes #13214.

Change-Id: Ib48b3b5e9a74567ddfaccb7ab4a897ee2aedc2b8
Reviewed-on: https://go-review.googlesource.com/16837
Reviewed-by: Michael Matloob <matloob@golang.org>
9 years agoA+C: alter email-address description to cover more than two
Ralph Corderoy [Thu, 12 Nov 2015 13:00:57 +0000 (13:00 +0000)]
A+C: alter email-address description to cover more than two

Explictly list the alternative formats in each file.  In AUTHORS, refer
to CONTRIBUTORS' definition of multiple email addresses.  Indent with
four spaces;  AUTHORS used a tab, but CONTRIBUTORS used four spaces.
s/Rietveld/Gerrit/

Change the tab separating Sebastien Binet from his email address,
added in 2010's 18b02f6c.

Change-Id: Id52228ae6b62dd88ad8098110c22373bf14e068f
Reviewed-on: https://go-review.googlesource.com/16826
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: fix vet warning about println
Matthew Dempsky [Thu, 12 Nov 2015 04:49:37 +0000 (20:49 -0800)]
runtime: fix vet warning about println

lfstack.go:19: println call ends with newline

Change-Id: I2a903eef80a5300e9014999c2f0bc5d40ed5c735
Reviewed-on: https://go-review.googlesource.com/16836
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: fix vet warning about +build rule
Matthew Dempsky [Thu, 12 Nov 2015 04:47:25 +0000 (20:47 -0800)]
runtime: fix vet warning about +build rule

cgo_ppc64x.go:7: +build comment must appear before package clause and be followed by a blank line

Change-Id: Ib6dedddae70cc75dc3f137eb37ea338a64f8b595
Reviewed-on: https://go-review.googlesource.com/16835
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agodoc: update go1.6.txt
Shenghou Ma [Thu, 12 Nov 2015 05:08:09 +0000 (00:08 -0500)]
doc: update go1.6.txt

Change-Id: I9161c4a7e747d35ad7643b8cf0fe8b66eaea963b
Reviewed-on: https://go-review.googlesource.com/16842
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/dist: added support for GOARCH=mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 14:16:45 +0000 (10:16 -0400)]
cmd/dist: added support for GOARCH=mips64{,le}

Change-Id: I22ea3352ad0794fc611334c2f2ec5f1e894985ce
Reviewed-on: https://go-review.googlesource.com/14460
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agotest: fix nosplit.go, fixedbugs/issue11656.go and skip two tests for mips64{,le}
Yao Zhang [Mon, 28 Sep 2015 21:30:32 +0000 (17:30 -0400)]
test: fix nosplit.go, fixedbugs/issue11656.go and skip two tests for mips64{,le}

Skip fixedbugs/issue10607.go because external linking is not supported
yet.

Skip nilptr3.go because of issue #9058 (same as ppc64).

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

9 years agoruntime/debug: skip TestFreeOSMemory for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:33:48 +0000 (11:33 -0400)]
runtime/debug: skip TestFreeOSMemory for mips64{,le}

Change-Id: I419f3b8bf1bddffd4a775b0cd7b98f0239fe19cb
Reviewed-on: https://go-review.googlesource.com/14458
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agointernal/syscall/unix: added support for linux/mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:33:39 +0000 (11:33 -0400)]
internal/syscall/unix: added support for linux/mips64{,le}

Change-Id: Ib6f168b6a2daf3befbf75b4b95967ff91ac95d12
Reviewed-on: https://go-review.googlesource.com/14456
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/http: fixed TestLinuxSendfile for mips64
Yao Zhang [Thu, 10 Sep 2015 15:33:31 +0000 (11:33 -0400)]
net/http: fixed TestLinuxSendfile for mips64

mips64 strace doesn't support sendfile64 and will error out if we
specify that with `-e trace='. So we use sendfile for mips64 here.

Change-Id: If5e2bb39866ca3a77dcc40e4db338ba486921d89
Reviewed-on: https://go-review.googlesource.com/14455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agohash/crc32: added mips64{,le} build tags
Yao Zhang [Thu, 10 Sep 2015 15:33:26 +0000 (11:33 -0400)]
hash/crc32: added mips64{,le} build tags

Change-Id: I77c6768fff6f0163b36800307c4d573bb6521fe5
Reviewed-on: https://go-review.googlesource.com/14454
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodebug/elf: added MIPS ELF relocations
Yao Zhang [Thu, 10 Sep 2015 13:15:19 +0000 (09:15 -0400)]
debug/elf: added MIPS ELF relocations

Change-Id: I05352749a852095baae2f67fd71ffcf5f727538d
Reviewed-on: https://go-review.googlesource.com/14453
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoreflect: added support for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 01:47:09 +0000 (21:47 -0400)]
reflect: added support for mips64{,le}

Change-Id: I84ced3734410d3d05f195901f44d33f4ae6036b1
Reviewed-on: https://go-review.googlesource.com/14452
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath, math/big: added support for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 02:39:45 +0000 (22:39 -0400)]
math, math/big: added support for mips64{,le}

Change-Id: I5129a5b9dbbc57d97da723c2fc247bd28f951817
Reviewed-on: https://go-review.googlesource.com/14451
Reviewed-by: Minux Ma <minux@golang.org>
9 years agosync/atomic: added support for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 12:08:48 +0000 (08:08 -0400)]
sync/atomic: added support for mips64{,le}

Change-Id: Ibe6c345afd4cbae7e2542a350043fbb6b81d5678
Reviewed-on: https://go-review.googlesource.com/14450
Reviewed-by: Minux Ma <minux@golang.org>
9 years agosyscall: added support for linux/mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 12:48:19 +0000 (08:48 -0400)]
syscall: added support for linux/mips64{,le}

Syscall getdents64 is relatively new in linux/mips64, only since kernel
version 3.10. To support older kernel, syscall getdents is used for
mips64.

Change-Id: I892b05dff7d93e7ddb0d700abd6a5e6d4084ab4c
Reviewed-on: https://go-review.googlesource.com/14449
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agosyscall: added machine-generated code for linux/mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 12:50:57 +0000 (08:50 -0400)]
syscall: added machine-generated code for linux/mips64{,le}

Change-Id: I574a2b702bb3db596f890ae7b18fb4bc1fd358d5
Reviewed-on: https://go-review.googlesource.com/14448
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: restructured signal_linux.go, added signal table for mips64.
Yao Zhang [Thu, 24 Sep 2015 12:56:15 +0000 (08:56 -0400)]
runtime: restructured signal_linux.go, added signal table for mips64.

Linux/mips64 uses a different signal table. To avoid code copying,
signal table is factored out from signal_linux.go to
sigtab_linux_generic.go. And a mips64-specific version is added.

Change-Id: I842d7a7467c330bf772855fde01aecc77a42316b
Reviewed-on: https://go-review.googlesource.com/14993
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: renamed os2_linux.go to os2_linux_generic.go, added mips64 support
Yao Zhang [Thu, 24 Sep 2015 12:50:13 +0000 (08:50 -0400)]
runtime: renamed os2_linux.go to os2_linux_generic.go, added mips64 support

Linux/mips64 has a different sigset type and some different constants.
os2_linux.go is renamed to os2_linux_generic.go, and not used in mips64.
The corresponding file os2_linux_mips64x.go is added.

Change-Id: Ief83845a2779f7fe048d236d3c7da52b627ab533
Reviewed-on: https://go-review.googlesource.com/14992
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: restructured os1_linux.go, added mips64 support
Yao Zhang [Thu, 24 Sep 2015 12:42:10 +0000 (08:42 -0400)]
runtime: restructured os1_linux.go, added mips64 support

Linux/mips64 uses a different type of sigset. To deal with it, related
functions in os1_linux.go is refactored to os1_linux_generic.go
(used for non-mips64 architectures), and os1_linux_mips64x.go (only used
in mips64{,le}), to avoid code copying.

Change-Id: I5cadfccd86bfc4b30bf97e12607c3c614903ea4c
Reviewed-on: https://go-review.googlesource.com/14991
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: added mips64{,le} build tags and GOARCH cases
Yao Zhang [Wed, 23 Sep 2015 22:58:05 +0000 (18:58 -0400)]
runtime: added mips64{,le} build tags and GOARCH cases

Change-Id: I381c03d957a0dccae5f655f02e92760e5c0e9629
Reviewed-on: https://go-review.googlesource.com/14929
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: updated automatically generated zgoarch_*.go
Yao Zhang [Wed, 23 Sep 2015 19:30:40 +0000 (15:30 -0400)]
runtime: updated automatically generated zgoarch_*.go

files for unsupported architectures are deleted, as it would require
changing cmd/dist to recognize their names as build tags (probably
need a separated CL).

Change-Id: Ifd164b014867d39b4924d1b859fb84317dce4ab0
Reviewed-on: https://go-review.googlesource.com/14928
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: added go files for linux/mips64{,le} support
Yao Zhang [Thu, 10 Sep 2015 15:21:57 +0000 (11:21 -0400)]
runtime: added go files for linux/mips64{,le} support

Change-Id: I14b537922b97d4bce9e0523d98a822da906348f1
Reviewed-on: https://go-review.googlesource.com/14447
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: added go files for mips64 architecture support
Yao Zhang [Wed, 23 Sep 2015 18:05:16 +0000 (14:05 -0400)]
runtime: added go files for mips64 architecture support

Change-Id: Ia496470e48b3c5d39fb9fef99fac356dfb73a949
Reviewed-on: https://go-review.googlesource.com/14927
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime/internal/atomic: added mips64 support.
Yao Zhang [Thu, 12 Nov 2015 04:05:06 +0000 (23:05 -0500)]
runtime/internal/atomic: added mips64 support.

Change-Id: I2eaf0658771a0ff788429e2f503d116531166315
Reviewed-on: https://go-review.googlesource.com/16834
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: added assembly part of linux/mips64{,le} support
Yao Zhang [Thu, 10 Sep 2015 15:25:58 +0000 (11:25 -0400)]
runtime: added assembly part of linux/mips64{,le} support

Change-Id: I9e94027ef66c88007107de2b2b75c3d7cf1352af
Reviewed-on: https://go-review.googlesource.com/14467
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/cgo: added support for GOARCH=mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:33:17 +0000 (11:33 -0400)]
cmd/cgo: added support for GOARCH=mips64{,le}

The actual cgo is not supported for now. This is just the cgo command.

Change-Id: I25625100ee552971f47e681b7d613cba16a2132f
Reviewed-on: https://go-review.googlesource.com/14446
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/compile: added support for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:33:09 +0000 (11:33 -0400)]
cmd/compile: added support for mips64{,le}

It is based on ppc64 compiler.

Change-Id: I15a101df05f2919ba5292136957ba0009227d067
Reviewed-on: https://go-review.googlesource.com/14445
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/link: added support for mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:32:49 +0000 (11:32 -0400)]
cmd/link: added support for mips64{,le}

Only internal linking without cgo is supported for now.

Change-Id: Ie6074a8ff3ec13605b72028f2d60758034f87185
Reviewed-on: https://go-review.googlesource.com/14444
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/asm: added support for GOARCH=mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:32:32 +0000 (11:32 -0400)]
cmd/asm: added support for GOARCH=mips64{,le}

Change-Id: I951387f88993715e86b6ab9f18d38ed5c691ee0f
Reviewed-on: https://go-review.googlesource.com/14443
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/internal/obj/mips: added support for GOARCH=mips64{,le}
Yao Zhang [Thu, 10 Sep 2015 15:13:00 +0000 (11:13 -0400)]
cmd/internal/obj/mips: added support for GOARCH=mips64{,le}

MIPS64 has 32 general purpose 64-bit integer registers (R0-R31), 32
64-bit floating point registers (F0-F31). Instructions are fixed-width,
and are 32-bit wide. Instructions are all in standard 1-, 2-, 3-operand
forms.

MIPS64-specific relocations are added. For this reason, test data of
cmd/newlink are regenerated.

No other changes are made to portable structures.

Branch delay slots are current filled with NOP instructions. The function
for instruction scheduling (try to fill the delay slot with a useful
instruction) is implemented but disabled for now.

Change-Id: Ic364999c7a33245260c1381fc26a2fa8972d38b3
Reviewed-on: https://go-review.googlesource.com/14442
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: update comment that was missed in CL 6584
Matthew Dempsky [Thu, 12 Nov 2015 03:31:42 +0000 (19:31 -0800)]
runtime: update comment that was missed in CL 6584

Change-Id: Ie5f70af7e673bb2c691a45c28db2c017e6cddd4f
Reviewed-on: https://go-review.googlesource.com/16833
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: rewrite lots of foo_Bar(f, ...) into f.bar(...)
Matthew Dempsky [Thu, 12 Nov 2015 00:13:51 +0000 (16:13 -0800)]
runtime: rewrite lots of foo_Bar(f, ...) into f.bar(...)

Applies to types fixAlloc, mCache, mCentral, mHeap, mSpan, and
mSpanList.

Two special cases:

1. mHeap_Scavenge() previously didn't take an *mheap parameter, so it
was specially handled in this CL.

2. mHeap_Free() would have collided with mheap's "free" field, so it's
been renamed to (*mheap).freeSpan to parallel its underlying
(*mheap).freeSpanLocked method.

Change-Id: I325938554cca432c166fe9d9d689af2bbd68de4b
Reviewed-on: https://go-review.googlesource.com/16221
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoruntime: run TestCgoExternalThreadSIGPROF on ppc64le
Michael Hudson-Doyle [Thu, 12 Nov 2015 00:05:49 +0000 (13:05 +1300)]
runtime: run TestCgoExternalThreadSIGPROF on ppc64le

It was disabled because of the lack of external linking.

Change-Id: Iccb4a4ef8c57d048d53deabe4e0f4e6b9dccce33
Reviewed-on: https://go-review.googlesource.com/16797
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: handle linking against a shared library that implicitly includes a package
Michael Hudson-Doyle [Tue, 27 Oct 2015 00:36:11 +0000 (13:36 +1300)]
cmd/go: handle linking against a shared library that implicitly includes a package

If you say "go install -buildmode=shared a b" and package a depends on another
package c, package c is implicitly included in the resulting shared library (as
specified by "Go Execution Modes"). But if c depends on b, linking against this
shared library hangs, because the go tool doesn't know when computing c's
dependencies that c is part of the same shared library as c.

Fix this by tracking the shared library a package *is* in separately from the
shared library a package has been explicitly linked into.

Fixes #13044

Change-Id: Iacfedab24ae9731ed53d225678b447a2a888823c
Reviewed-on: https://go-review.googlesource.com/16338
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/compile/internal/x86: avoid CX in a couple of places in the int64 code
Michael Hudson-Doyle [Tue, 27 Oct 2015 21:40:46 +0000 (10:40 +1300)]
cmd/compile/internal/x86: avoid CX in a couple of places in the int64 code

I want to use CX as a scratch register in position independent code and these
uses are easy to remove.

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

9 years agocmd/link: fix size of filetab slice
Michael Hudson-Doyle [Tue, 27 Oct 2015 01:49:51 +0000 (14:49 +1300)]
cmd/link: fix size of filetab slice

The linker writes the number of file symbols (Nhistfile) to the filetab slice
and then Nhistfile offsets -- which means the slice contains Nhistfile+1
entries, not just Nhistfile.

I think this bug has been around since at least 1.4 but it's easier to trigger
with shared libraries and a tiny binary that only has a couple of functions in
it -- try go install -buildmode=shared std && go run -linkshared test/fixedbugs/issue4388.go.

Change-Id: I6c0f01f1e607b9b2b96872e37ffce81281911504
Reviewed-on: https://go-review.googlesource.com/16342
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: add syscalls needed for android/386 logging
Hyang-Ah Hana Kim [Thu, 5 Nov 2015 21:35:24 +0000 (16:35 -0500)]
runtime: add syscalls needed for android/386 logging

Update golang/go#9327.

Change-Id: I27ef973190d9ae652411caf3739414b5d46ca7d2
Reviewed-on: https://go-review.googlesource.com/16679
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agocmd,runtime: TLS setup for android/386
Hyang-Ah Hana Kim [Thu, 5 Nov 2015 21:32:27 +0000 (16:32 -0500)]
cmd,runtime: TLS setup for android/386

Same ugly hack as https://go-review.googlesource.com/15991.

Update golang/go#9327.

Change-Id: I58284e83268a15de95eabc833c3e01bf1e3faa2e
Reviewed-on: https://go-review.googlesource.com/16678
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime: remove unused marking parfor
Austin Clements [Wed, 11 Nov 2015 01:12:37 +0000 (20:12 -0500)]
runtime: remove unused marking parfor

The GC now handles the root marking jobs as part of general marking,
so work.markfor is no longer used.

Change-Id: I6c3b23fed27e4e7ea6430d6ca7ba25ae4d04ed14
Reviewed-on: https://go-review.googlesource.com/16811
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: never allocate new M when jumping time forward
Austin Clements [Tue, 10 Nov 2015 20:24:59 +0000 (15:24 -0500)]
runtime: never allocate new M when jumping time forward

When we're jumping time forward, it means everyone is asleep, so there
should always be an M available. Furthermore, this causes both
allocation and write barriers in contexts that may be running without
a P (such as in sysmon).

Hence, replace this allocation with a throw.

Updates #10600.

Change-Id: I2cee70d5db828d0044082878995949edb25dda5f
Reviewed-on: https://go-review.googlesource.com/16815
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: replace traceBuf slice with index
Austin Clements [Tue, 10 Nov 2015 19:58:51 +0000 (14:58 -0500)]
runtime: replace traceBuf slice with index

Currently traceBuf keeps track of where it is in the trace buffer by
also maintaining a slice that points in to this buffer with an initial
length of 0 and a cap of the length of the array. All writes to this
buffer are done by appending to the slice (as long as the bounds
checks are right, it will never overflow and the append won't allocate
a new slice).

Each of these appends generates a write barrier. As long as we never
overflow the buffer, this write barrier won't fire, but this wreaks
havoc with eliminating write barriers from the tracing code. If we
were to overflow the buffer, this would both allocate and invoke a
write barrier, both things that are dicey at best to do in many of the
contexts tracing happens. It also wastes space in the traceBuf and
leads to more complex code and more complex generated code.

Replace this slice trick with keeping track of a simple array
position.

Updates #10600.

Change-Id: I0a63eecec1992e195449f414ed47653f66318d0e
Reviewed-on: https://go-review.googlesource.com/16814
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agoruntime: eliminate traceStack write barriers
Austin Clements [Tue, 10 Nov 2015 21:43:33 +0000 (16:43 -0500)]
runtime: eliminate traceStack write barriers

This replaces *traceStack with traceStackPtr, much like the preceding
commit.

Updates #10600.

Change-Id: Ifadc35eb37a405ae877f9740151fb31a0ca1d08f
Reviewed-on: https://go-review.googlesource.com/16813
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agoruntime: eliminate traceBuf write barriers
Austin Clements [Tue, 10 Nov 2015 19:37:52 +0000 (14:37 -0500)]
runtime: eliminate traceBuf write barriers

The tracing code is currently called from contexts such as sysmon and
the scheduler where write barriers are not allowed. Unfortunately,
while the common paths through the tracing code do not have write
barriers, many of the less common paths dealing with buffer overflow
and recycling do.

This change replaces all *traceBufs with traceBufPtrs. In the style of
guintptr, etc., the GC does not trace traceBufPtrs and write barriers
do not apply when these pointers are written. Since traceBufs are
allocated from non-GC'd memory and manually managed, this is always
safe.

Updates #10600.

Change-Id: I52b992d36d1b634ebd855c8cde27947ec14f59ba
Reviewed-on: https://go-review.googlesource.com/16812
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agodoc: update go1.6.txt
Brad Fitzpatrick [Wed, 11 Nov 2015 16:01:41 +0000 (16:01 +0000)]
doc: update go1.6.txt

Mention shallow clones.

Fixes #13204

Change-Id: I0ed9d4e829d388425beba0d64e6889d16d4bb173
Reviewed-on: https://go-review.googlesource.com/16822
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: fix use of xadd64
Austin Clements [Wed, 11 Nov 2015 15:23:44 +0000 (10:23 -0500)]
runtime: fix use of xadd64

Commit 7407d8e was rebased over the switch to runtime/internal/atomic
and introduced a call to xadd64, which no longer exists. Fix that
call.

Change-Id: I99c93469794c16504ae4a8ffe3066ac382c66a3a
Reviewed-on: https://go-review.googlesource.com/16816
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agoruntime: fix over-aggressive proportional sweep
Austin Clements [Fri, 30 Oct 2015 18:25:28 +0000 (14:25 -0400)]
runtime: fix over-aggressive proportional sweep

Currently, sweeping is performed before allocating a span by charging
for the entire size of the span requested, rather than the number of
bytes actually available for allocation from the returned span. That
is, if the returned span is 8K, but already has 6K in use, the mutator
is charged for 8K of heap allocation even though it can only allocate
2K more from the span. As a result, proportional sweep is
over-aggressive and tends to finish much earlier than it needs to.
This effect is more amplified by fragmented heaps.

Fix this by reimbursing the mutator for the used space in a span once
it has allocated that span. We still have to charge up-front for the
worst-case because we don't know which span the mutator will get, but
at least we can correct the over-charge once it has a span, which will
go toward later span allocations.

This has negligible effect on the throughput of the go1 benchmarks and
the garbage benchmark.

Fixes #12040.

Change-Id: I0e23e7a4ccf126cca000fed5067b20017028dd6b
Reviewed-on: https://go-review.googlesource.com/16515
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agocmd/go: use shallow clones for new git checkouts
Meng Zhuo [Tue, 27 Oct 2015 07:36:38 +0000 (15:36 +0800)]
cmd/go: use shallow clones for new git checkouts

Currently go get will clone the full history of git repos.
We can improve the download waiting time/size by passing depth argument.

The docs about shallow clones and the --depth argument are here:
https://git-scm.com/docs/git-clone
https://git-scm.com/docs/git-pull

Fixes #13078

Change-Id: Ie891d905d9c77f6ecadf7dcd5b44b477f4e079e0
Reviewed-on: https://go-review.googlesource.com/16360
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: don't call msanread when running on the system stack
Ian Lance Taylor [Wed, 4 Nov 2015 20:30:30 +0000 (12:30 -0800)]
runtime: don't call msanread when running on the system stack

The runtime is not instrumented, but the calls to msanread in the
runtime can sometimes refer to the system stack.  An example is the call
to copy in stkbucket in mprof.go.  Depending on what C code has done,
the system stack may appear uninitialized to msan.

Change-Id: Ic21705b9ac504ae5cf7601a59189302f072e7db1
Reviewed-on: https://go-review.googlesource.com/16660
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime: mark cgo callback results as written for msan
Ian Lance Taylor [Wed, 4 Nov 2015 01:15:30 +0000 (17:15 -0800)]
runtime: mark cgo callback results as written for msan

This is a fix for the -msan option when using cgo callbacks.  A cgo
callback works by writing out C code that puts a struct on the stack and
passes the address of that struct into Go.  The result parameters are
fields of the struct.  The Go code will write to the result parameters,
but the Go code thinks it is just writing into the Go stack, and
therefore won't call msanwrite.  This CL adds a call to msanwrite in the
cgo callback code so that the C knows that results were written.

Change-Id: I80438dbd4561502bdee97fad3f02893a06880ee1
Reviewed-on: https://go-review.googlesource.com/16611
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agoruntime: clean up park messages
Austin Clements [Fri, 30 Oct 2015 02:40:36 +0000 (22:40 -0400)]
runtime: clean up park messages

This changes "mark worker (idle)" to "GC worker (idle)" so it's more
clear to users that these goroutines are GC-related. It changes "GC
assist" to "GC assist wait" to make it clear that the assist is
blocked.

Change-Id: Iafbc0903c84f9250ff6bee14baac6fcd4ed5ef76
Reviewed-on: https://go-review.googlesource.com/16511
Reviewed-by: Rick Hudson <rlh@golang.org>
9 years agoruntime: free stack spans outside STW
Austin Clements [Tue, 27 Oct 2015 21:48:18 +0000 (17:48 -0400)]
runtime: free stack spans outside STW

We couldn't do this before this point because it must be done before
the next GC cycle starts. Hence, if it delayed the start of the next
cycle, that would widen the window between reaching the heap trigger
of the next cycle and starting the next GC cycle, during which the
mutator could over-allocate. With the decentralized GC, any mutators
that reach the heap trigger will block on the GC starting, so it's
safe to widen the time between starting the world and being able to
start the next GC cycle.

Fixes #11465.

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

9 years agomisc/cgo/test: disable Test10303 for gccgo
Ian Lance Taylor [Tue, 10 Nov 2015 18:39:38 +0000 (10:39 -0800)]
misc/cgo/test: disable Test10303 for gccgo

When using gccgo it's OK if a pointer passed to C remains on the stack.
Gccgo does not have the clear distinction between C and Go stacks.

Change-Id: I3af9dd6fe078214ab16d9d8dad2d206608d7891d
Reviewed-on: https://go-review.googlesource.com/16774
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/cgo, runtime: add checks for passing pointers from Go to C
Ian Lance Taylor [Fri, 16 Oct 2015 22:26:00 +0000 (15:26 -0700)]
cmd/cgo, runtime: add checks for passing pointers from Go to C

This implements part of the proposal in issue 12416 by adding dynamic
checks for passing pointers from Go to C.  This code is intended to be
on at all times.  It does not try to catch every case.  It does not
implement checks on calling Go functions from C.

The new cgo checks may be disabled using GODEBUG=cgocheck=0.

Update #12416.

Change-Id: I48de130e7e2e83fb99a1e176b2c856be38a4d3c8
Reviewed-on: https://go-review.googlesource.com/16003
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocrypto/tls: len(clientRandom) used for serverRandom source
Ralph Corderoy [Sat, 7 Nov 2015 11:45:00 +0000 (11:45 +0000)]
crypto/tls: len(clientRandom) used for serverRandom source

In keysFromMasterSecret(), don't copy from serverRandom into
seed[:len(clientRandom)].  Actually, switch from an array to a slice in
keysFromMasterSecret() and masterFromPreMasterSecret() so the length
need not be given;  that's how it's done elsewhere in the file.

Fixes #13181

Change-Id: I92abaa892d1bba80c2d4f12776341cda7d538837
Reviewed-on: https://go-review.googlesource.com/16697
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
9 years agocrypto/tls: don't send IP literals as SNI values.
Adam Langley [Tue, 10 Nov 2015 19:18:50 +0000 (11:18 -0800)]
crypto/tls: don't send IP literals as SNI values.

(This relands commit a4dcc692011bf1ceca9b1a363fd83f3e59e399ee.)

https://tools.ietf.org/html/rfc6066#section-3 states:

  “Literal IPv4 and IPv6 addresses are not permitted in "HostName".”

However, if an IP literal was set as Config.ServerName (which could
happen as easily as calling Dial with an IP address) then the code would
send the IP literal as the SNI value.

This change filters out IP literals, as recognised by net.ParseIP, from
being sent as the SNI value.

Fixes #13111.

Change-Id: I6e544a78a01388f8fe98150589d073b917087f75
Reviewed-on: https://go-review.googlesource.com/16776
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocrypto/elliptic,crypto/ecdsa: P256 amd64 assembly
Vlad Krasnov [Fri, 17 Apr 2015 13:10:35 +0000 (06:10 -0700)]
crypto/elliptic,crypto/ecdsa: P256 amd64 assembly

This is based on the implementation used in OpenSSL, from a
submission by Shay Gueron and myself. Besides using assembly,
this implementation employs several optimizations described in:

    S.Gueron and V.Krasnov, "Fast prime field elliptic-curve
                             cryptography with 256-bit primes"

In addition a new and improved modular inverse modulo N is
implemented here.

The performance measured on a Haswell based Macbook Pro shows 21X
speedup for the sign and 9X for the verify operations.
The operation BaseMult is 30X faster (and the Diffie-Hellman/ECDSA
key generation that use it are sped up as well).

The adaptation to Go with the help of Filippo Valsorda

Updated the submission for faster verify/ecdh, fixed some asm syntax
and API problems and added benchmarks.

Change-Id: I86a33636747d5c92f15e0c8344caa2e7e07e0028
Reviewed-on: https://go-review.googlesource.com/8968
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
9 years agocmd/compile/internal/gc: avoid potential endless loop in float printing
Robert Griesemer [Tue, 10 Nov 2015 19:32:26 +0000 (11:32 -0800)]
cmd/compile/internal/gc: avoid potential endless loop in float printing

The compiler should not usually call Fconv with an infinity, but if
it does, Fconv will end in an endless loop. Test for infinities early.

Change-Id: I48f366466538b0bd26a851e01258725025babaff
Reviewed-on: https://go-review.googlesource.com/16777
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: always use --whole-archive for gccgo packages
Ian Lance Taylor [Tue, 10 Nov 2015 19:25:15 +0000 (11:25 -0800)]
cmd/go: always use --whole-archive for gccgo packages

This is, in effect, what the gc toolchain does.  It fixes cases where Go
code refers to a C global variable; without this, if the global variable
was the only thing visible in the C code, the generated cgo file might
not get pulled in from the archive, leaving the Go variable
uninitialized.

This was reported against gccgo as https://gcc.gnu.org/PR68255 .

Change-Id: I3e769dd174f64050ebbff268fbbf5e6fab1e2a1b
Reviewed-on: https://go-review.googlesource.com/16775
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/dist, cmd/go, misc/cgo/testshared: update testshared and run it on arm
Michael Hudson-Doyle [Wed, 2 Sep 2015 10:26:42 +0000 (22:26 +1200)]
cmd/dist, cmd/go, misc/cgo/testshared: update testshared and run it on arm

And enable PIE in cmd/go because that's all it seems to take.

Change-Id: Ie017f427ace5e91de333a9f7cba9684c4641dfd5
Reviewed-on: https://go-review.googlesource.com/14222
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/internal/obj/arm: access global data via GOT on arm when -dynlink
Michael Hudson-Doyle [Sun, 5 Jul 2015 09:49:11 +0000 (21:49 +1200)]
cmd/internal/obj/arm: access global data via GOT on arm when -dynlink

Change-Id: I88034611f56cc06bb47b0c431075cc78ca8dbb09
Reviewed-on: https://go-review.googlesource.com/14188
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: break atomics out into package runtime/internal/atomic
Michael Matloob [Mon, 2 Nov 2015 19:09:24 +0000 (14:09 -0500)]
runtime: break atomics out into package runtime/internal/atomic

This change breaks out most of the atomics functions in the runtime
into package runtime/internal/atomic. It adds some basic support
in the toolchain for runtime packages, and also modifies linux/arm
atomics to remove the dependency on the runtime's mutex. The mutexes
have been replaced with spinlocks.

all trybots are happy!
In addition to the trybots, I've tested on the darwin/arm64 builder,
on the darwin/arm builder, and on a ppc64le machine.

Change-Id: I6698c8e3cf3834f55ce5824059f44d00dc8e3c2f
Reviewed-on: https://go-review.googlesource.com/14204
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet/http: Show more data for unsolicited response
Erik Dubbelboer [Thu, 27 Aug 2015 06:09:15 +0000 (14:09 +0800)]
net/http: Show more data for unsolicited response

Show more than one character when we recieve a unsolicited
response on an idle HTTP channel. Showing more than one
byte is really useful when you want to debug your program
when you get this message.

Change-Id: I3caf9f06420e7c2a2de3e4eb302c5dab95428fdb
Reviewed-on: https://go-review.googlesource.com/13959
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/http/internal: ignore chunk-extension when reading chunked encoding bodies
Brad Fitzpatrick [Thu, 5 Nov 2015 06:53:28 +0000 (07:53 +0100)]
net/http/internal: ignore chunk-extension when reading chunked encoding bodies

Fixes #13135

Change-Id: I45666f32cd91102211bf01a306edcb10deb65187
Reviewed-on: https://go-review.googlesource.com/16680
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agomisc/cgo/testsanitizers: fix check for existence of clang
Mohit Agarwal [Mon, 9 Nov 2015 20:22:52 +0000 (01:52 +0530)]
misc/cgo/testsanitizers: fix check for existence of clang

The current mechanism fails if clang cannot be executed by the current
user.  Using the `-x` operator for `test` return TRUE if the file is
executable by the user.

Change-Id: I0f3c8dc3880c1ce5a8a833ff3109eb96853184af
Reviewed-on: https://go-review.googlesource.com/16752
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/dist: run more cgo tests on ppc64x
Michael Hudson-Doyle [Thu, 3 Sep 2015 20:31:43 +0000 (08:31 +1200)]
cmd/dist: run more cgo tests on ppc64x

Change-Id: I992655bb02690ad95122a9e4c45cbd0948b545a0
Reviewed-on: https://go-review.googlesource.com/14238
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/link: enable external linking on ppc64
Michael Hudson-Doyle [Thu, 3 Sep 2015 20:30:15 +0000 (08:30 +1200)]
cmd/link: enable external linking on ppc64

Change-Id: Iffe8ccb55b2c555b2cb8c168cebfbfd5892212df
Reviewed-on: https://go-review.googlesource.com/14236
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/link, runtime: arm64 implementation of addmoduledata
Michael Hudson-Doyle [Wed, 24 Jun 2015 10:31:24 +0000 (22:31 +1200)]
cmd/link, runtime: arm64 implementation of addmoduledata

Change-Id: I62fb5b20d7caa51b77560a4bfb74a39f17089805
Reviewed-on: https://go-review.googlesource.com/13999
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agonet: fix off by one error while counting interfaces on windows
Alex Brainman [Fri, 6 Nov 2015 06:29:27 +0000 (17:29 +1100)]
net: fix off by one error while counting interfaces on windows

Fixes #12301

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

9 years agohtml/template, encoding/asn1: fix test errors
Dominik Honnef [Wed, 28 Oct 2015 07:10:46 +0000 (08:10 +0100)]
html/template, encoding/asn1: fix test errors

Change-Id: I1da1d718609eb6a7b78d29b173ec780bde22c687
Reviewed-on: https://go-review.googlesource.com/16422
Reviewed-by: Ralph Corderoy <ralph@inputplus.co.uk>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoRevert "crypto/tls: don't send IP literals as SNI values."
Adam Langley [Mon, 9 Nov 2015 23:16:12 +0000 (15:16 -0800)]
Revert "crypto/tls: don't send IP literals as SNI values."

This reverts commit a4dcc692011bf1ceca9b1a363fd83f3e59e399ee.

Change-Id: Ib55fd349a604d6b5220dac20327501e1ce46b962
Reviewed-on: https://go-review.googlesource.com/16770
Reviewed-by: Adam Langley <agl@golang.org>
9 years agocrypto/tls: don't send IP literals as SNI values.
Adam Langley [Mon, 9 Nov 2015 03:10:14 +0000 (19:10 -0800)]
crypto/tls: don't send IP literals as SNI values.

https://tools.ietf.org/html/rfc6066#section-3 states:

  “Literal IPv4 and IPv6 addresses are not permitted in "HostName".”

However, if an IP literal was set as Config.ServerName (which could
happen as easily as calling Dial with an IP address) then the code would
send the IP literal as the SNI value.

This change filters out IP literals, as recognised by net.ParseIP, from
being sent as the SNI value.

Fixes #13111.

Change-Id: Ie9ec7acc767ae172b48c9c6dd8d84fa27b1cf0de
Reviewed-on: https://go-review.googlesource.com/16742
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>

9 years agocmd/link: look at the R_AARCH64_RELATIVE relocs to find the gcdata on arm64
Michael Hudson-Doyle [Wed, 1 Jul 2015 23:37:51 +0000 (11:37 +1200)]
cmd/link: look at the R_AARCH64_RELATIVE relocs to find the gcdata on arm64

Change-Id: I5a1864a27ad917aa65c8e65a133f6cc0a980d05f
Reviewed-on: https://go-review.googlesource.com/13998
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj/arm64, cmd/link: use two instructions rather than three for loads...
Michael Hudson-Doyle [Mon, 3 Aug 2015 03:45:37 +0000 (15:45 +1200)]
cmd/internal/obj/arm64, cmd/link: use two instructions rather than three for loads from memory

Reduces size of godoc .text section by about 75k (or 1.4%).

Change-Id: I65850aa569aefbddd6cb07c6ae1addcc39cab6a5
Reviewed-on: https://go-review.googlesource.com/13993
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/go: clean the directory path containing the packages
Mohit Agarwal [Mon, 9 Nov 2015 19:26:14 +0000 (00:56 +0530)]
cmd/go: clean the directory path containing the packages

The heuristic for determining if the packages or commands are stale
fails as the mtime comparison happens even though the GOROOT and
current package paths are the same, since the path name isn't
canonicalized before the comparison (GOROOT is).

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

9 years agocmd/compile/internal/gc: fix go.y to match y.go
Robert Griesemer [Mon, 9 Nov 2015 19:26:25 +0000 (11:26 -0800)]
cmd/compile/internal/gc: fix go.y to match y.go

In https://go-review.googlesource.com/#/c/16554/ y.go was modified
manually, but go.y (which is the source for y.go) was not changed.

Change-Id: I1273801bfd1ac65b875f4465033b0d062abff0b7
Reviewed-on: https://go-review.googlesource.com/16745
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: simplify chan ops, take 2
Keith Randall [Sun, 8 Nov 2015 05:28:21 +0000 (21:28 -0800)]
runtime: simplify chan ops, take 2

This change is the same as CL #9345 which was reverted,
except for a small bug fix.

The only change is to the body of sendDirect and its callsite.
Also added a test.

The problem was during a channel send operation.  The target
of the send was a sleeping goroutine waiting to receive.  We
basically do:
1) Read the destination pointer out of the sudog structure
2) Copy the value we're sending to that destination pointer
Unfortunately, the previous change had a goroutine suspend
point between 1 & 2 (the call to sendDirect).  At that point
the destination goroutine's stack could be copied (shrunk).
The pointer we read in step 1 is no longer valid for step 2.

Fixed by not allowing any suspension points between 1 & 2.
I suspect the old code worked correctly basically by accident.

Fixes #13169

The original 9345:

This change removes the retry mechanism we use for buffered channels.
Instead, any sender waking up a receiver or vice versa completes the
full protocol with its counterpart.  This means the counterpart does
not need to relock the channel when it wakes up.  (Currently
buffered channels need to relock on wakeup.)

For sends on a channel with waiting receivers, this change replaces
two copies (sender->queue, queue->receiver) with one (sender->receiver).
For receives on channels with a waiting sender, two copies are still required.

This change unifies to a large degree the algorithm for buffered
and unbuffered channels, simplifying the overall implementation.

Fixes #11506

Change-Id: I57dfa3fc219cffa4d48301ee15fe5479299efa09
Reviewed-on: https://go-review.googlesource.com/16740
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/link, runtime: arm implementation of addmoduledata
Michael Hudson-Doyle [Wed, 2 Sep 2015 10:25:57 +0000 (22:25 +1200)]
cmd/link, runtime: arm implementation of addmoduledata

Change-Id: I3975e10c2445e23c2798a7203a877ff2de3427c7
Reviewed-on: https://go-review.googlesource.com/14189
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: send all go build -n output to stderr
Dominik Honnef [Sun, 8 Nov 2015 19:27:14 +0000 (20:27 +0100)]
cmd/go: send all go build -n output to stderr

Also change a -v print, for consistency.

Fixes #12913

Change-Id: I6cc067d9f8dac66b1f9d1a675e0fbe0528371d0d
Reviewed-on: https://go-review.googlesource.com/16737
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/go, cmd/link: allow -buildmode=pie on linux/ppc64le
Michael Hudson-Doyle [Sun, 11 Oct 2015 23:32:03 +0000 (12:32 +1300)]
cmd/go, cmd/link: allow -buildmode=pie on linux/ppc64le

Change-Id: I0d0abbb9503c3a3c35d846fc0379836b2c483dea
Reviewed-on: https://go-review.googlesource.com/15962
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/internal/obj, cmd/link: handle the fact that a few store/loads on ppc64 are DS...
Michael Hudson-Doyle [Tue, 8 Sep 2015 03:21:58 +0000 (15:21 +1200)]
cmd/internal/obj, cmd/link: handle the fact that a few store/loads on ppc64 are DS form

Change-Id: I4fe1af48ec1cd8a23e2f7f2a0257dc989ff7aced
Reviewed-on: https://go-review.googlesource.com/14235
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/ld: skip dwarf output if dsymutil no-ops
Tamir Duberstein [Sun, 8 Nov 2015 00:30:25 +0000 (19:30 -0500)]
cmd/internal/ld: skip dwarf output if dsymutil no-ops

Fixes #11994.

Change-Id: Icee6ffa6e3a9d15b68b4ae9b2716d65ecbdba73a
Reviewed-on: https://go-review.googlesource.com/16702
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/asm/internal/lex: format error correctly
Dominik Honnef [Wed, 28 Oct 2015 06:44:35 +0000 (07:44 +0100)]
cmd/asm/internal/lex: format error correctly

Error doesn't take a format string and appends its own newline. Phrase
the error like the other ones.

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

9 years agonet/http: update bundled http2 revision
Brad Fitzpatrick [Sun, 8 Nov 2015 10:45:04 +0000 (11:45 +0100)]
net/http: update bundled http2 revision

Updates to git rev 042ba42f (https://golang.org/cl/16734)

This moves all the code for glueing the HTTP1 and HTTP2 transports
together out of net/http and into x/net/http2 where others can use it,
and where it has tests.

Change-Id: I143ac8bb61eed36c87fd838b682ebb37b81b8c2c
Reviewed-on: https://go-review.googlesource.com/16735
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agogo/build: introduce go1.6 build tag
Brad Fitzpatrick [Sun, 8 Nov 2015 09:41:20 +0000 (10:41 +0100)]
go/build: introduce go1.6 build tag

This is needed now for subrepos to be able to conditionally use
API symbols found only after Go 1.5.

Change-Id: I91f8a1154e2a74008e8ca79490e3f12847f9c3b2
Reviewed-on: https://go-review.googlesource.com/16733
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/compile: mark duffzero as using X0, not AX
Keith Randall [Fri, 6 Nov 2015 16:35:55 +0000 (08:35 -0800)]
cmd/compile: mark duffzero as using X0, not AX

duffzero was changed to use X0 instead of AX in
CL 14408.  This was missed as part of that change.

Change-Id: I72fb0114cfbc035b83bfaa8631d27e6740da2652
Reviewed-on: https://go-review.googlesource.com/16717
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>