1
0
mirror of https://github.com/golang/go synced 2024-11-08 19:06:26 -07:00
Commit Graph

39672 Commits

Author SHA1 Message Date
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
Mark Rushakoff
a1d5e8adfa cmd/go: fix typo in output of go help importpath
The output refers to 'go help modules-get' but the actual command is 'go
help module-get', singular.

Change-Id: Ie001f4181d80d3bf1995af2f257bf789dad5b33f
GitHub-Last-Rev: ce9b90e9a6
GitHub-Pull-Request: golang/go#29605
Reviewed-on: https://go-review.googlesource.com/c/156737
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2019-01-08 02:10:40 +00:00
Yuval Pavel Zholkover
e3eb2ff827 runtime: disable GDB tests on freebsd on all GOARCH values
The in-tree GDB is too old (6.1.1) on all the builders except the
FreeBSD 12.0 one, where it was removed from the base system.

Update #29508

Change-Id: Ib6091cd86440ea005f3f903549a0223a96621a6f
Reviewed-on: https://go-review.googlesource.com/c/156717
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-08 00:35:16 +00:00
Ian Lance Taylor
5a0743b020 cmd/go: improve error message for names forbidden by Windows
Fixes #29589

Change-Id: I69ad461e70b236d9729a42053e35128437449e32
Reviewed-on: https://go-review.googlesource.com/c/156658
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-07 22:08:17 +00:00
Cherry Zhang
902b1f6059 runtime/pprof: add a test for gccgo bug #29448
With gccgo, if a profiling signal arrives in certain time during
traceback, it may crash or hang. The fix is CL 156037 and
CL 156038.  This CL adds a test.

Updates #29448.

Change-Id: Idb36af176b4865b8fb31a85cad185ed4c07ade0c
Reviewed-on: https://go-review.googlesource.com/c/156018
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-07 20:36:58 +00:00
Ian Lance Taylor
af3c480967 lib/time: update tzdata to 2018i
Updates #22487

Change-Id: Iab4874ddef8e47eb99cd03e1c40af8372cce65c6
Reviewed-on: https://go-review.googlesource.com/c/156637
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-07 20:14:03 +00:00
Brian Kessler
649294d0a5 math: fix ternary correction statement in Log1p
The original port of Log1p incorrectly translated a ternary statement
so that a correction was only applied to one of the branches.

Fixes #29488

Change-Id: I035b2fc741f76fe7c0154c63da6e298b575e08a4
Reviewed-on: https://go-review.googlesource.com/c/156120
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-01-07 18:57:45 +00:00
Jason LeBrun
55dec44010 crypto/md5: fix casting of d.nx in UnmarshalBinary
Fixes #29545

Change-Id: Ida98c23b8fc5c676d8bf0b3daad8320e495ebf64
GitHub-Last-Rev: d38e8a90c7
GitHub-Pull-Request: golang/go#29546
Reviewed-on: https://go-review.googlesource.com/c/156297
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-07 18:51:15 +00:00
Jason LeBrun
857b339993 crypto/sha1: fix casting of d.nx in UnmarshalBinary
Fixes #29543

Change-Id: Ib7f3c32cc1e57c583ee52c486673a5b9568c2df8
GitHub-Last-Rev: 0cb3dc5362
GitHub-Pull-Request: golang/go#29544
Reviewed-on: https://go-review.googlesource.com/c/156279
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-07 18:50:57 +00:00
Jay Conrod
e1b903788a cmd/go: deflake TestScript/gcflags_patterns
The check below can fail incorrectly if the buildid ends with '-p'.

    ! stderr 'compile.* -e .*-p [^z]'

This fix changes regular expressions to '-e.* -p' or '-N.* -p' instead
of '-e .*-p'. '-l' is no longer used because the compiler accepts
multiple flags starting with '-l' ('-e' and '-N' do not have this
problem), so there could be false matches.

Change-Id: I827c411de28624019a287f853acc9666e87cbfb9
Reviewed-on: https://go-review.googlesource.com/c/156327
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-07 17:55:24 +00:00
Gabriel Aszalos
73fb3c38a6 doc: remove incorrect space in %T and %v output examples
Change-Id: I321890237f703b945711e59c15233ccf59c4f190
Reviewed-on: https://go-review.googlesource.com/c/156477
Run-TryBot: Gabriel Aszalos <gabriel.aszalos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-07 14:13:33 +00:00
LE Manh Cuong
f7248ba753 archive/zip: fix casting overflow on 32-bit arch
Fixes #29555

