1
0
mirror of https://github.com/golang/go synced 2024-11-08 15:16:25 -07:00
Commit Graph

39672 Commits

Author SHA1 Message Date
yo-tak
8b7cf898af cmd/compile, cmd/link: document more flags
Fixes #26533

Change-Id: I5a48d667d474f3f222f9055e51131561a0cf45b6
Reviewed-on: https://go-review.googlesource.com/c/138757
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-25 04:57:20 +00:00
Bryan C. Mills
9d23975d89 cmd/go/internal/modload: ensure that __debug_modinfo__ is not discarded during linking
Fixes #28753
Updates #29628

Change-Id: I4a561be7d491a0d088e656b00151ae1bdbd16a84
Reviewed-on: https://go-review.googlesource.com/c/158357
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2019-01-23 23:13:03 +00:00
Filippo Valsorda
193c16a364 crypto/elliptic: reduce subtraction term to prevent long busy loop
If beta8 is unusually large, the addition loop might take a very long
time to bring x3-beta8 back positive.

This would lead to a DoS vulnerability in the implementation of the
P-521 and P-384 elliptic curves that may let an attacker craft inputs
to ScalarMult that consume excessive amounts of CPU.

This fixes CVE-2019-6486.

Fixes #29903

Change-Id: Ia969e8b5bf5ac4071a00722de9d5e4d856d8071a
Reviewed-on: https://team-review.git.corp.google.com/c/399777
Reviewed-by: Adam Langley <agl@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-on: https://go-review.googlesource.com/c/159218
Reviewed-by: Julie Qiu <julie@golang.org>
2019-01-23 22:01:56 +00:00
Brad Fitzpatrick
1e450aa2f2 net/http: update bundled http2
Updates bundled http2 to x/net git rev ed066c81e7 for:

    http2: Revert a closed stream cannot receive data
    https://golang.org/cl/153977

Updates golang/go#28204

Change-Id: I0a489e4e8a581a107970199f64f0fa9281982efe
Reviewed-on: https://go-review.googlesource.com/c/159179
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-01-23 21:33:28 +00:00
Brad Fitzpatrick
829c5df586 net/url, net/http: reject control characters in URLs
This is a more conservative version of the reverted CL 99135 (which
was reverted in CL 137716)

The net/url part rejects URLs with ASCII CTLs from being parsed and
the net/http part rejects writing them if a bogus url.URL is
constructed otherwise.

Updates #27302
Updates #22907

Change-Id: I09a2212eb74c63db575223277aec363c55421ed8
Reviewed-on: https://go-review.googlesource.com/c/159157
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-01-23 19:31:46 +00:00
Daniel Martí
4edea0f0a7 doc: mention 'go get golang.org/dl/...' in install
I needed Go 1.10 to debug and fix a test failure on that Go version in
x/tools, but I forgot what the magic 'go get' command for this was.

Googling "download specific golang version" and similar keywords showed
no results, presumably because the golang.org/dl subrepo isn't
prominently recommended nor documented anywhere.

The most appropriate documentation page to add this to is doc/install,
since it goes into some detail and is well indexed. We only need a short
section to introduce the trick.

The example does mention a specific version, Go 1.10.7, but I couldn't
imagine a way to make it version-agnostic while still being clear on
what the commands effectively do.

Change-Id: I13158564d76d95caec412cdb35a50a4356df5863
Reviewed-on: https://go-review.googlesource.com/c/157457
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2019-01-23 16:07:39 +00:00
Elias Naur
cd06b2d00d A+C: change email address for Elias Naur
Change-Id: I0eefaed645d5d1f56c408af496c92dbb799977c8
Reviewed-on: https://go-review.googlesource.com/c/159037
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-23 15:05:26 +00:00
Keith Randall
1fb596143c cmd/compile: don't bother compiling functions named "_"
They can't be used, so we don't need code generated for them. We just
need to report errors in their bodies.

This is the minimal CL for 1.12. For 1.13, CL 158845 will remove
a bunch of special cases sprinkled about the compiler to handle "_"
functions, which should (after this CL) be unnecessary.

Update #29870

Change-Id: Iaa1c194bd0017dffdce86589fe2d36726ee83c13
Reviewed-on: https://go-review.googlesource.com/c/158820
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-22 22:06:11 +00:00
Filippo Valsorda
ef82ecd0f6 crypto/subtle: normalize constant time ops docs
ConstantTimeCompare is fairly useless if you can't rely on it being zero
when the slices are different, but thankfully it has that property
thanks to the final ConstantTimeByteEq.

