1
0
mirror of https://github.com/golang/go synced 2024-11-13 13:30:24 -07:00
Commit Graph

35432 Commits

Author SHA1 Message Date
Ian Lance Taylor
b3398f8fa8 [release-branch.go1.10] cmd/go: permit pkg-config flags in any argument position
Fixes #23875

Change-Id: I503af71f44d11cd6b787fef100246b55735614a0
Reviewed-on: https://go-review.googlesource.com/94896
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102779
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-03-29 06:07:04 +00:00
Ian Lance Taylor
6936a87ce1 [release-branch.go1.10] cmd/go: restrict meta imports to valid schemes
Before this change, when using -insecure, we permitted any meta import
repo root as long as it contained "://". When not using -insecure, we
restrict meta import repo roots to be valid URLs. People may depend on
that somehow, so permit meta import repo roots to be invalid URLs, but
require them to have valid schemes per RFC 3986.

Fixes #23867

Change-Id: Iac666dfc75ac321bf8639dda5b0dba7c8840922d
Reviewed-on: https://go-review.googlesource.com/94603
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/102778
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-03-29 06:06:56 +00:00
Andrew Bonventre
678dede7bc [release-branch.go1.10] doc: update devel/release.html to add Go 1.10
Change-Id: I869f1607b0209ad190bc02999879f0682965fdf7
Reviewed-on: https://go-review.googlesource.com/94915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 27be37a4038e0c5e11510e7b0b6ec4f2c4cfc879)
Reviewed-on: https://go-review.googlesource.com/94916
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-02-17 04:48:18 +00:00
Andrew Bonventre
bf86aec259 [release-branch.go1.10] go1.10
Change-Id: I3663c2156d093efa09343512a69f040ecc8331e0
Reviewed-on: https://go-review.googlesource.com/94696
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-16 16:05:53 +00:00
Ian Lance Taylor
0b3f04d5f9 [release-branch.go1.10] cmd/go: add options to security whitelist
Also permit passing flags to pkg-config, as we used to.

Also change the error message to refer to https://golang.org/s/invalidflag.

Fixes #23749

Change-Id: I3fbeb4c346610e6fd55e8720e720b0a40e352ab5
Reviewed-on: https://go-review.googlesource.com/93836
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit f7c2a71632)
Reviewed-on: https://go-review.googlesource.com/94676
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-02-16 04:02:32 +00:00
Ian Lance Taylor
d1fbe07092 [release-branch.go1.10] cmd/compile: permit go:cgo_import_dynamic anywhere
It's used on Solaris to import symbols from shared libraries, e.g., in
golang.org/x/sys/unix and golang.org/x/net/internal/socket.
We could use a different directive but that would require build tags
in all the places that use it.

Updates #23672
Updates #23749

Change-Id: I47fcf72a6d2862e304204705979c2056c2f78ec5
Reviewed-on: https://go-review.googlesource.com/94018
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 4a54ff21c25f1b5d7a4f73fd33214e1f8c83a9b9)
Reviewed-on: https://go-review.googlesource.com/94675
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-02-16 03:42:46 +00:00
Ian Lance Taylor
c622ec556b [release-branch.go1.10] doc: add note about invalid flag errors to 1.10 release notes
Updates #23672
Updates #23749

Change-Id: I85b6493bd1e4095398508b7ef395c35463dfbde1
Reviewed-on: https://go-review.googlesource.com/94158
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
(cherry picked from commit f2354d0aac)
Reviewed-on: https://go-review.googlesource.com/94655
2018-02-16 00:48:11 +00:00
Brad Fitzpatrick
07a153e0a4 [release-branch.go1.10] doc: mention net/http Server Content-Type change
Updates #20784

Change-Id: Ic07c78a86da5026e407ac9ecb3117d320c198048
Reviewed-on: https://go-review.googlesource.com/93695
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-15 23:27:04 +00:00
Ian Lance Taylor
65b209897f [release-branch.go1.10] doc: remove draft notice from Go 1.10 release notes
Change-Id: I063b556b59ecb8a8f4a3f121c32982b90eee2d74
Reviewed-on: https://go-review.googlesource.com/94159
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 229a8ce639)
Reviewed-on: https://go-review.googlesource.com/94455
2018-02-15 18:55:47 +00:00
Keith Randall
a68e93791d [release-branch.go1.10] cmd/compile: fix constant folding of right shifts on s390x
Repeat previous fix on amd64 for s390x.
Sub-word right shifts should sign extend before shifting.