Change-Id: Ia3c0dd65bcf94dea3f6e04c23c1fe5d6d0b2c1e9
Reviewed-on: https://go-review.googlesource.com/c/156399
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-07 04:23:06 +00:00
Keith Randall
11847cb8e0 cmd: vendor x/sys/unix into the stdlib
upstream git hash: 1775db3f06b568179d273425900dd09125831dd5

Update #17490

Change-Id: I95e3c57137756c5c7a9b7334075caef66f205231
Reviewed-on: https://go-review.googlesource.com/c/156365
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-07 01:29:12 +00:00
Daniel Martí
fd752d5ede cmd/vendor: update to golang.org/x/tools@3ef68632
Mainly to pull in the bug fix in the structtag pass, where filenames
could sometimes be wrong. The bug wasn't present in 1.11, so it was a
regression and needs fixing before 1.12 is out.

Fixes #29130.

Change-Id: Ie9d9bff84873f34d748ebd8f056b6bc2ac822a55
Reviewed-on: https://go-review.googlesource.com/c/156378
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2019-01-06 19:10:26 +00:00
Filippo Valsorda
35f4ec152b crypto/x509: ignore harmless edge case in TestSystemRoots
The no-cgo validation hack lets in certificates from the root store that
are not marked as roots themselves, but are signed by a root; the cgo
path correctly excludes them. When TestSystemRoots compares cgo and
no-cgo results it tries to ignore them by ignoring certificates which
pass validation, but expired certificates were failing validation.

Letting through expired certs is harmless anyway because we will refuse
to build chains to them.

Fixes #29497

Change-Id: I341e50c0f3426de2763468672f9ba1d13ad6cfba
Reviewed-on: https://go-review.googlesource.com/c/156330
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-05 00:45:14 +00:00
Filippo Valsorda
303a596d8c crypto/x509: ignore 5 phantom 1024-bit roots in TestSystemRoots
On macOS 10.11, but not 10.10 and 10.12, the C API returns 5 old root
CAs which are not in SystemRootCertificates.keychain (but seem to be in
X509Anchors and maybe SystemCACertificates.keychain, along with many
others that the C API does not return). They all are moribund 1024-bit
roots which are now gone from the Apple store.

Since we can't seem to find a way to make the no-cgo code see them,
ignore them rather than skipping the test.

Fixes #21416

Change-Id: I24ff0461f71cec953b888a60b05b99bc37dad2ed
Reviewed-on: https://go-review.googlesource.com/c/156329
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-05 00:35:02 +00:00
David Chase
28fb8c6987 cmd/compile: modify swt.go to skip repeated walks of switch
The compiler appears to contain several squirrelly corner
cases where nodes are double walked, some where new nodes
are created from walked parts.  Rather than trust that we
had searched hard enough for the last one, change
exprSwitch.walk() to return immediately if it has already
been walked.  This appears to be the only case where
double-walking a node is actually harmful.

Fixes #29562.

Change-Id: I0667e8769aba4c3236666cd836a934e256c0bfc5
Reviewed-on: https://go-review.googlesource.com/c/156317
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2019-01-04 21:51:37 +00:00
Filippo Valsorda
86e31bc5fd doc/go1.12: remove known issue note
A workaround has been submitted.

Updates #27993

Change-Id: Ife6443c32673b38000b90dd2efb2985db37ab773
Reviewed-on: https://go-review.googlesource.com/c/156318
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-04 19:08:21 +00:00
Dmitri Shuralyov
4c3b4dfd79 CONTRIBUTORS: first round of automated updates for Go 1.12
These updates have been automatically generated using a modified
version of the updateac command with the following changes:

-	code to automatically update the AUTHORS file has been removed,
	since we're not updating that file automatically after Go 1.11
	(see CL 128877)
-	CLA checking code has been removed, since it was primarily needed
	for updating the AUTHORS file
-	instead of executing the misc/sortac binary, its code was embedded
	into the updateac command itself