Change-Id: Id51100ed7d8237abbbb15778a259065b162a48ad
Reviewed-on: https://go-review.googlesource.com/c/158643
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
2019-01-22 19:40:30 +00:00
Dmitri Shuralyov
8d2e65d224 cmd/go: copy missing bit of documentation about code generated comment
This CL attempts to restore the clarity of the original specification
at https://golang.org/s/generatedcode that the line may appear
anywhere. It is preferable (for human readability), and most common
for it to be early in the file, but that is merely a convention, not
a strict well-specified requirement. Document it as so.

Background

Issue #13560 was a proposal define a standard for marking files as
generated, one that is suitable to be recognized both by humans
and machine tools. It was accepted, and the final specification
was documented at https://golang.org/s/generatedcode. Its text,
copied exactly:

	Generated files are marked by a line of text that matches
	the regular expression, in Go syntax:

		^// Code generated .* DO NOT EDIT\.$

	The .* means the tool can put whatever folderol it wants in there,
	but the comment must be a single line and must start with Code generated
	and end with DO NOT EDIT., with a period.

	The text may appear anywhere in the file.

The https://golang.org/s/generatedcode link points to a comment
in a very large GitHub issue. That makes it harder to find.
Issue #25433 was opened about moving that information somewhere else.
It was resolved via CL 118756, which added text to cmd/go documentation
at https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source:

	To convey to humans and machine tools that code is generated,
	generated source should have a line early in the file that
	matches the following regular expression (in Go syntax):

		^// Code generated .* DO NOT EDIT\.$

The CL description noted that "This change merely moves that
information to a more visible place." The intention was to preserve
the specification unmodified.

The original specification was very clear that "The text may appear
anywhere in the file." The new text in cmd/go documentation wasn't
very clear. "A line early in the file" is not a precise enough criteria
to be recognized by a machine tool, because there isn't a precise
definition of what lines are "early in the file".

Updates #13560
Updates #25433
Updates #28089

Change-Id: I4e374163b16c3f972f9591ec2647fd3d5a2dd5ae
Reviewed-on: https://go-review.googlesource.com/c/158817
Reviewed-by: Rob Pike <r@golang.org>
2019-01-22 16:23:41 +00:00
Elias Naur
cad6d1fef5 doc/go1.12.html: document rejection of mangled C names
Change-Id: I27ef49815f55a36379b730b77f7e9a4dd5341507
Reviewed-on: https://go-review.googlesource.com/c/158777
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-21 23:31:09 +00:00
Tobias Klauser
8e50e48f4d cmd/cgo: remove duplicate entry from gofmtLineReplacer
CL 158457 added a duplicate entry for the ",\n" -> "," replacement to
gofmtLineReplacer. Remove the duplicate.

Change-Id: I17684fcd19cbc96fa7a7b53bf7c1a6382bf1114f
Reviewed-on: https://go-review.googlesource.com/c/158619
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-21 07:14:48 +00:00
Aaron Cannon
e308807f65 flag: improve docs for PrintDefaults; clarify how to change output destination
The existing docs only mention that it is possible to change the output
destination of PrintDefaults from the default of standard error, but fail to
mention how to actually do so. This change fixes this lack by directing users
to CommandLine.SetOutput.

Fixes #15024

Change-Id: Ieaa7edbebd23d4ea6fa7e53d97a87143d590bdb3
Reviewed-on: https://go-review.googlesource.com/c/145203
Reviewed-by: Rob Pike <r@golang.org>
2019-01-21 05:30:12 +00:00
Filippo Valsorda
6718bb22fe crypto/tls: send a "handshake failure" alert if the RSA key is too small
Fixes #29779

Change-Id: I7eb8b4db187597e07d8ec7d3ff651f008e2ca433
Reviewed-on: https://go-review.googlesource.com/c/158639
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-20 20:01:48 +00:00
Ian Lance Taylor
a15a013772 cmd/cgo: print the right error if mangling detection gccgo fails
Change-Id: I2324f6f51d2bf8a4ae1b139b3933bc78dfa75835
Reviewed-on: https://go-review.googlesource.com/c/158718
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-01-20 19:20:04 +00:00
Filippo Valsorda
5538a9a34f doc/go1.12: mention small RSA keys will cause some TLS handshakes to fail
Updates #29779

Change-Id: I9becaba41ab4cd0bac25b4bedf3f8b19761d8158
Reviewed-on: https://go-review.googlesource.com/c/158638
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-18 22:41:47 +00:00
Filippo Valsorda
6f93f86498 crypto/tls: expand Config.CipherSuites docs
Fixes #29349

