Commit graph

39107 commits

Author SHA1 Message Date
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
Ian Lance Taylor a5318bf5d6 os: always treat files as unpollable on FreeBSD
Fixes #29633
Updates #27619

Change-Id: I1e38569ea2a02423b028331f2ed987d3ae47fd2e
Reviewed-on: https://go-review.googlesource.com/c/157099
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-09 21:50:11 +00:00
David du Colombier 9a5a5043e1 cmd/go: skip tests using Git on Plan 9
TestScript/get_unicode, TestScript/get_dotfiles and
TestScript/get_brace are failing on Plan 9 since they
expect a full-featured git command, while the git tool
has been emulated as a simple rc script on Plan 9.

This change skips tests using Git on Plan 9.

Fixes #29640.

Change-Id: Id7f6fdca552167f4631fe401f63167e5653daafa
Reviewed-on: https://go-review.googlesource.com/c/157119
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-09 21:45:00 +00:00
Cherry Zhang 52cae2763e cmd/internal/obj/wasm: increment PC by 2 at sigpanic
On Wasm, PC is not the instruction counter but the block ID. We
advance the PC only when necessary. In the case of sigpanic (used
in nil check), the panic stack trace expects the PC at the call
of sigpanic, not the next one. However, runtime.Caller subtracts
1 from the PC. To make both PC and PC-1 work (have the same line
number), we advance the PC by 2 at sigpanic.

Fixes #29632.

Change-Id: Ieb4d0bb9dc6a8103855a194e3d289f1db4bfb1e5
Reviewed-on: https://go-review.googlesource.com/c/157157
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Richard Musiol <neelance@gmail.com>
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-09 18:38:22 +00:00
Robert Griesemer 8765a786b6 go/types: don't create new context string for each argument of each call
The argument context string is only used in error messages. Don't format
the function AST into a string for every single argument of every single
call that is type-checked. Instead do it once per call (still not great,
but much much better).

Performance optimization.

Change-Id: Iec87f9ad34128d7b3eee58577ad37dbaa8e6db44
Reviewed-on: https://go-review.googlesource.com/c/157037
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-09 16:10:07 +00:00
Brad Fitzpatrick a14ed2a82a net/http/httputil: run the ReverseProxy.ModifyResponse hook for upgrades
Fixes #29627

Change-Id: I08a5b45151a11b5a4f3b5a2d984c0322cf904697
Reviewed-on: https://go-review.googlesource.com/c/157098
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-09 15:51:59 +00:00
Tobias Klauser 99ea99ec4c net/http/httputil: fix typo in ReverseProxy godoc
Change-Id: Iea33fe64403ca2e6f87a4e070af5e97d96506e41
Reviewed-on: https://go-review.googlesource.com/c/157118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-09 14:49:46 +00:00
LE Manh Cuong dd7d6c261f debug/gosym: remove outdated comment
Change-Id: I2bba13064c8d21ded41499c6ec225ef83d1a533e
Reviewed-on: https://go-review.googlesource.com/c/156997
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-09 14:44:28 +00:00
Tobias Klauser 5efe9a8f11 runtime: follow convention for generated code comment in fastlog2table
Follow the convertion (https://golang.org/s/generatedcode) for generated
code in fastlog2table.go

Change-Id: Ib40ae2848924d98afaf8d4fcaf180a4583edc3fe
Reviewed-on: https://go-review.googlesource.com/c/156817
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-09 07:21:16 +00:00
Yuval Pavel Zholkover 79c50c4d57 os: disable the use of netpoll on regular files on *BSDs.
The kqueue based netpoller always registers file descriptors with EVFILT_READ and EVFILT_WRITE.
However only EVFILT_READ notification is supported for regular files.
On FreeBSD a regular file is always reported as ready for writing, resulting in a busy wait.
On Darwin, Dragonfly, NetBSD and OpenBSD, a regular file is reported as ready for both reading and writing only once.

Updates #19093

Change-Id: If284341f60c6c2332fb5499637d4cfa7a4e26b7b
Reviewed-on: https://go-review.googlesource.com/c/156379
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-09 05:04:26 +00:00
Brad Fitzpatrick 9473c044f1 bufio: document relationship between UnreadByte/UnreadRune and Peek
Fixes #29387

Change-Id: I2d9981f63ac16630ed39d6da6692c81396f4e9ea
Reviewed-on: https://go-review.googlesource.com/c/155930
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-08 23:47:27 +00:00
Ian Lance Taylor 1d2e548b42 doc: go1.12: mention os.File.SyscallConn
Updates #24331

Change-Id: I2d7c996bbe29d5b3922588e199a106eb722c02e6
Reviewed-on: https://go-review.googlesource.com/c/156839
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-08 23:33:01 +00:00
Keith Randall 956879dd0b runtime: make FuncForPC return the innermost inlined frame
Returning the innermost frame instead of the outermost
makes code that walks the results of runtime.Caller{,s}
still work correctly in the presence of mid-stack inlining.

Fixes #29582

Change-Id: I2392e3dd5636eb8c6f58620a61cef2194fe660a7
Reviewed-on: https://go-review.googlesource.com/c/156364
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-08 21:54:04 +00:00
Alberto Donizetti 033b650181 doc: update tzdata version in 1.12 release notes
It was recently updated (again) to version 2018i. Since we're here,
wrap the paragraph at ~70 columns, like all the others.

Change-Id: I0a380385f34f1df1258a9f2af447234967422f37
Reviewed-on: https://go-review.googlesource.com/c/156857
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-08 19:21:25 +00:00
Alberto Donizetti 8712562109 doc: make link relative in 1.12 cgo release notes
Change a link in the cgo section of the 1.12 release notes from

  https://golang.org/cmd/cgo ...

to

  /cmd/cgo/ ...

to uniform it with other links on the page, and to ensure correct
target when the page is displayed on tip.golang.org.

Change-Id: I7653a6ea15ce111a60929c7ae7e9fb0dc9515502
Reviewed-on: https://go-review.googlesource.com/c/156858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-08 19:05:30 +00:00
Keith Randall 232c979309 runtime: store incremented PC in result of runtime.Callers
In 1.11 we stored "return addresses" in the result of runtime.Callers.
I changed that behavior in CL 152537 to store an address in the call
instruction itself. This CL reverts that part of 152537.

The change in 152537 was made because we now store pcs of inline marks
in the result of runtime.Callers as well. This CL will now store the
address of the inline mark + 1 in the results of runtime.Callers, so
that the subsequent -1 done in CallersFrames will pick out the correct
inline mark instruction.

This CL means that the results of runtime.Callers can be passed to
runtime.FuncForPC as they were before. There are a bunch of packages
in the wild that take the results of runtime.Callers, subtract 1, and
then call FuncForPC. This CL keeps that pattern working as it did in
1.11.

The changes to runtime/pprof in this CL are exactly a revert of the
changes to that package in 152537 (except the locForPC comment).

Update #29582

Change-Id: I04d232000fb482f0f0ff6277f8d7b9c72e97eb48
Reviewed-on: https://go-review.googlesource.com/c/156657
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-08 18:24:50 +00:00