The modified updateac command will be added to x/build repository soon,
and the misc/sortac command can be removed afterwards.

Updates #12042

Change-Id: Ibf73068698b14b1aad4df4490747b488508ff5fd
Reviewed-on: https://go-review.googlesource.com/c/156278
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-01-04 18:17:38 +00:00
Filippo Valsorda
0dc7a1daf6 doc/go1.12: document RSA-PSS support in crypto/tls
Change-Id: I9350e5a72e3c375f6b76897708f09f1f50c7be14
Reviewed-on: https://go-review.googlesource.com/c/155482
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-04 17:47:14 +00:00
Brad Fitzpatrick
d15ffca108 doc/go1.12: mention Conn.SetDeadline improvements, GODEBUG=madvdontneed=1
Fixes #29439
Updates #28466

Change-Id: Ifa0779a089a969f99f1a47127e23565f31eec24f
Reviewed-on: https://go-review.googlesource.com/c/155929
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-01-04 16:54:09 +00:00
Jason LeBrun
23c22ca42c crypto/sha512: fix casting of d.nx in UnmarshalBinary
Fixes #29541

Change-Id: I006915b020b6e710298c32c05e3de77a7f9b54f3
GitHub-Last-Rev: c7a90a4bbe
GitHub-Pull-Request: golang/go#29542
Reviewed-on: https://go-review.googlesource.com/c/156277
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-04 05:11:30 +00:00
Ian Lance Taylor
0d6a2d5f9a runtime: skip writes to persistent memory in cgo checker
Fixes #23899
Fixes #28458

Change-Id: Ie177f2d4c399445d8d5e1a327f2419c7866cb45e
Reviewed-on: https://go-review.googlesource.com/c/155697
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2019-01-04 02:40:56 +00:00
Austin Clements
95a6f112c6 runtime: work around "P has cached GC work" failures
We still don't understand what's causing there to be remaining GC work
when we enter mark termination, but in order to move forward on this
issue, this CL implements a work-around for the problem.

If debugCachedWork is false, this CL does a second check for remaining
GC work as soon as it stops the world for mark termination. If it
finds any work, it starts the world again and re-enters concurrent
mark. This will increase STW time by a small amount proportional to
GOMAXPROCS, but fixes a serious correctness issue.

This works-around #27993.

Change-Id: Ia23b85dd6c792ee8d623428bd1a3115631e387b8
Reviewed-on: https://go-review.googlesource.com/c/156140
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
2019-01-04 01:24:58 +00:00
Jay Conrod
9a7278ae47 cmd/go: fix failure in TestScript/build_runtime_gcflags
This test case failed on the longtest builder. It relied on
runtime/internal/atomic not being compiled with the -l flag in the
cache. The test case now creates its own GOCACHE, similar to
build_cache_compile and a few others.

Also, mention the correct issue the test case verifies.

Fixes #29395

Change-Id: Id50e9dfc50db03fb11582d3dd6b69c3e1ed750eb
Reviewed-on: https://go-review.googlesource.com/c/156237
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-01-04 00:13:43 +00:00
Keith Randall
af134b17da runtime: proper panic tracebacks with mid-stack inlining
As a followon to CL 152537, modify the panic-printing traceback
to also handle mid-stack inlining correctly.

Also declare -fm functions (aka method functions) as wrappers, so that
they get elided during traceback. This fixes part 2 of #26839.

Fixes #28640
Fixes #24488
Update #26839

Change-Id: I1c535a9b87a9a1ea699621be1e6526877b696c21
Reviewed-on: https://go-review.googlesource.com/c/153477
Reviewed-by: David Chase <drchase@google.com>
2019-01-04 00:00:24 +00:00
Keith Randall
688667716e runtime: don't scan go'd function args past length of ptr bitmap
Use the length of the bitmap to decide how much to pass to the
write barrier, not the total length of the arguments.

The test needs enough arguments so that two distinct bitmaps
get interpreted as a single longer bitmap.

Update #29362

Change-Id: I78f3f7f9ec89c2ad4678f0c52d3d3def9cac8e72
Reviewed-on: https://go-review.googlesource.com/c/156123
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2019-01-03 23:37:42 +00:00
Jason LeBrun
5073bf3886 crypto/sha256: fix casting of d.nx in UnmarshalBinary
Fixes #29517