Change-Id: Iec16eb2b20b43250249ec85c3d78fd64d1b6e3f3
Reviewed-on: https://go-review.googlesource.com/c/158637
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-18 22:41:42 +00:00
Hana (Hyang-Ah) Kim
1e49021f89 doc/go1.12: mention heap sampling change
This is about a minor change but worthy of note because this
may affect the profile results users will see.

Change-Id: Ie2c4358b248f868662dbc71db587576481aa7238
Reviewed-on: https://go-review.googlesource.com/c/158577
Reviewed-by: Raul Silvera <rauls5382@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
2019-01-18 20:47:38 +00:00
tkivisik
bcd3a58d46 A+C: add author, rename contributor to a real name
Renamed from github user to use my real name in CONTRIBUTORS, added my name
to AUTHORS.

Change-Id: I671638f1525d44bcc2b0a08d0dcff6adb1717510
GitHub-Last-Rev: b989e185de
GitHub-Pull-Request: golang/go#29823
Reviewed-on: https://go-review.googlesource.com/c/158540
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-18 20:46:19 +00:00
Raul Silvera
dc889025c7 runtime: sample large heap allocations correctly
Remove an unnecessary check on the heap sampling code that forced sampling
of all heap allocations larger than the sampling rate. This need to follow
a poisson process so that they can be correctly unsampled. Maintain a check
for MemProfileRate==1 to provide a mechanism for full sampling, as
documented in https://golang.org/pkg/runtime/#pkg-variables.

Additional testing for this change is on cl/129117.

Fixes #26618

Change-Id: I7802bde2afc655cf42cffac34af9bafeb3361957
GitHub-Last-Rev: 471f747af8
GitHub-Pull-Request: golang/go#29791
Reviewed-on: https://go-review.googlesource.com/c/158337
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2019-01-18 15:29:32 +00:00
Ian Lance Taylor
c077c74312 cmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH
Fixes #29263

Change-Id: I06ba135dc491fd01fc06ccaad4ef98103d4b86c4
Reviewed-on: https://go-review.googlesource.com/c/154460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-01-18 03:50:05 +00:00
Ian Lance Taylor
dd1889cb22 cmd/cgo: don't replace newlines with semicolons in expressions
Fixes #29781

Change-Id: Id032d07a54b8c24f0c6d3f6e512932f76920ee04
Reviewed-on: https://go-review.googlesource.com/c/158457
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-18 03:25:40 +00:00
Brad Fitzpatrick
246e6ceb3b net/http: clarify Transport connection reuse docs a bit
Updates #26095 (or fixes it)

Change-Id: I92488dabe823b82e1ba534648fe6d63d25d0ae9f
Reviewed-on: https://go-review.googlesource.com/c/158417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-18 02:38:08 +00:00
Robert Griesemer
33caf3be83 math/big: document that Rat.SetString accepts _decimal_ float representations
Updates #29799.

Change-Id: I267c2c3ba3964e96903954affc248d0c52c4916c
Reviewed-on: https://go-review.googlesource.com/c/158397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-17 23:04:06 +00:00
Michael Anthony Knyszek
6e9f664b9a runtime: don't coalesce scavenged spans with unscavenged spans
As a result of changes earlier in Go 1.12, the scavenger became much
more aggressive. In particular, when scavenged and unscavenged spans
coalesced, they would always become scavenged. This resulted in most
spans becoming scavenged over time. While this is good for keeping the
RSS of the program low, it also causes many more undue page faults and
many more calls to madvise.

For most applications, the impact of this was negligible. But for
applications that repeatedly grow and shrink the heap by large amounts,
the overhead can be significant. The overhead was especially obvious on
older versions of Linux where MADV_FREE isn't available and
MADV_DONTNEED must be used.

This change makes it so that scavenged spans will never coalesce with
unscavenged spans. This  results in fewer page faults overall. Aside
from this, the expected impact of this change is more heap growths on
average, as span allocations will be less likely to be fulfilled. To
mitigate this slightly, this change also coalesces spans eagerly after
scavenging, to at least ensure that all scavenged spans and all
unscavenged spans are coalesced with each other.