Update #23812

Change-Id: I2d770190c7d8a22310b0dbd9facb3fb05afa362a
Reviewed-on: https://go-review.googlesource.com/94028
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 1566bf9025)
Reviewed-on: https://go-review.googlesource.com/94216
2018-02-15 03:01:46 +00:00
Keith Randall
419e6f0835 [release-branch.go1.10] cmd/compile: fix constant folding of right shifts
The sub-word shifts need to sign-extend before shifting, to avoid
bringing in data from higher in the argument.

Fixes #23812

Change-Id: I0a95a0b49c48f3b40b85765bb4a9bb492be0cd73
Reviewed-on: https://go-review.googlesource.com/93716
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit 755b36aa53)
Reviewed-on: https://go-review.googlesource.com/94215
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-15 03:01:30 +00:00
Andrew Bonventre
4c4ce3dc79 all: restore changes from faulty merge/revert
This reverts commit 3b6abd8a45.

Change-Id: I8ca100501c1844af78a547989786d14dac6b494a
Reviewed-on: https://go-review.googlesource.com/93456
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-02-12 20:13:59 +00:00
Andrew Bonventre
3b6abd8a45 Revert "[release-branch.go1.10] all: merge master into release-branch.go1.10"
This reverts commit b83d7f7253.

Reason for revert: wrong branch

Change-Id: I28ebb121f7b3e331729e8a6a00961b876f3dd0f2
Reviewed-on: https://go-review.googlesource.com/93455
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-02-12 20:10:09 +00:00
Andrew Bonventre
b83d7f7253 [release-branch.go1.10] all: merge master into release-branch.go1.10
* 74b56022a1 doc: note that x509 cert parsing rejects some more certs now
* c52e27e68d CONTRIBUTING: remove Pull Request bit
* 829b64c1ea cmd/fix: fix cast check
* ee59f6dff2 doc: minor wording improvement to the diagnostics guide
* c6e7330ebd all: remove PULL_REQUEST_TEMPLATE from .github
* d814c2be9b doc: remove Pull Request note in README.md
* 104445e314 doc: document Go 1.9.4 and Go 1.8.7

Change-Id: I58bfc6800964504258690d774a9b0aeaba509086
2018-02-12 15:06:08 -05:00
Brad Fitzpatrick
74b56022a1 doc: note that x509 cert parsing rejects some more certs now
Fixes #23711
2018-02-12 15:01:02 -05:00
Brad Fitzpatrick
c52e27e68d CONTRIBUTING: remove Pull Request bit
Also remove the "Also, please do not post patches on the issue
tracker" part, since that didn't seem to reduce the number of patches
inlined into bug reports. And now that we accept PRs, people will
probably try that first. We'll see.

Fixes #23779
Updates #18517

Change-Id: I449e0afd7292718e57d9d428494799c78296a0d2
Reviewed-on: https://go-review.googlesource.com/93335
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-02-11 20:41:48 +00:00
Keith Randall
829b64c1ea cmd/fix: fix cast check
Need 2-result cast so we can check the result correctly.

Fixes #23762

Change-Id: Icac3a5415156fe918988f369d6022a9a29c14089
Reviewed-on: https://go-review.googlesource.com/93078
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-02-09 19:47:55 +00:00
Russ Cox
497161dfd9 [dev.boringcrypto.go1.10] build: delete VERSION (this is a dev branch)
Change-Id: Ie98737c68069eeef1d6e46eb39e92ec9d68c9752
Reviewed-on: https://go-review.googlesource.com/93097
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-02-09 16:25:18 +00:00
Russ Cox
8c59903b07 [dev.boringcrypto.go1.10] all: merge go1.10rc2 into dev.boringcrypto
Change-Id: Idc7227ae4c8c683e175bbcdcad206daa37c07592
2018-02-09 11:13:48 -05:00
JBD
ee59f6dff2 doc: minor wording improvement to the diagnostics guide
Change-Id: I8469fbbb934f096f04ad68c592aacdb805b6d2d4
GitHub-Last-Rev: 6d2cfcc23d
GitHub-Pull-Request: golang/go#23754
Reviewed-on: https://go-review.googlesource.com/92996
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-02-09 01:22:35 +00:00
Andrew Bonventre
c6e7330ebd all: remove PULL_REQUEST_TEMPLATE from .github
Update golang/go#18517