Change-Id: I7e741d82bb9f8e6ab39b6d9ab37ba6163176a097
GitHub-Last-Rev: 764d0bd957
GitHub-Pull-Request: golang/go#29519
Reviewed-on: https://go-review.googlesource.com/c/156118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-03 22:51:08 +00:00
Keith Randall
af4320350b runtime: add test for go function argument scanning
Derived	from Naoki's reproducer.

Update #29362

Change-Id: I1cbd33b38a2f74905dbc22c5ecbad4a87a24bdd1
Reviewed-on: https://go-review.googlesource.com/c/156122
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-03 20:17:01 +00:00
Inada Naoki
5372257e60 runtime: skip stack barrier copy when there are no pointers
After CL 31455, "go fun(n)" may put "n" to write barrier buffer
when there are no pointers in fun's arguments.

Fixes #29362

Change-Id: Icfa42b8759ce8ad9267dcb3859c626feb6fda381
Reviewed-on: https://go-review.googlesource.com/c/155779
Reviewed-by: Keith Randall <khr@golang.org>
2019-01-03 18:48:52 +00:00
Stepan Shabalin
30c0a0d33f runtime: remove redundant slicing
In the twoNonZero function in hash_test, the buffer is sliced as [:] three times. This change deletes them.

Change-Id: I0701d0c810b4f3e267f80133a0dcdb4ed81fe356
Reviewed-on: https://go-review.googlesource.com/c/156138
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-03 18:23:07 +00:00
Alessandro Arzilli
374546d800 cmd/go: respect gcflags, ldflags in 'go test'
Fixes bug introduced by https://golang.org/cl/129059 where
gcflags='all=...' and ldflags='all=...' would not be applied to some
packages built by 'go test'.

LoadImport used to set gcflags/ldflags for the Package objects it
created, in https://golang.org/cl/129059 this code was factored out to
setToolFlags. The codepath of `go build` was updated to call
setToolFlags appropriatley, but the codepath of `go test -c` wasn't,
resulting in gcflags/ldflags being applied inconsistently when building
tests.

This commit changes TestPackagesFor to call setToolFlags on the package
objects it creates.

Fixes #27681

Change-Id: Idcbec0c989ee96ec066207184611f08818873e8d
Reviewed-on: https://go-review.googlesource.com/c/136275
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-01-03 17:20:41 +00:00
Keith Randall
abd1dde1f7 cmd/compile: fix no-op instruction used by s390x
CL 152537 introduced a new use for ginsnop, the arch-dependent
routine that generates nops. The previous s390x nop clobbered flags.
It turns out the previous uses of this nop did not require flags
to be preserved, but the new use does.

Use a real nop: the 4-byte preferred nop.

Fixes #29453

Change-Id: I95310dfdd831932e26f5d5b6608324687f4c3162
Reviewed-on: https://go-review.googlesource.com/c/155926
Reviewed-by: Michael Munday <mike.munday@ibm.com>
2019-01-03 17:00:47 +00:00
Ian Lance Taylor
0175064e69 net: skip TestUDPZeroBytePayload on Darwin
Updates #29225

Change-Id: I4c9b7a108861ce5c9ab84f7324ced3da51e7bf2a
Reviewed-on: https://go-review.googlesource.com/c/156119
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-03 05:07:58 +00:00
Ian Lance Taylor
5de0c37ecf doc: go1.12: clarify use of MADV_FREE
Fixes #29337

Change-Id: I1d632d19058c63dac8e25d2a5ad55555c1aec9d4
Reviewed-on: https://go-review.googlesource.com/c/155438
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-03 04:13:59 +00:00
David Chase
ae68cf4c53 cmd/compile: Update ssa/debug_test reference files for delve and gdb
Recent changes to compiler backtraces perturbed the line
number assignment, some better, some worse, probably net
worse.  For purposes of passing the long tests, update the
reference files (delve's file was also stale).

TODO: Figure out a less delicate way to locate statement
boundaries for 1.13.

Fixes #29511.

Change-Id: If0e488341d848ba6012045b126c86b1250408d65
Reviewed-on: https://go-review.googlesource.com/c/156021
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-02 22:18:10 +00:00