Also, this change adds additional logic in the case where two adjacent
spans cannot coalesce. In this case, on platforms where the physical
page size is larger than the runtime's page size, we realign the
boundary between the two adjacent spans to a physical page boundary. The
advantage of this approach is that "unscavengable" spans, that is, spans
which cannot be scavenged because they don't cover at least a single
physical page are grown to a size where they have a higher likelihood of
being discovered by the runtime's scavenging mechanisms when they border
a scavenged span. This helps prevent the runtime from accruing pockets
of "unscavengable" memory in between scavenged spans, preventing them
from coalescing.

We specifically choose to apply this logic to all spans because it
simplifies the code, even though it isn't strictly necessary. The
expectation is that this change will result in a slight loss in
performance on platforms where the physical page size is larger than the
runtime page size.

Update #14045.

Change-Id: I64fd43eac1d6de6f51d7a2ecb72670f10bb12589
Reviewed-on: https://go-review.googlesource.com/c/158078
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2019-01-17 17:07:23 +00:00
Michael Anthony Knyszek
2f99e889f0 runtime: de-duplicate coalescing code
Currently the code surrounding coalescing is duplicated between merging
with the span before the span considered for coalescing and merging with
the span after. This change factors out the shared portions of these
codepaths into a local closure which acts as a helper.

Change-Id: I7919fbed3f9a833eafb324a21a4beaa81f2eaa91
Reviewed-on: https://go-review.googlesource.com/c/158077
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2019-01-17 17:05:37 +00:00
Michael Anthony Knyszek
79ac638e41 runtime: refactor coalescing into its own method
The coalescing process is complex and in a follow-up change we'll need
to do it in more than one place, so this change factors out the
coalescing code in freeSpanLocked into a method on mheap.

Change-Id: Ia266b6cb1157c1b8d3d8a4287b42fbcc032bbf3a
Reviewed-on: https://go-review.googlesource.com/c/157838
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2019-01-17 16:59:49 +00:00
Austin Clements
e2ff73286f doc/go1.12: link to ABIInternal design document
The ABI changes should be completely transparent to Go code, but could
cause linking issues in certain situations involving assembly code
reaching across package boundaries. If users encounter linking
problems, point them to the "Compatibility" section of the ABI design
document, which gives some guidance.

Change-Id: I4156d164562e2ec0de7ae8f9a3631a32ec45b317
Reviewed-on: https://go-review.googlesource.com/c/158237
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-17 14:58:31 +00:00
Ian Lance Taylor
006a5e7d00 testing: report the failing test in a late log panic
Updates #29388

Change-Id: Icb0e6048d05fde7a5486b923ff62147edb5c8dac
Reviewed-on: https://go-review.googlesource.com/c/157617
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2019-01-17 01:28:22 +00:00
Clément Chigot
0456036e28 net: increase TestNotTemporaryRead server sleep
On aix/ppc64, if the server closes before the client calls Accept,
this test will fail.

Increasing the time before the server closes should resolve this
timeout.

Updates #29685

Change-Id: Iebb849d694fc9c37cf216ce1f0b8741249b98016
Reviewed-on: https://go-review.googlesource.com/c/158038
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-16 15:16:12 +00:00
Baokun Lee
34817dd365 cmd/go/internal/clean: fix clean -testcache does not clean test cache
Truncate changes the size of the file. It does not change the I/O offset.

Fixes #29757

Change-Id: I1aa9223a86d6a8ce3c0efc3ac1d7d7647b77f589
Reviewed-on: https://go-review.googlesource.com/c/158117
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-01-16 14:03:10 +00:00
GuilhermeCaruso
5fae09b738 encoding/json: add comment for mashalererror struct
Change-Id: Iaabbfe5a4c1bbedd19d4087f1b79e5a38bdd3878
GitHub-Last-Rev: 55c91fc190
GitHub-Pull-Request: golang/go#29752
Reviewed-on: https://go-review.googlesource.com/c/157958
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-15 23:30:58 +00:00
Daniel Martí
55715c1738 cmd/go: fix wording issue in comment
golang.org/cl/157097 modified this comment, but left a trailing comma.
While at it, make the sentence a bit clearer.

Change-Id: I376dda4fd18ddbcae4485dd660a79b9f66ad6da4
Reviewed-on: https://go-review.googlesource.com/c/158037
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-15 19:37:52 +00:00
Ian Lance Taylor
76e8ca447c cmd/cgo: don't replace newlines with semicolons in composite literals
Fixes #29748

Change-Id: I2b19165bdb3c99df5b79574390b5d5f6d40462dc
Reviewed-on: https://go-review.googlesource.com/c/157961
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-15 18:14:54 +00:00
Viacheslav Poturaev
3e9c3cfd1e cmd/go: remove init() to fix precedence issue when setting debug mod info
Fixes #29628