Change-Id: I76d928d5fcc5ed22beaffb86f0fa8fbf6d4ac3d7
Reviewed-on: https://go-review.googlesource.com/93035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-09 00:31:15 +00:00
Andrew Bonventre
d814c2be9b doc: remove Pull Request note in README.md
Since we now accept Pull Requests via GerritBot, this comment is obsolete.

Change-Id: I0de8ecff7d1f146320a52f143e65068f8adbeaa6
GitHub-Last-Rev: 01818bdf7a
GitHub-Pull-Request: golang/go#23752
Reviewed-on: https://go-review.googlesource.com/92995
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-08 23:55:32 +00:00
Russ Cox
104445e314 doc: document Go 1.9.4 and Go 1.8.7
Change-Id: I50928e7747f43858fc863b53cfb5b63e208d6932
Reviewed-on: https://team-review.git.corp.google.com/213447
Reviewed-by: Andrew Bonventre <andybons@google.com>
2018-02-07 19:22:09 +00:00
Russ Cox
20e228f2fd [release-branch.go1.10] go1.10rc2
Change-Id: I393ff9e8599d20f71545ab9f4191993f5d6fa5a4
Reviewed-on: https://team-review.git.corp.google.com/213247
Reviewed-by: Andrew Bonventre <andybons@google.com>
2018-02-07 16:12:58 +00:00
Russ Cox
dce0eb2dd2 [release-branch.go1.10] all: merge master into release-branch.go1.10, for go1.10rc2
This adds the go get security fix.

* 1dcb5836 cmd/go: accept only limited compiler and linker flags in #cgo directives

Change-Id: Ib2caf2039d2cefabe3afa0bb4dcc4c0dc8d664ff
2018-02-07 10:41:55 -05:00
Russ Cox
1dcb5836ad cmd/go: accept only limited compiler and linker flags in #cgo directives
Both gcc and clang accept an option -fplugin=code.so to load
a plugin from the ELF shared object file code.so.
Obviously that plugin can then do anything it wants
during the build. This is contrary to the goal of "go get"
never running untrusted code during the build.
(What happens if you choose to run the result of
the build is your responsibility.)

