1
0
mirror of https://github.com/golang/go synced 2024-11-27 01:51:23 -07:00
Commit Graph

42482 Commits

Author SHA1 Message Date
Bryan C. Mills
6dbcc8b865 cmd/go: make "finding" logging deterministic
In CL 204777, I made the "finding" messages in cachingRepo only print
after a “longish” delay, on the theory that they would help diagnose
slow or stuck fetches.

However, as I've been testing Go 1.14 beta 1, I've found that these
messages are mostly just noise, and the fact that they are so
nondeterministic causes both confusion and test flakes (#35539).

Moreover, it currently triggers once for each candidate module, when
what we're usually after is actually a specific package within the
module.

So let's log the package operation unconditionally instead of the
module fetches nondeterministically.

Fixes #35539
Updates #26152

Change-Id: I41a1c772465b2f0b357d3402bc372b6907773741
Reviewed-on: https://go-review.googlesource.com/c/go/+/213679
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-09 15:38:00 +00:00
Cherry Zhang
17e97322fb runtime: overwrite asyncPreempt PC when injecting sigpanic on Windows
On Windows, it might be possible that SuspendThread suspends a
thread right between when an exception happens and when the
exception handler runs. (This is my guess. I don't know the
implementation detail of Windows exceptions to be sure.) In this
case, we may inject a call to asyncPreempt before the exception
handler runs. The exception handler will inject a sigpanic call,
which will make the stack trace looks like

sigpanic
asyncPreempt
actual panicking function

i.e. it appears asyncPreempt panicked.

Instead, just overwrite the PC, without pushing another frame.

Fixes #35773.

Change-Id: Ief4e964dcb7f45670b5f93c4dcf285cc1c737514
Reviewed-on: https://go-review.googlesource.com/c/go/+/213879
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2020-01-09 15:37:52 +00:00
Bryan C. Mills
817afe8357 cmd/go: adjust heuristics for skipping +incompatible versions
We know of at least one module (github.com/stripe/stripe-go) that has
a run of +incompatible versions, followed by a run of versions with
go.mod files, followed by another run of +incompatible versions.

We want the heuristics for showing +incompatible versions to reflect
the authors' current intent, and it seems clear that the current
intent of the authors of that module is for users of the unversioned
import path to still be on +incompatible versions.

To respect that intent, we need to keep checking for +incompatible
versions even after we have seen a lower major version with an
explicit go.mod file.

However, we still don't want to download every single version of the
module to check it. A given major version should have a consistent,
canonical import path, so the path (as inferred by the presence or
absence of a go.mod file) should be the same for every release across
that major version.

To avoid unnecessary overhead — and to allow module authors to correct
accidental changes to a major version's import path — we check only
the most recent release of each major version. If a release
accidentally changes the import path in either direction (by deleting
or adding a go.mod file), it can be corrected by issuing a single
subsequent release of that major version to restore the correct path.

I manually verified that, with this change,
github.com/stripe/stripe-go@latest reverts to v68.7.0+incompatible
as it was in Go 1.13.
The other regression tests for #34165 continue to pass.

Updates #34165

Change-Id: I5daff3cd2123f94c7c49519babf4eecd509f169e
Reviewed-on: https://go-review.googlesource.com/c/go/+/212317
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-08 20:07:45 +00:00
Keith Randall
2248fc63ab cmd/compile: give every really deep type a unique name
This avoids the security problem in #29312 where two very deep, but
distinct, types are given the same name. They both make it to the
linker which chooses one, and the use of the other is now type unsafe.

Instead, give every very deep type its own name. This errs on the
other side, in that very deep types that should be convertible to each
other might now not be. But at least that's not a security hole.

Update #29312.

Change-Id: Iac0ebe73fdc50594fd6fbf7432eef65f9a053126
Reviewed-on: https://go-review.googlesource.com/c/go/+/213517
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-01-08 18:43:55 +00:00
Luka Zitnik
77c13021dd net/http: document that ParseForm consumes Request.Body
Fixes #35620

Change-Id: I71bc56ec7a7507d14b4f013177b4b816bb1a2094
Reviewed-on: https://go-review.googlesource.com/c/go/+/212458
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-01-08 15:48:04 +00:00
Joel Sing
4b1b18d106 runtime: use FP offsets for pipe/pipe2 on freebsd/arm64 and linux/arm64
This is more readable and less error-prone than using RSP offsets.

Suggested during review of CL 212765.

Change-Id: I070190abeeac8eae5dbd414407602619d9d57422
Reviewed-on: https://go-review.googlesource.com/c/go/+/213577
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-01-08 14:58:33 +00:00
Michael Matloob
daacf26980 cmd/go: fix TestScript/test_main_twice
The TMPDIR environment variable isn't always available. Use $WORK/tmp
instead, to fix this test on Windows.

Change-Id: I521c470430c6eea4d1f2fc7db749d38178a03a13
Reviewed-on: https://go-review.googlesource.com/c/go/+/213680
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-07 21:42:59 +00:00
Michael Matloob
7d98da8d31 cmd/go: fix test broken by incorrect comments
I accidentally used // instead of #.

Change-Id: I2c9b9d40dd83994ce80fc837e8d992d3807f3e24
Reviewed-on: https://go-review.googlesource.com/c/go/+/213659
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-01-07 19:53:19 +00:00
Michael Matloob
52a9210a2c cmd/go: convert import comment tests to script framework
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I30230ca3b4d8b037ea861db952b89e706ed8706d
Reviewed-on: https://go-review.googlesource.com/c/go/+/213425
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-07 18:46:29 +00:00
Michael Matloob
7340d15c85 cmd/go: convert TestImportCycle to the script framework
This test already calls tg.Parallel

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I4cdb2464cd3e51f1369558c238925f036ce8d828
Reviewed-on: https://go-review.googlesource.com/c/go/+/213426
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-07 18:40:18 +00:00
Michael Matloob
b8e2ffcb90 cmd/go: convert tests using testdata/src/testrace to script framework
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Id4c2c58167d5cfc80b0d81ca9ce3db678242c06c
Reviewed-on: https://go-review.googlesource.com/c/go/+/213128
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-07 18:35:31 +00:00
Bryan C. Mills
249c85d3aa net/http: avoid writing to Transport.ProxyConnectHeader
Previously, we accidentally wrote the Proxy-Authorization header for
the initial CONNECT request to the shared ProxyConnectHeader map when
it was non-nil.

Fixes #36431

Change-Id: I5cb414f391dddf8c23d85427eb6973f14c949025
Reviewed-on: https://go-review.googlesource.com/c/go/+/213638
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-07 18:00:57 +00:00
Michael Matloob
98418c998c cmd/go: convert TestTestRegexps to the script framework
It's hard to convert this one exactly because I don't think
we can guarantee that the grep command exists to filter stdout,
so I've tried to replicate the intent of the test.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ib593799ef7634ce12efb3ff357eb34475e2ea321
Reviewed-on: https://go-review.googlesource.com/c/go/+/213130
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-07 17:53:52 +00:00
Michael Matloob
c399afef61 cmd/go: convert TestCoverageImportMainLoop and TestGoTestMain
Convert these two tests to the script framework.

Updates #17751
Updates #36320

Change-Id: I9cc14360fab949dab91f9e5e667be85002ef5926
Reviewed-on: https://go-review.googlesource.com/c/go/+/212811
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-07 17:52:37 +00:00
Michael Matloob
cde230b8b3 cmd/go: remove tests using testdata/flag_test.go
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I6573185cf14f298c51f76265f18a75e4960ce791
Reviewed-on: https://go-review.googlesource.com/c/go/+/213220
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-01-07 16:44:14 +00:00
Joel Sing
bc91947527 runtime: correct assembly for openbsd/arm64
Correct the pipe and pipe2 implementations by using the correct RSP offsets,
used to store and return the file descriptor array.

Fix setNonblock by using the correct immediate value for O_NONBLOCK and
replace EOR (exclusive OR) with ORR.

Also correct the write1 implementation, which has a uintptr value for the fd
argument.

Change-Id: Ibca77af44b649e8bb330ca54f9c36a7a8b0f9cea
Reviewed-on: https://go-review.googlesource.com/c/go/+/212765
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-01-07 16:24:34 +00:00
Julian Tibble
25a14b19ab runtime: fix typo in comment
Change-Id: I96db053184e5e72864514d5421a97774545cc2dd
GitHub-Last-Rev: f1451ab626
GitHub-Pull-Request: golang/go#36425
Reviewed-on: https://go-review.googlesource.com/c/go/+/213597
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-01-07 14:39:24 +00:00
Joel Sing
edf3ec987f runtime: correct setNonblock on linux/arm64
The current code uses EOR (exclusive OR), which will result in the O_NONBLOCK
flag being toggled rather than being set. Other implementations use OR, hence
this is likely a bug.

Change-Id: I5dafa9c572452070bd37789c8a731ad6d04a86cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/212766
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-07 02:56:05 +00:00
Dan Scales
f266cce676 runtime: avoid potential deadlock when tracing memory code
In reclaimChunk, the runtime is calling traceGCSweepDone() while holding the mheap
lock. traceGCSweepDone() can call traceEvent() and traceFlush(). These functions
not only can get various trace locks, but they may also do memory allocations
(runtime.newobject) that may end up getting the mheap lock. So, there may be
either a self-deadlock or a possible deadlock between multiple threads.

It seems better to release the mheap lock before calling traceGCSweepDone(). It is
fine to release the lock, since the operations to get the index of the chunk of
work to do are atomic. We already release the lock to call sweep, so there is no
new behavior for any of the callers of reclaimChunk.

With this change, mheap is a leaf lock (no other lock is ever acquired while it
is held).

Testing: besides normal all.bash, also ran all.bash with --long enabled, since
it does longer tests of runtime/trace.

Change-Id: I4f8cb66c24bb8d424f24d6c2305b4b8387409248
Reviewed-on: https://go-review.googlesource.com/c/go/+/207846
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2020-01-07 00:05:43 +00:00
Brad Fitzpatrick
6b1a3f73ed os: document that File.Seek works on directories, but not portably
Updates #36019

Change-Id: I9fea2c3c5138e2233290979e4724f6e7b91da652
Reviewed-on: https://go-review.googlesource.com/c/go/+/213439
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-01-06 19:03:05 +00:00
Cherry Zhang
d6bf2d7b83 runtime: test memmove writes pointers atomically
In the previous CL we ensures that memmove writes pointers
atomically, so the concurrent GC won't observe a partially
updated pointer. This CL adds a test.

Change-Id: Icd1124bf3a15ef25bac20c7fb8933f1a642d897c
Reviewed-on: https://go-review.googlesource.com/c/go/+/212627
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-06 18:32:21 +00:00
Michael Matloob
822094f047 cmd/go: convert some cgo-related testcases to script framework
This change converts TestCoverageWithCgo and TestCgoConsistentResults
to the script framework.

Change-Id: Ic5a13f6dd6099d3d73a5cda8cbc724a79a3d2c58
Reviewed-on: https://go-review.googlesource.com/c/go/+/212621
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 18:12:55 +00:00
Michael Matloob
d5967a7100 cmd/go: convert TestGoTestWithoutTests to the script framework
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ibc3cb3823bd1c1b80058076f2c9933dc729447a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/213127
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 17:43:15 +00:00
Michael Matloob
562fabcac7 cmd/go/testdata/script: delete trailing space in test
Addressing comment in golang.org/cl/212620. I submitted the
change before I addressed the comment.

Change-Id: I008fdb4fed1e0b2d24d739991fe10122695b90b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/213419
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 17:40:38 +00:00
Michael Matloob
a5cff1e5a5 cmd/go: convert TestIssue17119 to the script test framework
It's already parallel, but we might as well convert it and
get rid of the testdata/src dircetory completely.

Updates #36320

Change-Id: I75e335b32d64a8ddedd65e4337949b729c9e0fbe
Reviewed-on: https://go-review.googlesource.com/c/go/+/212877
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 17:38:44 +00:00
Michael Matloob
fab2e86ba2 cmd/go: convert some testcases to the script framework
This change converts TestFatalInBenchmarkCauseNonZeroExitStatus,
TestBenchmarkLabels and TestWildCardsDoNotLookInUselessDirectories
to the script framework so they can run in parallel. These tests
used the testdata directory so they didn't call tg.parallel, because
they couldn't be sure the testdata directory wasn't being
modified while they were being run.

The tests are converted to the script framework instead of being modified
because the script framework tests are easier to read and are self-contained.

Also remove the directory src/cmd/go/testdata/src/badc. The testcase
that used it, "TestDisallowedCSourceFiles" was deleted in
golang.org/cl/19613.

Updates #17751

Change-Id: I0b9b417ae1a9b148067a3e5f8531229f3414f104
Reviewed-on: https://go-review.googlesource.com/c/go/+/212620
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 17:32:58 +00:00
Michael Matloob
57b22c5116 cmd/go: parallellize more test cases
Sprinkle in some more calls to tg.Parallel in the cmd/go
tests. These are the easy cases that don't operate in the
testdata directory.

I think the best thing to do for those tests that do operate
in testdata is to use the script tests. They're easier to
read and write, and jump into t.Parallel immediately.

Updates #17751

Change-Id: If8aeb8129cfdc0a9aa91f5a540f179790077fce5
Reviewed-on: https://go-review.googlesource.com/c/go/+/212618
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 17:26:08 +00:00
Sean Liao
db66972359 .github: add link to questions in ISSUE_TEMPLATE
Add a link redirecting questions to the wiki page/forums

Change-Id: I05b784e6bb0c260cb01c4535ad05fb17ba80110e
GitHub-Last-Rev: a927ce5c69
GitHub-Pull-Request: golang/go#36413
Reviewed-on: https://go-review.googlesource.com/c/go/+/213440
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-01-06 17:05:31 +00:00
Michael Matloob
e8729a7e58 cmd/go: convert TestGoGenerateBadImports to script framework
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Id1afafad2063d917fd55e08f0725ce3e93201c35
Reviewed-on: https://go-review.googlesource.com/c/go/+/212878
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 16:23:27 +00:00
Michael Matloob
cf7a46c1da cmd/go: convert TestRunPkg to the script framework
Part of the effort to convert all non-parallel cmd/go tests to the script
framework.

Updates #17751
Updates #36320

Change-Id: I2bc0b1e5c03e2c49b5c79ac24a908a202840d5d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/212879
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 16:22:05 +00:00
Brad Fitzpatrick
0a61a195d7 net: update renamed test name in comment
TestSelfConnect from CL 5650071 was renamed TestTCPSelfConnect in CL 21447.

Change-Id: I0de110dbe1da77bfba540a1b51c139f3bedae67f
Reviewed-on: https://go-review.googlesource.com/c/go/+/213437
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-01-06 16:21:24 +00:00
Austin Clements
9d3d4461a5 Revert "cmd/link: skip symbol references when looking for missing symbols"
This reverts commit 8adc1e00aa.

Reason for revert: The test added in this commit fails on several
builders.

Fixes #36389. Re-opens #33979.

Change-Id: I31191098c36af00f7688749b3376686673b3ac68
Reviewed-on: https://go-review.googlesource.com/c/go/+/213417
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
2020-01-06 15:56:20 +00:00
Michael Matloob
2863969cc3 cmd/go: convert TestIssue7108 to the script framework
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ic16a0c6c1eabeba003b9cff620e2911078fd6cf8
Reviewed-on: https://go-review.googlesource.com/c/go/+/212813
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 15:47:54 +00:00
Michael Matloob
72f92def89 cmd/go/testdata: remove directory badmod
It doesn't seem to be used anywhere.

Change-Id: If979b6d69c9bf5261afd980d96f67991c417d46d
Reviewed-on: https://go-review.googlesource.com/c/go/+/213218
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-06 15:47:02 +00:00
Joel Sing
693748e9fa syscall: resync various riscv64 structs with x/sys/unix
For some reason the existing versions have additional padding - manually resync these
structs with those in x/sys/unix, also bringing in pollFd which does not currently
exist for linux/riscv64.

Cross checked with the output from 'go tool cgo -godefs' on a linux/riscv64 machine.

Updates #27532

Change-Id: I9fd2d3ad7222208a138773f4a9153c3c9cad7381
Reviewed-on: https://go-review.googlesource.com/c/go/+/212763
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-01-06 11:46:56 +00:00
Joel Sing
f9813515c0 syscall: provide Renameat as a wrapper around renameat2 on riscv64
linux/riscv64 does not provide a renameat syscall and there is no SYS_RENAMEAT
defined in the syscall package. Provide Renameat as a wrapper around renameat2
instead.

Updates #27532

Change-Id: I4864bdf0055e4272920583dcfb0efe2fd40adcbc
Reviewed-on: https://go-review.googlesource.com/c/go/+/212762
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-01-06 09:24:14 +00:00
Joel Sing
fc5eee3c1d syscall: fix riscv64 syscall assembly
RISCV has no instruction to store an immediate value to memory, or to
subtract an immediate value. An immediate needs to be moved to a register
first, or in the case of $0, the zero value register (ZERO or R0) can be
used instead. Restore the original riscv-go code so that it compiles.

Updates #27532

Change-Id: I3c60e6f385c59679252a710dbba153357a367516
Reviewed-on: https://go-review.googlesource.com/c/go/+/212761
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-01-06 09:24:06 +00:00
Tim Cooper
c6e8426386 all: fix typo in RuneSelf, runeSelf comments
Fixes #36396

Change-Id: I52190f450fa9ac52fbf4ecdc814e954dc29029cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/213377
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-06 02:46:02 +00:00
Joel Sing
8adc1e00aa cmd/link: skip symbol references when looking for missing symbols
ErrorUnresolved attempts to find the missing symbol in another ABI,
in order to provide more friendly error messages. However, in doing so
it checks the same ABI and can find the symbol reference for the symbol
that it is currently reporting the unresolved error for. Avoid this by
ignoring SXREF symbols, which is the same behaviour used when linking
is performed.

Fixes #33979

Change-Id: I3cb2477b2ad4baa7c2007323b983eb29404b0aac
Reviewed-on: https://go-review.googlesource.com/c/go/+/192597
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
2020-01-04 12:10:10 +00:00
Joel Sing
3a6cd4c72d cmd/internal/obj/riscv: correct CALL reloc symbol handling
Move the CALL reloc symbol back to p.From.Sym, rather than p.To.Sym - while
p.To.Sym is the correct final location, the call to lowerJALR flips the p.To
and p.From addresses (and proves that this form of obj.Prog rewriting is not
a good idea).

Updates #27532

Change-Id: Iaf9fa24b05bda32b963f8d243401c6cd82c1355c
Reviewed-on: https://go-review.googlesource.com/c/go/+/212759
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-04 04:11:40 +00:00
Joel Sing
24902c5be6 cmd/internal/obj/riscv: handle MOV rewrites in separate pass
Handle the rewriting of MOV pseudo-instructions in a separate pass. This allows
AMOV to be more readily used by other code, including AGETCALLERPC and ARET
implementations.

Updates #27532

Change-Id: Iea794121210048ed23ed0fb8f3c5e3cd5354a311
Reviewed-on: https://go-review.googlesource.com/c/go/+/212758
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-04 04:10:21 +00:00
Cherry Zhang
2ee2c6232c runtime: don't use R11 in nanotime1/walltime1 on ARM
R11 a.k.a. REGTMP is the temp register used by the assembler. It
may be clobbered if the assembler needs to synthesize
instructions. In particular, in nanotime1/walltime1, the load of
global variable runtime.iscgo clobbers it. So, avoid using R11
to hold a long-lived value.

Fixes #36309.

Change-Id: Iec2ab9d664532cad8fbf58da17f580e64a744f62
Reviewed-on: https://go-review.googlesource.com/c/go/+/212641
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Andrew G. Morgan <agm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-04 01:24:42 +00:00
Daniel Martí
9df93e4d6d doc: document atexit_sleep_ms flag in race_detector
It was pointed out to me that the thread sanitizer library has many more
flags than the ones documented in this doc page. In particular, I was
able to make use of GORACE=atexit_sleep_ms=10 to reduce the amount that
'go test -race' will sleep before finishing.

I'm sure that this flag will be useful to others in the future, so add
it here. This is still not a complete list, but we can simply add useful
flags that work when we think they deserve a mention.

Change-Id: If199d36fd80a0945af90055d110519e5dba27361
Reviewed-on: https://go-review.googlesource.com/c/go/+/200863
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-01-03 23:49:42 +00:00
Jay Conrod
6bcddae1af cmd/go: clarify stderr behavior for 'go help mod download'
Fixes #36297

Change-Id: I2623e9ee386644eddfa9a348ba368c5f1a81f893
Reviewed-on: https://go-review.googlesource.com/c/go/+/213134
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2020-01-03 21:16:40 +00:00
Michael Matloob
9c3869d259 cmd/go: convert TestGoTestImportErrorStack to the script framework
The literal string match had to be turned into a regexp, otherwise
pretty straightforward.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I46f62312f02dc9adf83ed91c6f807420d29fbb12
Reviewed-on: https://go-review.googlesource.com/c/go/+/212939
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-03 21:09:16 +00:00
Michael Matloob
0d09b7e041 cmd/go: convert TestGoBuildNotMain to script framework
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Icd62dc8db55bec52ad326bc370ee7e435aae2559
Reviewed-on: https://go-review.googlesource.com/c/go/+/212812
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-03 19:07:38 +00:00
Michael Matloob
421cefdc59 cmd/go: convert TestRunInternal to the script test framework
This conversion is a bit weird, because the original test runs in the cmd/go
directory, while the script test runs in the GOPATH directory. So even though
it's not necessary for the new test, it changes dircectory to $WORK, so that
its error message regexp can have four components like the original, just
changing the old gopath directory 'testdata' the new one 'gopath'.

Part of converting all tests to script framework to improve test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie5b029c43dc22167278d3104b37c0b57c61326be
Reviewed-on: https://go-review.googlesource.com/c/go/+/212814
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-03 19:05:59 +00:00
Michael Matloob
c57665f4e6 cmd/go: convert TestCoveragePattern to the script framework
This test already runs in parallel, but still convert it to the
script framework so we can delete the testdata/src directory and
remove any ambiguity about which tests can run in parallel.

Updates #36320

Change-Id: I6470979bd8bad0631dc6ead0d4eb9c83878356e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/212815
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-03 19:05:09 +00:00
Michael Matloob
4ffd1a0f1c cmd/go: remove TestGoTestDetectsTestOnlyImportCycles
The error that's tested in this test is also tested in list_test_err.txt
which uses go list -test -deps. Because both commands are just loading
packages, the difference is not meaningful.

Updates #36320
Updates #17751

Change-Id: Ie712a77d64e8985dd908a1afb515ed3ecc0a9985
Reviewed-on: https://go-review.googlesource.com/c/go/+/212937
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-03 19:04:06 +00:00
Michael Matloob
8cc2b73a74 cmd/go: convert TestPluginNonMain to script framework
TestPluginNonMain was broken before this change! (It provided the
wrong directory for testdep/p2: testdata/testdep/p2 instead of
testdata/src/testdep/p2).

Change-Id: Ib815f119bae1d758b500cd8ad82c016cb630d71e
Reviewed-on: https://go-review.googlesource.com/c/go/+/212938
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-01-03 19:02:46 +00:00