Change-Id: I95dabed797ef7a1a770b6f4219840f653306af7e
GitHub-Last-Rev: 9275dd8f1c
GitHub-Pull-Request: golang/go#29630
Reviewed-on: https://go-review.googlesource.com/c/157097
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2019-01-15 17:43:53 +00:00
Alex Brainman
d82c9a167d path/filepath: skip part of TestNTNamespaceSymlink
Recent CL 156398 extended TestNTNamespaceSymlink. But new code
fails, if user running the test does not have sufficient privilege
to create file symlink. Skip part of TestNTNamespaceSymlink, if
user cannot create symlink.

Fixes #29745

Change-Id: Ie4176429ba9dd98553ce9e91fd19851cc7353f42
Reviewed-on: https://go-review.googlesource.com/c/157917
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-01-15 10:23:31 +00:00
Keith Randall
462e90259a runtime: keep FuncForPC from crashing for PCs between functions
Reuse the strict mechanism from FileLine for FuncForPC, so we don't
crash when asking the pcln table about bad pcs.

Fixes #29735

Change-Id: Iaffb32498b8586ecf4eae03823e8aecef841aa68
Reviewed-on: https://go-review.googlesource.com/c/157799
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-14 23:37:39 +00:00
Dmitri Shuralyov
e1d20ce25a misc/sortac: delete sortac command
The sortac command is no longer needed as of CL 157238, and
can be deleted. Its functionality has been directly integrated
into the new x/build/cmd/updatecontrib command. A previous version
of updatecontrib was the only user of sortac.

Updates #12042

Change-Id: If7442ebee11d05d095ff875a37eed3973c0fd9ca
Reviewed-on: https://go-review.googlesource.com/c/157257
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-14 22:45:00 +00:00
Keith Randall
7502ed3b90 cmd/compile: when merging instructions, prefer line number of faulting insn
Normally this happens when combining a sign extension and a load.  We
want the resulting combo-instruction to get the line number of the
load, not the line number of the sign extension.

For each rule, compute where we should get its line number by finding
a value on the match side that can fault.  Use that line number for
all the new values created on the right-hand side.

Fixes #27201

Change-Id: I19b3c6f468fff1a3c0bfbce2d6581828557064a3
Reviewed-on: https://go-review.googlesource.com/c/156937
Reviewed-by: David Chase <drchase@google.com>
2019-01-14 22:41:33 +00:00
Daniel Theophanes
70931c087b database/sql: fix logic for pulling a Conn from DB
The logic for pulling a database connection from the DB pool should
proceed as follows: attempt to pull either a cached connection or
new connection N times in a loop. If each connection results
in a bad connection, then create a new connection (no cache).

Previously pulling a Conn from the pool, the last step also
looked at the cache, rather then always creating a new connection.

Fixes #29684

Change-Id: I8f436fd9b96eb35502a620ebe8da4ab89fb06a2e
Reviewed-on: https://go-review.googlesource.com/c/157637
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-14 19:44:57 +00:00
David du Colombier
4e8aaf6b22 net: skip TestLookupGmailTXT on Plan 9
CL 157638 updated TestLookupGmailTXT. However, this
test is failing on Plan 9, because the DNS resolver
(ndb/dns) only returns a single TXT record.

Updates #29722.

Change-Id: I01cd94e6167902361c3f5d615868f6f763a31fb1
Reviewed-on: https://go-review.googlesource.com/c/157737
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-14 07:58:44 +00:00
Ian Lance Taylor
7cbfa55b5d net: pass if at least one matching entry in TestLookupGmailTXT
Fixes #29698

Change-Id: I0531c0a274b120af8871aa2f5975744ff6c912a3
Reviewed-on: https://go-review.googlesource.com/c/157638
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-12 00:27:48 +00:00
Sebastiaan van Stijn
a2bb68de4d cmd/go: remove note about GOCACHE=off in docs
This patch removes mention of GOCACHE=off from the help/docs.
It is no longer supported in Go 1.12, per the release notes.

Fixes #29680

Change-Id: I53ab15a62743f2e55ae1d8aa50629b1bf1ae32ad
GitHub-Last-Rev: 31e904f51d
GitHub-Pull-Request: golang/go#29681
Reviewed-on: https://go-review.googlesource.com/c/157517
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-01-11 16:08:59 +00:00
Austin Clements
a2e79571a9 cmd/compile: separate data and function LSyms
Currently, obj.Ctxt's symbol table does not distinguish between ABI0
and ABIInternal symbols. This is *almost* okay, since a given symbol
name in the final object file is only going to belong to one ABI or
the other, but it requires that the compiler mark a Sym as being a
function symbol before it retrieves its LSym. If it retrieves the LSym
first, that LSym will be created as ABI0, and later marking the Sym as
a function symbol won't change the LSym's ABI.