Disallow this behavior by only allowing a small set of
known command-line flags in #cgo CFLAGS directives
(and #cgo LDFLAGS, etc).

The new restrictions can be adjusted by the environment
variables CGO_CFLAGS_ALLOW, CGO_CFLAGS_DISALLOW,
and so on. See the documentation.

In addition to excluding cgo-defined flags, we also have to
make sure that when we pass file names on the command
line, they don't look like flags. So we now refuse to build
packages containing suspicious file names like -x.go.

A wrinkle in all this is that GNU binutils uniformly accept
@foo on the command line to mean "if the file foo exists,
then substitute its contents for @foo in the command line".
So we must also reject @x.go, flags and flag arguments
beginning with @, and so on.

Fixes #23672, CVE-2018-6574.

Change-Id: I59e7c1355155c335a5c5ae0d2cf8fa7aa313940a
Reviewed-on: https://team-review.git.corp.google.com/209949
Reviewed-by: Ian Lance Taylor <iant@google.com>
2018-02-07 15:35:57 +00:00
Russ Cox
924ef1c8ea all: merge master into release-branch.go1.10, for go1.10rc2
* b2d3d6e6 cmd/link/internal/loadelf: fix logic for computing ELF flags on ARM
* c07095cd cmd/cgo: revert CL 49490 "fix for function taking pointer typedef"
* 23e8e197 cmd/compile: use unsigned loads for multi-element comparisons
* 85bdd05c cmd/go: rebuild as needed for tests of packages that add methods
* fd7331a8 text/template: revert CL 66410 "add break, continue actions in ranges"
* f54f780d cmd/vet: unexported interface{} fields on %s are ok
* a0222ec5 cmd/internal/obj/arm64: fix assemble add/adds/sub/subs/cmp/cmn(extended register) bug
* 59523176 cmd/go: only run -race test if -race works
* 4558321e doc/editors: remove feature matrix for various editors/IDEs
* e6756ec1 cmd/go: ignore coverpkg match on sync/atomic in atomic coverage mode
* 10d096fe cmd/go: fix import config debugging flag
* f598ad58 go/internal/gccgoimporter: remove old and exp gccgo packages in test
* 2a8229d9 misc/cgo/test: get uintptr, not pointer, from dlopen
* 851e98f0 spec: remove need for separate Function production (cleanup)
* cbe1a61e net: fix the kernel state name for TCP listen queue on FreeBSD
* 6f37fee3 cmd/go: fix TestNoCache on Plan 9
* e5186895 runtime: restore RSB for sigpanic call on mips64x
* 3ff41cdf runtime: suppress "unexpected return pc" any time we're in cgo
* d929e40e syscall: use SYS_GETDENTS64 on linux/mips64{,le}
* 43288467 test: add test for gccgo bug 23545
* 19150303 cmd/go: if unable to initialize cache, just disable it
* ebe38b86 runtime: fail silently if we unwind over sigpanic into C code
* 5c2be42a runtime: don't unwind past asmcgocall
* 03e10bd9 os/signal: skip TestTerminalSignal if posix_openpt fails with EACCES
* d30591c1 cmd/vendor/github.com/google/pprof: cherry-pick fix to cope with $HOME not being writable
* bcc86d5f doc: add GOMIPS to source installation docs
* 926f2787 cmd/fix: cleanup directories created during typecheck
* 32a08d09 bootstrap.bash: only fetch git revision if we need it
* 14f8027a cmd/vet: extra args if any formats are indexed are ok
* 4072608b cmd/vet: %s is valid for an array of stringer
* 1f85917f cmd/vet: **T is not Stringer if *T has a String method
* 8c1f21d9 cmd/vet: disable complaint about 0 flag in print
* d529aa93 doc: fix the closing tag in contribute.html
* f8610bbd doc: fix two small mistakes in 1.10 release notes
* 5af1e7d7 cmd/go: skip external tests on plan9/arm
* 00587e89 doc: fix spelling mistake
* 3ee8c3cc os: document inheritance of thread state over exec
* b5b35be2 cmd/compile: don't inline functions that call recover
* 651ddbdb database/sql: buffers provided to Rows.Next should not be modified by drivers
* 7350297e doc: remove Sarah Adams from conduct working group contacts

Change-Id: I3c04d83706cd4322252ddf732688afe5d938c1f5
2018-02-07 09:35:39 -05:00
Michael Hudson-Doyle
b2d3d6e676 cmd/link/internal/loadelf: fix logic for computing ELF flags on ARM
The linker contains complicated logic for figuring out which float ABI to
indicate it is using on (32 bit) ARM systems: it parses a special section in
host object files to look for a flag indicating use of the hard float ABI. When
loadelf got split into its own package a bug was introduced: if the last host
object file does not contain a float ABI related tag, the ELF header's flag was
set to 0, rather than using the value from the last object file which contained
an ABI tag. Fix the code to only change the value used for the ELF header if a
tag was found.

This fixes an extremely confusing build failure on Ubuntu's armhf builders.

Change-Id: I0845d68d082d1383e4cae84ea85164cdc6bcdddb
Reviewed-on: https://go-review.googlesource.com/92515
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-07 05:10:13 +00:00
Ian Lance Taylor
c07095cd28 cmd/cgo: revert CL 49490 "fix for function taking pointer typedef"
CL 49490 fixed a warning when compiling the C code generated by cgo,
but it introduced typedef conflicts in Go code that cgo is supposed to
avoid.

Original CL description:

    cmd/cgo: fix for function taking pointer typedef

    Fixes #19832

Updates #19832
Fixes #23720

Change-Id: I22a732db31be0b4f7248c105277ab8ee44ef6cfb
Reviewed-on: https://go-review.googlesource.com/92455
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2018-02-07 01:20:30 +00:00
Keith Randall
23e8e197b0 cmd/compile: use unsigned loads for multi-element comparisons
When loading multiple elements of an array into a single register,
make sure we treat them as unsigned.  When treated as signed, the
upper bits might all be set, causing the shift-or combo to clobber
the values higher in the register.

Fixes #23719.

Change-Id: Ic87da03e9bd0fe2c60bb214b99f846e4e9446052
Reviewed-on: https://go-review.googlesource.com/92335
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
2018-02-06 18:24:33 +00:00
Russ Cox
85bdd05c05 cmd/go: rebuild as needed for tests of packages that add methods
If A's external test package imports B, which imports A,
and A's (internal) test code also adds something to A that
invalidates anything in the export data from a build of A
without its test code, then strictly speaking we need to
rebuild B against the test-augmented version of A before
using it to build A's external test package.

We've been skating by without doing this for a very long time,
but I knew we'd need to handle it better eventually,
I planned for it in the new build cache simplifications,
and the code was ready. Now that we have a real-world
test case that needs it, turn on the "proper rebuilding" code.

It doesn't really matter how much things slow down, since
a real-world test cases that caused an internal compiler error
before is now handled correctly, but it appears to be small:
I wasn't able to measure an effect on "go test -a -c fmt".
And of course most builds won't use -a and will be cached well.

Fixes #6204.
Fixes #23701.

Change-Id: I2cd60cf400d1928428979ab05831f48ff7cee6ca
Reviewed-on: https://go-review.googlesource.com/92215
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-06 17:00:03 +00:00
Ian Lance Taylor
fd7331a821 text/template: revert CL 66410 "add break, continue actions in ranges"
The new break and continue actions do not work in html/template, and
fixing them requires thinking about security issues that seem too
tricky at this stage of the release. We will try again for 1.11.

Original CL description:

    text/template: add break, continue actions in ranges

    Adds the two range control actions "break" and "continue". They act the
    same as the Go keywords break and continue, but are simplified in that
    only the innermost range statement can be broken out of or continued.

    Fixes #20531

Updates #20531
Updates #23683

Change-Id: Ia7fd3c409163e3bcb5dc42947ae90b15bdf89853
Reviewed-on: https://go-review.googlesource.com/92155
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-02-06 05:00:01 +00:00
Daniel Martí
f54f780d2f cmd/vet: unexported interface{} fields on %s are ok
For example, the following program is valid:

	type T struct {
		f interface{}
	}

	func main() {
		fmt.Printf("%s", T{"foo"}) // prints {foo}
	}

Since the field is of type interface{}, we might have any value in it.
For example, if we had T{3}, fmt would complain. However, not knowing
what the type under the interface is, we must be conservative.

However, as shown in #17798, we should issue an error if the field's
type is statically known to implement the error or fmt.Stringer
interfaces. In those cases, the user likely wanted the %s format to call
those methods. Keep the vet error in those cases.

While at it, add more field type test cases, such as custom error types,
and interfaces that extend the error interface.

Fixes #23563.

Change-Id: I063885955555917c59da000391b603f0d6dce432
Reviewed-on: https://go-review.googlesource.com/90516
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-06 04:43:35 +00:00
Russ Cox
c3d83ee31c [dev.boringcrypto] misc/boring: add go1.9.3b4 to RELEASES
Change-Id: Id35acb81b1d8e9cd17d3fe34ebe1395a4d1b6f0a
Reviewed-on: https://go-review.googlesource.com/92195
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-02-06 03:31:28 +00:00
fanzha02
a0222ec518 cmd/internal/obj/arm64: fix assemble add/adds/sub/subs/cmp/cmn(extended register) bug
The current code encodes the wrong option value in the binary.

The fix reconstructs the function opxrrr() that does not encode the option
value into the binary value when arguments is sign or zero-extended register.

Add the relevant test cases and negative tests.

Fixes #23501
Change-Id: Ie5850ead2ad08d9a235a5664869aac5051762f1f
Reviewed-on: https://go-review.googlesource.com/88876
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-02-06 00:25:23 +00:00
Ian Lance Taylor
5952317637 cmd/go: only run -race test if -race works
Updates #23694

Change-Id: I5fdad8cceacb8bbc85ca2661eb6482aa80343656
Reviewed-on: https://go-review.googlesource.com/92075
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-05 21:08:18 +00:00
Andrew Bonventre
4558321eb2 doc/editors: remove feature matrix for various editors/IDEs
The speed of feature development for these products outpaces the
standard Go 6-month release cycle tied to this page. The cost of
maintaining this list is becoming a burden as we make every
attempt at being impartial. As of this writing, we believe feature
lists belong on the pages of the editors/IDEs themselves.

Change-Id: Ie2dfe0e0d47d203c913373e58cbb65cb0fb14d0c
Reviewed-on: https://go-review.googlesource.com/91976
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-05 18:37:02 +00:00
Ian Lance Taylor
e6756ec149 cmd/go: ignore coverpkg match on sync/atomic in atomic coverage mode
Otherwise we get into a dependency loop as we try to apply coverage
analysis to sync/atomic when the coverage analysis itself requires
sync/atomic.

Fixes #23694

Change-Id: I3a74ef3881ec5c6197ed348acc7f9e175417f6c7
Reviewed-on: https://go-review.googlesource.com/91875
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-02-05 15:32:06 +00:00
Russ Cox
10d096fec2 cmd/go: fix import config debugging flag
Was improperly bypassed in a couple places.

Change-Id: I13426b3efe68b9e67324c283540d0ef7b81b3d41
Reviewed-on: https://go-review.googlesource.com/91636
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-02 21:02:56 +00:00
Ian Lance Taylor
f598ad5820 go/internal/gccgoimporter: remove old and exp gccgo packages in test
The old and exp packages listed in gccgoinstallation_test.go have been
removed from gccgo. Remove them from the test.

Fixes #20932

Change-Id: I04a5148e18dccef332904b836c42098b55f2516c
Reviewed-on: https://go-review.googlesource.com/91656
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-02-02 20:06:07 +00:00
Ian Lance Taylor
2a8229d96e misc/cgo/test: get uintptr, not pointer, from dlopen
The dlopen function returns an opaque handle, and it is possible for
it to look like a Go pointer, causing garbage collector and cgo
confusion.

Fixes #23663

Change-Id: Id080e2bbcee8cfa7ac4a457a927f96949eb913f8
Reviewed-on: https://go-review.googlesource.com/91596
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-02-02 18:42:10 +00:00
Robert Griesemer
851e98f0ee spec: remove need for separate Function production (cleanup)
The EBNF production

	Function = Signature FunctionBody .

was used in FunctionDecl, MethodDecl, and FunctionLit, but only
for the latter it shortened the syntax slightly.

This change "inlines" Function which simplifies FunctionDecl and
MethodDecl and gets rid of the Function production.

This has no impact on the specified language. Also, the Function
production is never referred to by the prose, so it's safe to
remove it from the spec.

Finally, neither go/ast nor go/parser have a representation of
this production via a corresponding node or parse function, so
no possibly valuable documentation is lost, either.

Change-Id: Ia2875d31c6ec2d2079081ef481e50bad4f43c694
Reviewed-on: https://go-review.googlesource.com/91515
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-02-02 00:22:16 +00:00
Mikio Hara
cbe1a61e74 net: fix the kernel state name for TCP listen queue on FreeBSD
Fixes #23653.

Change-Id: Ic1e3c8f156ae576cfb5da1b4d082d4b12fae114f
Reviewed-on: https://go-review.googlesource.com/91317
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-02-02 00:04:20 +00:00
David du Colombier
6f37fee354 cmd/go: fix TestNoCache on Plan 9
CL 91097 added TestNoCache. However, this
test is failing on Plan 9 because the HOME
environment variable doesn't contain the
home directory where the Go cache is located.

This change fixes the TestNoCache test
by using the home environment variable
instead of HOME on Plan 9.

Fixes #23644.

Change-Id: Icfb7a7a4c2852f159c93032b4081411628a2787f
Reviewed-on: https://go-review.googlesource.com/91216
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-31 22:12:10 +00:00
Austin Clements
e5186895fc runtime: restore RSB for sigpanic call on mips64x
preparePanic must set all registers expected by Go runtime conventions
in case the sigpanic is being injected into C code. However, on
mips64x it fails to restore RSB (R28). As a result, if C code modifies
RSB and then raises a signal that turns into a sigpanic call, sigpanic
may crash when it attempts to lock runtime.debuglock (the first global
it references).

Fix this by restoring RSB in the signal context using the same
convention as main and sigtramp.

Fixes #23641.

Change-Id: Ib47e83df89e2a3eece10f480e4e91ce9e4424388
Reviewed-on: https://go-review.googlesource.com/91156
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-31 20:57:53 +00:00
Austin Clements
3ff41cdffa runtime: suppress "unexpected return pc" any time we're in cgo
Currently, gentraceback suppresses the "unexpected return pc" error
for sigpanic's caller if the M was running C code.

However, there are various situations where a sigpanic is injected
into C code that can cause traceback to unwind *past* the sigpanic
before realizing that it's in trouble (the traceback beyond the
sigpanic will be wrong).

