aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-01-26[release-branch.go1.8] go1.8rc3go1.8rc3Chris Broadfoot
Change-Id: Ie306bb5355f56113356fc141f3c1a56872b39f9e Reviewed-on: https://go-review.googlesource.com/35836 Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-01-26[release-branch.go1.8] all: merge master into release-branch.go1.8Chris Broadfoot
78860b2ad2 cmd/go: don't reject ./... matching top-level file outside GOPATH 2b283cedef database/sql: fix race when canceling queries immediately 1cf08182f9 go/printer: fix format with leading comments in composite literal b531eb3062 runtime: reorder modules so main.main comes first 165cfbc409 database/sql: let tests wait for db pool to come to expected state ea73649343 doc: update gccgo docs 1db16711f5 doc: clarify what to do with Go 1.4 when installing from source 3717b429f2 doc: note that plugins are not fully baked 98842cabb6 net/http: don't send body on redirects for 301, 302, 303 when GetBody is set 314180e7f6 net/http: fix a nit aad06da2b9 cmd/link: mark DWARF function symbols as reachable be9dcfec29 doc: mention testing.MainStart signature change a96e117a58 runtime: amd64, use 4-byte ops for memmove of 4 bytes 4cce27a3fa cmd/compile: fix constant propagation through s390x MOVDNE instructions 1be957d703 misc/cgo/test: pass current environment to syscall.Exec ec654e2251 misc/cgo/test: fix test when using GCC 7 256a605faa cmd/compile: don't use nilcheck information until the next block e8d5989ed1 cmd/compile: fix compilebench -alloc ea7d9e6a52 runtime: check for nil g and m in msanread Change-Id: I61d508d4f0efe4b72e7396645c8ad6088d2bfa6e
2017-01-26cmd/go: don't reject ./... matching top-level file outside GOPATHIan Lance Taylor
This unwinds a small part of CL 31668: we now accept "./." in cleanImport. Fixes #18778. Change-Id: Ia7f1fde1cafcea3cc9e0b597a95a0e0bb410a3ed Reviewed-on: https://go-review.googlesource.com/35646 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2017-01-26database/sql: fix race when canceling queries immediatelyDaniel Theophanes
Previously the following could happen, though in practice it would be rare. Goroutine 1: (*Tx).QueryContext begins a query, passing in userContext Goroutine 2: (*Tx).awaitDone starts to wait on the context derived from the passed in context Goroutine 1: (*Tx).grabConn returns a valid (*driverConn) The (*driverConn) passes to (*DB).queryConn Goroutine 3: userContext is canceled Goroutine 2: (*Tx).awaitDone unblocks and calls (*Tx).rollback (*driverConn).finalClose obtains dc.Mutex (*driverConn).finalClose sets dc.ci = nil Goroutine 1: (*DB).queryConn obtains dc.Mutex in withLock ctxDriverPrepare accepts dc.ci which is now nil ctxCriverPrepare panics on the nil ci The fix for this is to guard the Tx methods with a RWLock holding it exclusivly when closing the Tx and holding a read lock when executing a query. Fixes #18719 Change-Id: I37aa02c37083c9793dabd28f7f934a1c5cbc05ea Reviewed-on: https://go-review.googlesource.com/35550 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-26go/printer: fix format with leading comments in composite literalRobert Griesemer
This fix is less pervasive than it seems. The only change affecting formatting is on printer.go:760. The remaining changes have no effect on formatting since the value of p.level is ignored except on this specific line. The remaining changes are: - renamed adjBlock to funcBody since that's how it is used - introduced new printer field 'level' tracking the composite literal nesting level - update/restore the composite literal nesting level as needed Fixes #18782. Change-Id: Ie833a9b5a559c4ec0f2eef2c5dc97aa263dca53a Reviewed-on: https://go-review.googlesource.com/35811 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-25runtime: reorder modules so main.main comes firstDavid Crawshaw
Modules appear in the moduledata linked list in the order they are loaded by the dynamic loader, with one exception: the firstmoduledata itself the module that contains the runtime. This is not always the first module (when using -buildmode=shared, it is typically libstd.so, the second module). The order matters for typelinksinit, so we swap the first module with whatever module contains the main function. Updates #18729 This fixes the test case extracted with -linkshared, and now go test -linkshared encoding/... passes. However the original issue about a plugin failure is not yet fixed. Change-Id: I9f399ecc3518e22e6b0a350358e90b0baa44ac96 Reviewed-on: https://go-review.googlesource.com/35644 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-01-25database/sql: let tests wait for db pool to come to expected stateDaniel Theophanes
Slower builders were failing TestQueryContext because the cancel and return to conn pool happens async. TestQueryContext already uses a wait method for this reason. Use the same method for other context tests. Fixes #18759 Change-Id: I84cce697392b867e4ebdfadd38027a06ca14655f Reviewed-on: https://go-review.googlesource.com/35750 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-24doc: update gccgo docsIan Lance Taylor
Update docs on correspondence between Go releases and GCC releases. Update C type that corresponds to Go type `int`. Drop out of date comments about Ubuntu and RTEMS. Change-Id: Ic1b5ce9f242789af23ec3b7e7a64c9d257d6913e Reviewed-on: https://go-review.googlesource.com/35631 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-24doc: clarify what to do with Go 1.4 when installing from sourceIan Lance Taylor
You have to actually run make.bash (or make.bat). Update #18771. Change-Id: Ie6672a4e4abde0150c1ae57cabb1222de2c78716 Reviewed-on: https://go-review.googlesource.com/35632 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-24doc: note that plugins are not fully bakedBrad Fitzpatrick
Change-Id: I6341b8cce0b4a9922928f73f8b459cbb9ec25e79 Reviewed-on: https://go-review.googlesource.com/35571 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2017-01-24net/http: don't send body on redirects for 301, 302, 303 when GetBody is setBrad Fitzpatrick
The presence of Request.GetBody being set on a request was causing all redirected requests to have a body, even if the redirect status didn't warrant one. This bug came from 307/308 support (https://golang.org/cl/29852) which removed the line that set req.Body to nil after POST/PUT redirects. Change-Id: I2a4dd5320f810ae25cfd8ea8ca7c9700e5dbd369 Reviewed-on: https://go-review.googlesource.com/35633 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2017-01-24net/http: fix a nitMikio Hara
Change-Id: I31fa5f906ad2e8dc475dbbeb91f568f91e16861b Reviewed-on: https://go-review.googlesource.com/35514 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-24cmd/link: mark DWARF function symbols as reachableIan Lance Taylor
Otherwise we don't emit any required ELF relocations when doing an external link, because elfrelocsect skips unreachable symbols. Fixes #18745. Change-Id: Ia3583c41bb6c5ebb7579abd26ed8689370311cd6 Reviewed-on: https://go-review.googlesource.com/35590 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-01-24doc: mention testing.MainStart signature changeBrad Fitzpatrick
Fixes #18766 Change-Id: Ic0f72f3b7bbccd0546692993c4ed414f8c88c1c6 Reviewed-on: https://go-review.googlesource.com/35573 Reviewed-by: Russ Cox <rsc@golang.org>
2017-01-23runtime: amd64, use 4-byte ops for memmove of 4 bytesKeith Randall
memmove used to use 2 2-byte load/store pairs to move 4 bytes. When the result is loaded with a single 4-byte load, it caused a store to load fowarding stall. To avoid the stall, special case memmove to use 4 byte ops for the 4 byte copy case. We already have a special case for 8-byte copies. 386 already specializes 4-byte copies. I'll do 2-byte copies also, but not for 1.8. benchmark old ns/op new ns/op delta BenchmarkIssue18740-8 7567 4799 -36.58% 3-byte copies get a bit slower. Other copies are unchanged. name old time/op new time/op delta Memmove/3-8 4.76ns ± 5% 5.26ns ± 3% +10.50% (p=0.000 n=10+10) Fixes #18740 Change-Id: Iec82cbac0ecfee80fa3c8fc83828f9a1819c3c74 Reviewed-on: https://go-review.googlesource.com/35567 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2017-01-21cmd/compile: fix constant propagation through s390x MOVDNE instructionsMichael Munday
The constant propagation rules selected the wrong operand to propagate. So MOVDNE (move if not equal) propagated operands as if it were a MOVDEQ (move if equal). Fixes #18735. Change-Id: I87ac469172f9df7d5aabaf7106e2936ce54ae202 Reviewed-on: https://go-review.googlesource.com/35498 Run-TryBot: Michael Munday <munday@ca.ibm.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-20misc/cgo/test: pass current environment to syscall.ExecIan Lance Taylor
This is needed for typical tests with gccgo, as it passes the LD_LIBRARY_PATH environment variable to the new program. Change-Id: I9bf4b0dbdff63f5449c7fcb8124eaeab10ed7f34 Reviewed-on: https://go-review.googlesource.com/35481 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-20misc/cgo/test: fix test when using GCC 7Ian Lance Taylor
With GCC 7 (not yet released), cgo fails with errors like ./sigaltstack.go:65:8: call of non-function C.restoreSignalStack I do not know precisely why. Explicitly declaring that there are no arguments to the static function is a simple fix for the debug info. Change-Id: Id96e1cb1e55ee37a9f1f5ad243d7ee33e71584ac Reviewed-on: https://go-review.googlesource.com/35480 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-20cmd/compile: don't use nilcheck information until the next blockKeith Randall
When nilcheck runs, the values in a block are not in any particular order. So any facts derived from examining the blocks shouldn't be used until we reach the next block. This is suboptimal as it won't eliminate nil checks within a block. But it's probably a better fix for now as it is a much smaller change than other strategies for fixing this bug. nilptr3.go changes are mostly because for this pattern: _ = *p _ = *p either nil check is fine to keep, and this CL changes which one the compiler tends to keep. There are a few regressions from code like this: _ = *p f() _ = *p For this pattern, after this CL we issue 2 nil checks instead of one. (For the curious, this happens because intra-block nil check elimination now falls to CSE, not nilcheck proper. The former pattern has two nil checks with the same store argument. The latter pattern has two nil checks with different store arguments.) Fixes #18725 Change-Id: I3721b494c8bc9ba1142dc5c4361ea55c66920ac8 Reviewed-on: https://go-review.googlesource.com/35485 Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-01-20cmd/compile: fix compilebench -allocJosh Bleecher Snyder
pprof.WriteHeapProfile is shorthand for pprof.Lookup("heap").WriteTo(f, 0). The second parameter is debug. If it is non-zero, pprof writes legacy-format pprof output, which compilebench can parse. Fixes #18641 Change-Id: Ica69adeb9809e9b5933aed943dcf4a07910e43fc Reviewed-on: https://go-review.googlesource.com/35484 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-01-19runtime: check for nil g and m in msanreadBryan C. Mills
fixes #18707. Change-Id: Ibc4efef01197799f66d10bfead22faf8ac00473c Reviewed-on: https://go-review.googlesource.com/35452 Run-TryBot: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-01-19[release-branch.go1.8] go1.8rc2go1.8rc2Chris Broadfoot
Change-Id: Ifcf2e13b962aa10280df8ca76cb21b37e3533f8f Reviewed-on: https://go-review.googlesource.com/35475 Run-TryBot: Chris Broadfoot <cbro@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-19[release-branch.go1.8] all: merge master into release-branch.go1.8Chris Broadfoot
6593d8650d go/ast: fix Object's doc comment about Data c1730ae424 runtime: force workers out before checking mark roots d10eddcba3 testing: make parallel t.Run safe again 2c8b70eacf crypto/x509: revert SystemCertPool implementation for Windows fcfd91858b doc/go1.8: document Plan 9 requirements 81a61a96c9 runtime: for plugins, don't add duplicate itabs f674537cc9 README.md: update and simplify d8711919db cmd/go: fix bug help message 48d8edb5b2 crypto/tls: disable CBC cipher suites with SHA-256 by default 92ecd78933 cmd/compile: add ZeroWB case in writebarrier 787125abab doc: 2017 is the Year of the Gopher 5b708a6b6a cmd/compile: lvalues are only required for == when calling runtime fns e83d506714 vendor/golang_org/x/crypto/poly1305: revendor to pick up fix for #18673 76f981c8d8 net/http: skip TestServerHijackGetsBackgroundByte on Plan 9 e395e3246a net/http: skip TestServerHijackGetsBackgroundByte_big on Plan 9 6a3c6c0de8 net/http: add another hijack-after-background-read test 467109bf56 all: test adjustments for the iOS builder b2a3b54b95 net/http: make sure Hijack's bufio.Reader includes pre-read background byte 593ea3b360 cmd/go, misc: rework cwd handling for iOS tests 0642b8a2f1 syscall: export Fsid.X__val on s390x 4601eae6ba doc/gdb: mention GOTRACEBACK=crash 4c4c5fc7a3 misc/cgo/testplugin: test that types and itabs are unique 22689c4450 reflect: keep makeFuncImpl live across makeFuncStub 9cf06ed6cd cmd/link: only exclude C-only symbols on darwin 9c3630f578 compress/flate: avoid large stack growth in fillDeflate 4f0aac52d9 cmd/go: add comment about SIGUSR2 on iOS 333f764df3 cmd/go, misc: switch from breakpoint to SIGUSR2 39e31d5ec0 doc/go1.8: update timezone database version 08da8201ca misc/cgo/testshared: test that types and itabs are unique fdde7ba2a2 runtime: avoid clobbering C callee-save register in cgoSigtramp f65abf6ddc cmd/compile: hide testdclstack behind debug flag 641ef2a733 compress/gzip: skip TestGZIPFilesHaveZeroMTimes on non-builders 0724aa813f crypto/dsa: gofmt ac05542985 net/http: deflake TestRetryIdempotentRequestsOnError b842c9aac7 doc: remove inline styles Change-Id: I642c056732fe1e8081e9d73e086e38ea0b2568cc
2017-01-19go/ast: fix Object's doc comment about DataHironao OTSUBO
The doc comment about the Data field of go/ast.Object reflects its old behavior, from when the go/types typechecker depended on ast.Objects. Since when the doc was written, the behavior has changed in https://golang.org/cl/7058060 and https://golang.org/cl/7096048 . Fixes #18631 Change-Id: I10fc3e31cfbf7b303eec44150df917f6eb285f90 Reviewed-on: https://go-review.googlesource.com/35075 Reviewed-by: Robert Griesemer <gri@golang.org>
2017-01-18runtime: force workers out before checking mark rootsAustin Clements
Currently we check that all roots are marked as soon as gcMarkDone decides to transition from mark 1 to mark 2. However, issue #16083 indicates that there may be a race where we try to complete mark 1 while a worker is still scanning a stack, causing the root mark check to fail. We don't yet understand this race, but as a simple mitigation, move the root check to after gcMarkDone performs a ragged barrier, which will force any remaining workers to finish their current job. Updates #16083. This may "fix" it, but it would be better to understand and fix the underlying race. Change-Id: I1af9ce67bd87ade7bc2a067295d79c28cd11abd2 Reviewed-on: https://go-review.googlesource.com/35353 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
2017-01-18testing: make parallel t.Run safe againRuss Cox
Fixes #18603. Change-Id: I5760c0a9f862200b7e943058a672eb559ac1b9d9 Reviewed-on: https://go-review.googlesource.com/35354 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-18crypto/x509: revert SystemCertPool implementation for WindowsBrad Fitzpatrick
Updates #18609 Change-Id: I8306135660f52cf625bed4c7f53f632e527617de Reviewed-on: https://go-review.googlesource.com/35265 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Quentin Smith <quentin@golang.org>
2017-01-18doc/go1.8: document Plan 9 requirementsDavid du Colombier
Fixes #18610. Change-Id: I19da4d59a1b6293c9a4722aa696e2cb58d982a15 Reviewed-on: https://go-review.googlesource.com/35333 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-17runtime: for plugins, don't add duplicate itabsKeith Randall
We already do this for shared libraries. Do it for plugins also. Suggestions on how to test this would be welcome. I'd like to get this in for 1.8. It could lead to mysterious hangs when using plugins. Fixes #18676 Change-Id: I03209b096149090b9ba171c834c5e59087ed0f92 Reviewed-on: https://go-review.googlesource.com/35117 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
2017-01-17README.md: update and simplifyAlberto Donizetti
Fixes #18675 Change-Id: I82e63e8ee3fe4a998b01d9397c3045912588e2f5 Reviewed-on: https://go-review.googlesource.com/35183 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-17cmd/go: fix bug help messagegulyasm
The bug subcommand opens up the browser instead of printing information. Fixes help message to reflect that. Fixes #18630. Change-Id: I660c94bc65ef1994292cfd72d08a544699545701 Reviewed-on: https://go-review.googlesource.com/35150 Reviewed-by: Russ Cox <rsc@golang.org>
2017-01-17crypto/tls: disable CBC cipher suites with SHA-256 by defaultFilippo Valsorda
As is, they were fully vulnerable to the Lucky13 attack. The SHA1 variants implement limited countermeasures (see f28cf8346c4) but the SHA256 ones are apparently used rarely enough (see 8741504888b) that it's not worth the extra code. Instead, disable them by default and update the warning. Updates #13385 Updates #15487 Change-Id: I45b8b716001e2fa0811b17e25be76e2512e5abb2 Reviewed-on: https://go-review.googlesource.com/35290 Reviewed-by: Adam Langley <alangley@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matt Layher <mdlayher@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-16cmd/compile: add ZeroWB case in writebarrierCherry Zhang
It looks like it should be there, although I couldn't find a test case that fails without it. ZeroWB is probably never generated now: zeroing an initialized heap object is done by making an autotmp on stack, zeroing it, and copying (typedmemmove) to heap. Passes "toolstash -cmp" on std. Change-Id: I702a59759e33fb8cc2a34a3b3029e7540aca080a Reviewed-on: https://go-review.googlesource.com/35250 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-16doc: 2017 is the Year of the GopherBrad Fitzpatrick
Change-Id: Iac713ae1f322f893c92b3fc47fe9b5719052f9eb Reviewed-on: https://go-review.googlesource.com/35240 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: David Symonds <dsymonds@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
2017-01-16cmd/compile: lvalues are only required for == when calling runtime fnsJosh Bleecher Snyder
Fixes #18661. Change-Id: I865802a9b88ab22560c9914a70901d1924242bdc Reviewed-on: https://go-review.googlesource.com/35236 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-01-16vendor/golang_org/x/crypto/poly1305: revendor to pick up fix for #18673Shenghou Ma
Fixes #18673. Change-Id: Ic827c16ad414733392c348da1c9ed9b308879fef Reviewed-on: https://go-review.googlesource.com/35260 Run-TryBot: Minux Ma <minux@golang.org> Reviewed-by: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-14net/http: skip TestServerHijackGetsBackgroundByte on Plan 9David du Colombier
CL 5232 added TestServerHijackGetsBackgroundByte, which is failing on Plan 9, because CloseWrite is not implemented on Plan 9 yet. Updates #17906. Updates #18657. Change-Id: I3c2f73760b0f767f3f9ed2698c855372170e0481 Reviewed-on: https://go-review.googlesource.com/35178 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-14net/http: skip TestServerHijackGetsBackgroundByte_big on Plan 9David du Colombier
CL 35234 added TestServerHijackGetsBackgroundByte_big, which is failing on Plan 9, because CloseWrite is not implemented on Plan 9 yet. Updates #17906. Updates #18658. Change-Id: Icaf3fe3600d586515ecd92aca874104ea81ce6b9 Reviewed-on: https://go-review.googlesource.com/35179 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-14net/http: add another hijack-after-background-read testBrad Fitzpatrick
Follow-up test from Ian's comments in https://golang.org/cl/35232 after submit. Change-Id: Ifa504bd8d09e555c3c7738376199dfc9b99130cf Reviewed-on: https://go-review.googlesource.com/35234 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2017-01-14all: test adjustments for the iOS builderDavid Crawshaw
The working directory is now adjusted to match the typical Go test working directory in main, as the old trick for adjusting earlier stopped working with the latest version of LLDB bugs. That means the small number of places where testdata files are read before main is called no longer work. This CL adjusts those reads to happen after main is called. (This has the bonus effect of not reading some benchmark testdata files in all.bash.) Fixes compress/bzip2, go/doc, go/parser, os, and time package tests on the iOS builder. Change-Id: If60f026aa7848b37511c36ac5e3985469ec25209 Reviewed-on: https://go-review.googlesource.com/35255 Run-TryBot: David Crawshaw <crawshaw@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-13net/http: make sure Hijack's bufio.Reader includes pre-read background byteBrad Fitzpatrick
Previously, if the Hijack called stopped the background read call which read a byte, that byte was sitting in memory, buffered, ready to be Read by Hijack's returned bufio.Reader, but it wasn't yet in the bufio.Reader's buffer itself, so bufio.Reader.Buffered() reported 1 byte fewer. This matters for callers who wanted to stitch together any buffered data (with bufio.Reader.Peek(bufio.Reader.Buffered())) with Hijack's returned net.Conn. Otherwise there was no way for callers to know a byte was read. Change-Id: Id7cb0a0a33fe2f33d79250e13dbaa9c0f7abba13 Reviewed-on: https://go-review.googlesource.com/35232 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2017-01-13cmd/go, misc: rework cwd handling for iOS testsDavid Crawshaw
Another change in behvaior (bug) in LLDB. Despite the fact that LLDB can dump the symtab of our test binaries and show the function addresses, it can no longer call the functions. This means the chdir trick on signal is failing. This CL uses a new trick. For iOS, the exec script passes the change in directory as an argument, and it is processed early by the test harness generated by cmd/go. For the iOS builders. Change-Id: I8f5d0f831fe18de99f097761f89c5184d5bf2afb Reviewed-on: https://go-review.googlesource.com/35152 Reviewed-by: Elias Naur <elias.naur@gmail.com> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-13syscall: export Fsid.X__val on s390xMichael Munday
mkpost.go replaces all variables prefixed with 'X_' with '_' on s390x because most of them do not need to be exposed. X__val is being used by a third party library so it turns out we do need to expose it on s390x (it is already exposed on all other Linux architectures). Fixes #17298 and updates #18632. Change-Id: Ic03463229a5f75ca41a4a4b50300da4b4d892d45 Reviewed-on: https://go-review.googlesource.com/30130 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-13doc/gdb: mention GOTRACEBACK=crashAlberto Donizetti
Also fix a couple of other errors. Fixes #6877 Change-Id: I94c81c5847cc7b0adab19418e71687bc2ee7fe94 Reviewed-on: https://go-review.googlesource.com/34960 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-01-13misc/cgo/testplugin: test that types and itabs are uniqueKeith Randall
Make sure that the same type and itab generated in two different plugins are actually the same thing. See also CL 35115 Change-Id: I0c1ecb039d7e2bf5a601d58dfa162a435ae4ef76 Reviewed-on: https://go-review.googlesource.com/35116 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-01-13reflect: keep makeFuncImpl live across makeFuncStubAustin Clements
When traceback sees reflect.makeFuncStub (or reflect.methodValueCall) on the stack, it expects to be able to get the *reflect.makeFuncImpl (or *reflect.methodValue) for that call from the first outgoing argument slot of makeFuncStub/methodValueCall. However, currently this object isn't necessarily kept live across makeFuncStub. This means it may get garbage collected while in a reflect call and reused for something else. If we then try to traceback, the runtime will see a corrupted makeFuncImpl object and panic. This was not a problem in previous releases because we always kept arguments live across the whole function. This became a problem when we stopped doing this. Fix this by using reflect.KeepAlive to keep the makeFuncImpl/methodValue live across all of callReflect/callMethod, which in turn keeps it live as long as makeFuncStub/methodValueCall are on the stack. Fixes #18635. Change-Id: I91853efcf17912390fddedfb0230648391c33936 Reviewed-on: https://go-review.googlesource.com/35151 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-12cmd/link: only exclude C-only symbols on darwinDavid Crawshaw
C-only symbols are excluded from pclntab because of a quirk of darwin, where functions are referred to by an exported symbol so dynamic relocations de-duplicate to the host binary module and break unwinding. This doesn't happen on ELF systems because the linker always refers to unexported module-local symbols, so we don't need this condition. And the current logic for excluding some functions breaks the module verification code in moduledataverify1. So disable this for plugins on linux. (In 1.9, it will probably be necessary to introduce a module-local symbol reference system on darwin to fix a different bug, so all of this onlycsymbol code made be short-lived.) With this CL, the tests in CL 35116 pass. Change-Id: I517d7ca4427241fa0a91276c462827efb9383be9 Reviewed-on: https://go-review.googlesource.com/35190 Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-12compress/flate: avoid large stack growth in fillDeflateJoe Tsai
Ranging over an array causes the array to be copied over to the stack, which cause large re-growths. Instead, we should iterate over slices of the array. Also, assigning a large struct literal uses the stack even though the actual fields being populated are small in comparison to the entirety of the struct (see #18636). Fixing the stack growth does not alter CPU-time performance much since the stack-growth and copying was such a tiny portion of the compression work: name old time/op new time/op delta Encode/Digits/Default/1e4-8 332µs ± 1% 332µs ± 1% ~ (p=0.796 n=10+10) Encode/Digits/Default/1e5-8 5.07ms ± 2% 5.05ms ± 1% ~ (p=0.815 n=9+8) Encode/Digits/Default/1e6-8 53.7ms ± 1% 53.9ms ± 1% ~ (p=0.075 n=10+10) Encode/Twain/Default/1e4-8 380µs ± 1% 380µs ± 1% ~ (p=0.684 n=10+10) Encode/Twain/Default/1e5-8 5.79ms ± 2% 5.79ms ± 1% ~ (p=0.497 n=9+10) Encode/Twain/Default/1e6-8 61.5ms ± 1% 61.8ms ± 1% ~ (p=0.247 n=10+10) name old speed new speed delta Encode/Digits/Default/1e4-8 30.1MB/s ± 1% 30.1MB/s ± 1% ~ (p=0.753 n=10+10) Encode/Digits/Default/1e5-8 19.7MB/s ± 2% 19.8MB/s ± 1% ~ (p=0.795 n=9+8) Encode/Digits/Default/1e6-8 18.6MB/s ± 1% 18.5MB/s ± 1% ~ (p=0.072 n=10+10) Encode/Twain/Default/1e4-8 26.3MB/s ± 1% 26.3MB/s ± 1% ~ (p=0.616 n=10+10) Encode/Twain/Default/1e5-8 17.3MB/s ± 2% 17.3MB/s ± 1% ~ (p=0.484 n=9+10) Encode/Twain/Default/1e6-8 16.3MB/s ± 1% 16.2MB/s ± 1% ~ (p=0.238 n=10+10) Updates #18636 Fixes #18625 Change-Id: I471b20339bf675f63dc56d38b3acdd824fe23328 Reviewed-on: https://go-review.googlesource.com/35122 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-12cmd/go: add comment about SIGUSR2 on iOSDavid Crawshaw
Missing from CL 34926. Change-Id: I4a046440c30811f26da53bee0e853dae3b0ac57a Reviewed-on: https://go-review.googlesource.com/35123 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-12cmd/go, misc: switch from breakpoint to SIGUSR2David Crawshaw
The iOS test harness has set a breakpoint early in the life of Go programs so that it can change the current working directory using information only available from the host debugger. Somewhere in the upgrade to iOS 10 / XCode 8.2, breakpoints stopped working. This may be an LLDB bug, or a bug in the ios-deploy LLDB scripts, it's not clear. Work around the problem by giving up on breakpoints. Instead, early in the life of every test binary built for iOS, send (and ignore) a SIGUSR2 signal. The debugger will catch this, giving the script go_darwin_arm_exec a chance to change the working directory. For the iOS builders. Change-Id: I7476531985217d0c76bc176904c48379210576c2 Reviewed-on: https://go-review.googlesource.com/34926 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>