Marking a Sym as a function symbol before looking up its LSym sounds
easy, except Syms have a dual purpose: they are used just as interned
strings (every function, variable, parameter, etc with the same
textual name shares a Sym), and *also* to store state for whatever
package global has that name. As a result, it's easy to slip up and
look up an LSym when a Sym is serving as the name of a local variable,
and then later mark it as a function when it's serving as the global
with the name.

In general, we were careful to avoid this, but #29610 demonstrates one
case where we messed up. Because of on-demand importing from indexed
export data, it's possible to compile a method wrapper for a type
imported from another package before importing an init function from
that package. If the argument of the method is named "init", the
"init" LSym will be created as a data symbol when compiling the
wrapper, before it gets marked as a function symbol.

To fix this, we separate obj.Ctxt's symbol tables for ABI0 and
ABIInternal symbols. This way, the compiler will simply get a
different LSym once the Sym takes on its package-global meaning as a
function.

This fixes the above ordering issue, and means we no longer need to go
out of our way to create the "init" function early and mark it as a
function symbol.

Fixes #29610.
Updates #27539.

Change-Id: Id9458b40017893d46ef9e4a3f9b47fc49e1ce8df
Reviewed-on: https://go-review.googlesource.com/c/157017
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-01-11 00:45:49 +00:00
Ian Lance Taylor
5f699e400a doc: add Go 1.12 release note for trigonometric reductions in math
Worth mentioning because the results are not bit-for-bit identical.
This causes a test failure in github.com/fogleman/gg.

Updates #6794

Change-Id: I701f34927731fb5c658a1be271c04388e5e7e3f7
Reviewed-on: https://go-review.googlesource.com/c/157417
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-10 21:21:34 +00:00
Michael Anthony Knyszek
4b3f04c63b runtime: make mTreap iterator bidirectional
This change makes mTreap's iterator type, treapIter, bidirectional
instead of unidirectional. This change helps support moving the find
operation on a treap to return an iterator instead of a treapNode, in
order to hide the details of the treap when accessing elements.

For #28479.

Change-Id: I5dbea4fd4fb9bede6e81bfd089f2368886f98943
Reviewed-on: https://go-review.googlesource.com/c/156918
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-10 18:15:48 +00:00
Alex Brainman
44cf595a7e path/filepath: return special error from EvalSymlinks
CL 155597 attempted to fix #29372. But it failed to make all new
test cases pass. Also CL 155597 broke some existing code
(see #29449 for details).

Make small adjustment to CL 155597 that fixes both #29372 and #29449.

Suggested by Ian.

Updates #29372
Fixes #29449

Change-Id: I9777a615514d3f152af5acb65fb1239e696607b6
Reviewed-on: https://go-review.googlesource.com/c/156398
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-10 08:35:34 +00:00
Mikio Hara
94d9a20453 net: drop confusing comment
On AIX, we don't need to be aware of any change on the protocol stack of
Linux kernel.

Change-Id: Ib8b14fa930acddb3bc720d401271e8daf567b784
Reviewed-on: https://go-review.googlesource.com/c/157298
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-10 04:47:18 +00:00
Mikio Hara
9aa2c06cb5 net: update BUG sections for go1.12
To confirm this change with the go commaned, please run 'go doc net'
instead of 'go doc -all net'; the -all option surpresses BUG sections.

Change-Id: Iac7bc85fbef48e91d5ede16da0ce4a7ab8cae539
Reviewed-on: https://go-review.googlesource.com/c/157297
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-10 04:47:00 +00:00
Clément Chigot
20ac64a2dd cmd/dist, cmd/link, runtime: fix stack size when cross-compiling aix/ppc64
This commit allows to cross-compiling aix/ppc64. The nosplit limit must
twice as large as on others platforms because of AIX syscalls.
The stack limit, especially stackGuardMultiplier, was set by cmd/dist
during the bootstrap and doesn't depend on GOOS/GOARCH target.

Fixes #29572

Change-Id: Id51e38885e1978d981aa9e14972eaec17294322e
Reviewed-on: https://go-review.googlesource.com/c/157117
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-09 22:06:51 +00:00