Rather than try to fix these issues for Go 1.10, this CL simply
disables complaining about unexpected return PCs if we're in cgo
regardless of whether or not they're from the sigpanic frame. Go 1.9
never complained about unexpected return PCs when printing, so this is
simply a step closer to the old behavior.

This should fix the openbsd-386 failures on the dashboard, though this
issue could affect any architecture.

Fixes #23640.

Change-Id: I8c32c1ee86a70d2f280661ed1f8caf82549e324b
Reviewed-on: https://go-review.googlesource.com/91136
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-31 20:57:52 +00:00
Tobias Klauser
d929e40e9a syscall: use SYS_GETDENTS64 on linux/mips64{,le}
The getdents64 syscall is only available for mips64/mips64le starting
with Linux kernel 3.10. Since mips64le requires at least 4.8 according
to [1] (regarding #16848) using it should be fine.

[1] https://golang.org/wiki/MinimumRequirements

This CL changes the binary layout of type Dirent for mips64/mips64le,
but not the public API. But since the currently used layout doesn't
match the struct linux_dirent returned by the getdents syscall this
should be fine as well.

Fixes #23624

Change-Id: Iaa7306fa6e4442ad2fed41c60b37627a7314f117
Reviewed-on: https://go-review.googlesource.com/91055
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-01-31 20:42:49 +00:00
Cherry Zhang
43288467d2 test: add test for gccgo bug 23545
The fix is CL 91035.

Build only with gccgo at the moment, as it hits issue #23546.

Updates #23545.

Change-Id: I3a1367bb31b04773d31f71016f8fd7bd1855d7b5
Reviewed-on: https://go-review.googlesource.com/89735
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-31 20:03:31 +00:00
Ian Lance Taylor
1915030318 cmd/go: if unable to initialize cache, just disable it
Fixes #23638

Change-Id: I51967290448217f371fc7aba9259918ee9857143
Reviewed-on: https://go-review.googlesource.com/91097
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-01-31 19:35:00 +00:00
Austin Clements
ebe38b867c runtime: fail silently if we unwind over sigpanic into C code
If we're running C code and the code panics, the runtime will inject a
call to sigpanic into the C code just like it would into Go code.
However, the return PC from this sigpanic will be in C code. We used
to silently abort the traceback if we didn't recognize a return PC, so
this went by quietly. Now we're much louder because in general this is
a bad thing. However, in this one particular case, it's fine, so if
we're in cgo and are looking at the return PC of sigpanic, silence the
debug output.

Fixes #23576.

Change-Id: I03d0c14d4e4d25b29b1f5804f5e9ccc4f742f876
Reviewed-on: https://go-review.googlesource.com/90896
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-31 02:13:21 +00:00