aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-04[release-branch.go1.13] go1.13.5go1.13.5Carlos Amedee
Change-Id: I700055da44126e2dfa56f371f9e208f4f727bbed Reviewed-on: https://go-review.googlesource.com/c/go/+/209898 Run-TryBot: Carlos Amedee <carlos@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-12-04[release-branch.go1.13] doc: fix typo in Go 1.12.14 documentCarlos Amedee
Change-Id: I3641a086f167a1337aaaacd2d758b6a42b84a7fb Reviewed-on: https://go-review.googlesource.com/c/go/+/209845 Run-TryBot: Carlos Amedee <carlos@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 98e7270a3d03c2741fc790ea619e5754c49e05ed) Reviewed-on: https://go-review.googlesource.com/c/go/+/209877
2019-12-04[release-branch.go1.13] doc: document Go 1.13.5Carlos Amedee
Change-Id: I289d13ff0a01466d93ebc555eaa81273d4297eb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/209841 Run-TryBot: Carlos Amedee <carlos@golang.org> Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com> Reviewed-by: Alexander Rakoczy <alex@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit ebfe0574898c07e0a09a52390df1b282e2b176f7) Reviewed-on: https://go-review.googlesource.com/c/go/+/209843 Run-TryBot: Alexander Rakoczy <alex@golang.org>
2019-12-04[release-branch.go1.13] doc: document Go 1.12.14Carlos Amedee
Change-Id: I7589ef4bdac776c8f141e9cc60f59f8643649310 Reviewed-on: https://go-review.googlesource.com/c/go/+/209840 Reviewed-by: Alexander Rakoczy <alex@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit f805b05b39a28a85017df4540f1770f0d833e3d2) Reviewed-on: https://go-review.googlesource.com/c/go/+/209844 Run-TryBot: Carlos Amedee <carlos@golang.org>
2019-12-04[release-branch.go1.13] cmd/compile: fix spurious R_TLE_LE reloc on android/386Than McIntosh
When compiling for GOARCH=386 GOOS=android, the compiler was attaching R_TLS_LE relocations inappropriately -- as of Go 1.13 the TLS access recipe for Android refers to a runtime symbol and no longer needs this type of relocation (which was causing a crash when the linker tried to process it). Fixes #34825. Change-Id: Ida01875011b524586597b1f7e273aa14e11815d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/200337 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Elias Naur <mail@eliasnaur.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/204100
2019-12-04[release-branch.go1.13] runtime: fix textOff for multiple text sectionsLynn Boger
If a compilation has multiple text sections, code in textOff must compare the offset argument against the range for each text section to determine which one it is in. The comparison looks like this: if uintptr(off) >= sectaddr && uintptr(off) <= sectaddr+sectlen If the off value being compared is equal to sectaddr+sectlen then it is not within the range of the text section but after it. The comparison should be just '<'. Fixes #35211 Change-Id: I114633fd734563d38f4e842dd884c6c239f73c95 Reviewed-on: https://go-review.googlesource.com/c/go/+/203817 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit 0ae9389609f23dc905c58fc2ad7bcc16b770f337) Reviewed-on: https://go-review.googlesource.com/c/go/+/203819 Run-TryBot: Carlos Amedee <carlos@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2019-12-03[release-branch.go1.13] cmd/go/internal/modget: synchronize writes to ↵Carlos Amedee
modOnly map in runGet Adds an additional lock around an access to modOnly. Updates #35317 Fixes #35318 Change-Id: Ia1e75f9a674ec2a2c0489b41283c1cd3e7924d1e Reviewed-on: https://go-review.googlesource.com/c/go/+/209237 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 9174e2c03c423a47bf052b8a1aa844f3378eccd4) Reviewed-on: https://go-review.googlesource.com/c/go/+/209222 Run-TryBot: Alexander Rakoczy <alex@golang.org>
2019-11-26[release-branch.go1.13] cmd/go/internal/modget: synchronize writes to ↵Bryan C. Mills
modOnly map in runGet Updates #35317 Fixes #35318 Change-Id: Id858a25dc16a1bbff1802d25bcd4aca31c1133bc Reviewed-on: https://go-review.googlesource.com/c/go/+/205067 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 7e71c9c3edbf5b7a8608d6f739c20420a618e0ab) Reviewed-on: https://go-review.googlesource.com/c/go/+/205517
2019-11-22[release-branch.go1.13] net/http: fix Server.ConnContext modifying context ↵Roman Kollár
for all new connections Updates #35750 Fixes #35765 Change-Id: I65d38cfc5ddd66131777e104c269cc3559b2471d GitHub-Last-Rev: 953fdfd49b2be665be43f8148d2a6180dae3b91c GitHub-Pull-Request: golang/go#35751 Reviewed-on: https://go-review.googlesource.com/c/go/+/208318 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit bbbc6589dfbc05be2bfa59f51c20f9eaa8d0c531) Reviewed-on: https://go-review.googlesource.com/c/go/+/208235 Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-11-21[release-branch.go1.13] all: base64-encode binaries that will cause Apple ↵Andrew
notarization to fail Starting with macOS 10.15 (Catalina), Apple now requires all software distributed outside of the App Store to be notarized. Any binaries we distribute must abide by a strict set of requirements like code-signing and having a minimum target SDK of 10.9 (amongst others). Apple’s notarization service will recursively inspect archives looking to find notarization candidate binaries. If it finds a binary that does not meet the requirements or is unable to decompress an archive, it will reject the entire distribution. From cursory testing, it seems that the service uses content sniffing to determine file types, so changing the file extension will not work. There are some binaries and archives included in our distribution that are being detected by Apple’s service as potential candidates for notarization or decompression. As these are files used by tests and some are intentionally invalid, we don’t intend to ever make them compliant. As a workaround for this, we base64-encode any binaries or archives that Apple’s notarization service issues a warning for, as these warnings will become errors in January 2020. Updates #34986 Fixes #35748 Change-Id: I106fbb6227b61eb221755568f047ee11103c1680 Reviewed-on: https://go-review.googlesource.com/c/go/+/208118 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 8bbfc51d9ac9ce9472e126cc3654c9a45eceb236) Reviewed-on: https://go-review.googlesource.com/c/go/+/208219 Reviewed-by: Alexander Rakoczy <alex@golang.org>
2019-11-07[release-branch.go1.13] internal/reflectlite: update reflectlite to match ↵Ian Lance Taylor
runtime rtype/mapType Similar to tip https://golang.org/cl/197559. Fixes #35408 Change-Id: Ie8e28b93fb3adf23c3a0a39f6917ff76abf44fdf Reviewed-on: https://go-review.googlesource.com/c/go/+/205721 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-31[release-branch.go1.13] go1.13.4go1.13.4Andrew Bonventre
Change-Id: If01ea0da089ee94587a378d13b4a2ad1592f1ea7 Reviewed-on: https://go-review.googlesource.com/c/go/+/204642 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-31[release-branch.go1.13] doc: document Go 1.13.4Andrew Bonventre
Change-Id: Ib29e642c56eca96826187f5737d74f8c0430ac3d Reviewed-on: https://go-review.googlesource.com/c/go/+/204677 Run-TryBot: Andrew Bonventre <andybons@golang.org> Run-TryBot: Katie Hockman <katie@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-31[release-branch.go1.13] doc: document Go 1.12.13Andrew Bonventre
Change-Id: Ic65a74e56320adbd76aeef1cf3b19d7906ffe8fe Reviewed-on: https://go-review.googlesource.com/c/go/+/204640 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-25[release-branch.go1.13] syscall: reenable sysctl on iOSJason A. Donenfeld
This was disabled due to a report that the App Store rejects the symbol __sysctl. However, we use the sysctl symbol, which is fine. The __sysctl symbol is used by x/sys/unix, which needs fixing instead. So, this commit reenables sysctl on iOS, so that things like net.InterfaceByName can work again. This reverts CL 193843, CL 193844, CL 193845, and CL 193846. Fixes #35105 Updates #35101 Updates #34133 Updates #35103 Change-Id: Ib8eb9f87b81db24965b0de29d99eb52887c7c60a Reviewed-on: https://go-review.googlesource.com/c/go/+/202778 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/202779 Reviewed-by: Elias Naur <mail@eliasnaur.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-10-23[release-branch.go1.13] net/http: don't cache http2.erringRoundTripper ↵Brad Fitzpatrick
connections Fixes #35087 Updates #34978 Change-Id: I3baf1392ba7366ae6628889c47c343ef702ec438 Reviewed-on: https://go-review.googlesource.com/c/go/+/202078 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 88186e5e232625f9c91d639e0cb90a88c6cf1172) Reviewed-on: https://go-review.googlesource.com/c/go/+/202642 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-10-17[release-branch.go1.13] go1.13.3go1.13.3Alexander Rakoczy
Change-Id: If3364685f08585e3679fb5239bda127f440af473 Reviewed-on: https://go-review.googlesource.com/c/go/+/201826 Run-TryBot: Alexander Rakoczy <alex@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Katie Hockman <katie@golang.org>
2019-10-17[release-branch.go1.13] doc: document Go 1.13.3Alexander Rakoczy
Change-Id: Ia571b8aa791578a77ed5c2b8eaf45c9684eea1c3 Reviewed-on: https://go-review.googlesource.com/c/go/+/201820 Reviewed-by: Andrew Bonventre <andybons@golang.org> (cherry picked from commit f95bf8b64bd1c4e53d27dcd39e128a7b4492382f) Reviewed-on: https://go-review.googlesource.com/c/go/+/201825
2019-10-17[release-branch.go1.13] doc: document Go 1.12.12Alexander Rakoczy
Change-Id: I832ba5f32d513b586bb0b02371231786b25631e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/201817 Reviewed-by: Andrew Bonventre <andybons@golang.org> (cherry picked from commit 58e8f7897a0b69fee891af8461e1270d59f4d1a6) Reviewed-on: https://go-review.googlesource.com/c/go/+/201824 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-10-17[release-branch.go1.13] all: merge release-branch.go1.13-security into ↵Katie Hockman
release-branch.go1.13 Change-Id: I4fea3f155e7f7315a536e7b670d7ceba2092555d
2019-10-17[release-branch.go1.13] cmd/go/internal/work: fix error while passing custom ↵Agniva De Sarker
vet tool For GOROOT packages, we were adding -unsafeptr=false to prevent unsafe.Pointer checks. But the flag also got passed to invocations of go vet with a custom vet tool. To prevent this from happening, we add this flag only when no tools are passed. Updates #34053 Fixes #34922 Change-Id: I8bcd637fd8ec423d597fcdab2a0ceedd20786019 Reviewed-on: https://go-review.googlesource.com/c/go/+/200957 Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 902d5aa84f8340752c20b93bfd450a6cefcf3952) Reviewed-on: https://go-review.googlesource.com/c/go/+/201237 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
2019-10-17[release-branch.go1.13-security] go1.13.2go1.13.2Katie Hockman
Change-Id: I057434f66a07bd97e7608e171e48283423d89680 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575987 Reviewed-by: Filippo Valsorda <valsorda@google.com>
2019-10-17[release-branch.go1.13-security] doc: document Go 1.13.2 and Go 1.12.11Katie Hockman
Change-Id: I73f27924046a0a2493330ddc732d1a2fd3f730a5 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575981 Reviewed-by: Filippo Valsorda <valsorda@google.com> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575983
2019-10-17[release-branch.go1.13-security] cmd/compile: make poset use sufficient ↵zdjones
conditions for OrderedOrEqual When assessing whether A <= B, the poset's OrderedOrEqual has a passing condition which permits A <= B, but is not sufficient to infer that A <= B. This CL removes that incorrect passing condition. Having identified that A and B are in the poset, the method will report that A <= B if any of these three conditions are true: (1) A and B are the same node in the poset. - This means we know that A == B. (2) There is a directed path, strict or not, from A -> B - This means we know that, at least, A <= B, but A < B is possible. (3) There is a directed path from B -> A, AND that path has no strict edges. - This means we know that B <= A, but do not know that B < A. In condition (3), we do not have enough information to say that A <= B, rather we only know that B == A (which satisfies A <= B) is possible. The way I understand it, a strict edge shows a known, strictly-ordered relation (<) but the lack of a strict edge does not show the lack of a strictly-ordered relation. The difference is highlighted by the example in #34802, where a bounds check is incorrectly removed by prove, such that negative indexes into a slice succeed: n := make([]int, 1) for i := -1; i <= 0; i++ { fmt.Printf("i is %d\n", i) n[i] = 1 // No Bounds check, program runs, assignment to n[-1] succeeds!! } When prove is checking the negative/failed branch from the bounds check at n[i], in the signed domain we learn (0 > i || i >= len(n)). Because prove can't learn the OR condition, we check whether we know that i is non-negative so we can learn something, namely that i >= len(n). Prove uses the poset to check whether we know that i is non-negative. At this point the poset holds the following relations as a directed graph: -1 <= i <= 0 -1 < 0 In poset.OrderedOrEqual, we are testing for 0 <= i. In this case, condition (3) above is true because there is a non-strict path from i -> 0, and that path does NOT have any strict edges. Because this condition is true, the poset reports to prove that i is known to be >= 0. Knowing, incorrectly, that i >= 0, prove learns from the failed bounds check that i >= len(n) in the signed domain. When the slice, n, was created, prove learned that len(n) == 1. Because i is also the induction variable for the loop, upon entering the loop, prove previously learned that i is in [-1,0]. So when prove attempts to learn from the failed bounds check, it finds the new fact, i > len(n), unsatisfiable given that it previously learned that i <= 0 and len(n) = 1. Fixes #34807 Change-Id: I235f4224bef97700c3aa5c01edcc595eb9f13afc Reviewed-on: https://go-review.googlesource.com/c/go/+/200759 Run-TryBot: Zach Jones <zachj1@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Giovanni Bajo <rasky@develer.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/201060 Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575398 Reviewed-by: Filippo Valsorda <valsorda@google.com>
2019-10-17[release-branch.go1.13-security] cmd/compile: rename poset method dominates ↵zdjones
to reaches The partially ordered set uses a method named 'dominates' to determine whether two nodes are partially ordered. Dominates does a depth-first search of the DAG, beginning at the source node, and returns true as soon as it finds a path to the target node. In the context of the forest-of-DAGs that makes up the poset, dominates is not necessarily checking dominance, but is checking reachability. See the issue tracker for a more detailed discussion of the difference. Fortunately, reachability is logically correct everywhere dominates is currently used in poset.go. Reachability within a DAG is sufficient to establish the partial ordering (source < target). This CL changes the name of the method (dominates -> reaches) and updates all the comments in the file accordingly. Updates #34807 Change-Id: Ia3a34f7b14b363801d75b05099cfc686035f7d96 Reviewed-on: https://go-review.googlesource.com/c/go/+/192617 Reviewed-by: Giovanni Bajo <rasky@develer.com> Run-TryBot: Giovanni Bajo <rasky@develer.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/201059 Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575397 Reviewed-by: Filippo Valsorda <valsorda@google.com>
2019-10-16[release-branch.go1.13-security] crypto/dsa: prevent bad public keys from ↵Katie Hockman
causing panic dsa.Verify might currently use a nil s inverse in a multiplication if the public key contains a non-prime Q, causing a panic. Change this to check that the mod inverse exists before using it. Fixes CVE-2019-17596 Change-Id: I94d5f3cc38f1b5d52d38dcb1d253c71b7fd1cae7 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/572809 Reviewed-by: Filippo Valsorda <valsorda@google.com> (cherry picked from commit 9119dfb0511326d4485b248b83d4fde19c95d0f7) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575233
2019-10-16[release-branch.go1.13] crypto/ecdsa: remove s390x assemblyMichael Munday
This is a revert of CL 174437 and equivalent to CL 201360. The size of the params block passed into the KDSA instruction is incorrect and this appears to result in out-of-bounds writes that cause a panic in the crypto/x509 tests when run on a machine that supports KDSA. Remove this assembly for now. We can revisit the use of the KDSA instruction in a future release. Fixes #34928. Change-Id: I7ad2fe9714b47ad04abc25f18aa235b9d2aef062 Reviewed-on: https://go-review.googlesource.com/c/go/+/201361 Run-TryBot: Michael Munday <mike.munday@ibm.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-16[release-branch.go1.13] cmd/compile: better error message for language ↵Robert Griesemer
version errors Fixes #33761. Updates #33753. Updates #31747. Change-Id: Icc42b23405ead4f7f17b0ffa3611405454b6b271 Reviewed-on: https://go-review.googlesource.com/c/go/+/198491 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 27fc32ff01cc699e160890546816bd99d6c57823) Reviewed-on: https://go-review.googlesource.com/c/go/+/201480 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-10-14[release-branch.go1.13] cmd/compile: make poset use sufficient conditions ↵zdjones
for OrderedOrEqual When assessing whether A <= B, the poset's OrderedOrEqual has a passing condition which permits A <= B, but is not sufficient to infer that A <= B. This CL removes that incorrect passing condition. Having identified that A and B are in the poset, the method will report that A <= B if any of these three conditions are true: (1) A and B are the same node in the poset. - This means we know that A == B. (2) There is a directed path, strict or not, from A -> B - This means we know that, at least, A <= B, but A < B is possible. (3) There is a directed path from B -> A, AND that path has no strict edges. - This means we know that B <= A, but do not know that B < A. In condition (3), we do not have enough information to say that A <= B, rather we only know that B == A (which satisfies A <= B) is possible. The way I understand it, a strict edge shows a known, strictly-ordered relation (<) but the lack of a strict edge does not show the lack of a strictly-ordered relation. The difference is highlighted by the example in #34802, where a bounds check is incorrectly removed by prove, such that negative indexes into a slice succeed: n := make([]int, 1) for i := -1; i <= 0; i++ { fmt.Printf("i is %d\n", i) n[i] = 1 // No Bounds check, program runs, assignment to n[-1] succeeds!! } When prove is checking the negative/failed branch from the bounds check at n[i], in the signed domain we learn (0 > i || i >= len(n)). Because prove can't learn the OR condition, we check whether we know that i is non-negative so we can learn something, namely that i >= len(n). Prove uses the poset to check whether we know that i is non-negative. At this point the poset holds the following relations as a directed graph: -1 <= i <= 0 -1 < 0 In poset.OrderedOrEqual, we are testing for 0 <= i. In this case, condition (3) above is true because there is a non-strict path from i -> 0, and that path does NOT have any strict edges. Because this condition is true, the poset reports to prove that i is known to be >= 0. Knowing, incorrectly, that i >= 0, prove learns from the failed bounds check that i >= len(n) in the signed domain. When the slice, n, was created, prove learned that len(n) == 1. Because i is also the induction variable for the loop, upon entering the loop, prove previously learned that i is in [-1,0]. So when prove attempts to learn from the failed bounds check, it finds the new fact, i > len(n), unsatisfiable given that it previously learned that i <= 0 and len(n) = 1. Fixes #34807 Change-Id: I235f4224bef97700c3aa5c01edcc595eb9f13afc Reviewed-on: https://go-review.googlesource.com/c/go/+/200759 Run-TryBot: Zach Jones <zachj1@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Giovanni Bajo <rasky@develer.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/201060 Run-TryBot: Alexander Rakoczy <alex@golang.org>
2019-10-14[release-branch.go1.13] cmd/compile: rename poset method dominates to reacheszdjones
The partially ordered set uses a method named 'dominates' to determine whether two nodes are partially ordered. Dominates does a depth-first search of the DAG, beginning at the source node, and returns true as soon as it finds a path to the target node. In the context of the forest-of-DAGs that makes up the poset, dominates is not necessarily checking dominance, but is checking reachability. See the issue tracker for a more detailed discussion of the difference. Fortunately, reachability is logically correct everywhere dominates is currently used in poset.go. Reachability within a DAG is sufficient to establish the partial ordering (source < target). This CL changes the name of the method (dominates -> reaches) and updates all the comments in the file accordingly. Updates #34807 Change-Id: Ia3a34f7b14b363801d75b05099cfc686035f7d96 Reviewed-on: https://go-review.googlesource.com/c/go/+/192617 Reviewed-by: Giovanni Bajo <rasky@develer.com> Run-TryBot: Giovanni Bajo <rasky@develer.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/201059 Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2019-10-14[release-branch.go1.13] net/http: fix Transport panic with nil Request.HeaderEmmanuel T Odeke
For Go 1.13 we introduced Header.Clone and it returns nil if a nil Header is cloned. Unfortunately, though, this exported Header.Clone nil behavior differed from the old Go 1.12 and earlier internal header clone behavior which always returned non-nil Headers. This CL fixes the places where that distinction mattered. Fixes #34882 Change-Id: Id19dea2272948c8dd10883b18ea7f7b8b33ea8eb Reviewed-on: https://go-review.googlesource.com/c/go/+/200977 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 9969c720800302c63147720da5507633133bd4a6) Reviewed-on: https://go-review.googlesource.com/c/go/+/201040
2019-10-09[release-branch.go1.13] os: re-enable TestPipeThreads on darwinShenghou Ma
CL 197938 actually fixes those regression on Darwin as syscalls are no longer labeled as always blocking and consume a thread. Fixes #34712 Change-Id: I82c98516c23cd36f762bc5433d7b71ea8939a0ac Reviewed-on: https://go-review.googlesource.com/c/go/+/199477 Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> (cherry picked from commit cfe232042981972dc0c7e8d741a04556ecaae3c3) Reviewed-on: https://go-review.googlesource.com/c/go/+/200105 Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-10-09[release-branch.go1.13] runtime: fix darwin syscall performance regressionShenghou Ma
While understanding why syscall.Read is 2x slower on darwin/amd64, I found out that, contrary to popular belief, the slowdown is not due to the migration to use libSystem.dylib instead of direct SYSCALLs, i.e., CL 141639 (and #17490), but due to a subtle change introduced in CL 141639. Previously, syscall.Read used syscall.Syscall(SYS_READ), whose preamble called runtime.entersyscall, but after CL 141639, syscall.Read changes to call runtime.syscall_syscall instead, which in turn calls runtime.entersyscallblock instead of runtime.entersyscall. And the entire 2x slow down can be attributed to this change. I think this is unnecessary as even though syscalls like Read might block, it does not always block, so there is no need to handoff P proactively for each Read. Additionally, we have been fine with not handing off P for each Read prior to Go 1.12, so we probably don't need to change it. This changes restores the pre-Go 1.12 behavior, where syscall preamble uses runtime.entersyscall, and we rely on sysmon to take P back from g blocked in syscalls. Updates #34712 Change-Id: If76e97b5a7040cf1c10380a567c4f5baec3121ba Reviewed-on: https://go-review.googlesource.com/c/go/+/197938 Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit c1635ad8f0bb9fbe5bfbf0a633c78a03930758c4) Reviewed-on: https://go-review.googlesource.com/c/go/+/200103 Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-10-09[release-branch.go1.13] cmd/go: suppress more errors in package-to-module ↵Bryan C. Mills
loading In CL 197059, I suppressed errors if the target package was already found. However, that does not cover the case of passing a '/v2' module path to 'go get' when the module does not contain a package at its root. This CL is a minimal fix for that case, intended to be backportable to 1.13. (Longer term, I intend to rework the version-validation check to treat all mismatched paths as ErrNotExist.) Updates #34746 Fixes #34747 Change-Id: Ia963c2ea00fae424812b8f46a4d6c2c668252147 Reviewed-on: https://go-review.googlesource.com/c/go/+/199839 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 421d35cf69f4a18edf96004ba99c01e629a0f79f) Reviewed-on: https://go-review.googlesource.com/c/go/+/199997
2019-10-07[release-branch.go1.13] cmd/go: fix listing of ambiguous pathsDuco van Amstel
Passing ambiguous patterns, ending in `.go`, to `go list` results in them being interpreted as Go files despite potentially being package references. This can then result in errors on other package references. The parsing logic is modified to check for a locally present file corresponding to any pattern ending in `.go`. If no such file is present the pattern is considered to be a package reference. We're also adding a variety of non-regression tests that fail with the original parsing code but passes after applying the fix. Updates #34653 Fixes #34694 Change-Id: I073871da0dfc5641a359643f95ac14608fdca09b GitHub-Last-Rev: 5abc200103ffc122df05422d79cf30c3ba0ee646 GitHub-Pull-Request: golang/go#34663 Reviewed-on: https://go-review.googlesource.com/c/go/+/198459 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit 33683f1d64df0cef2c598a84b741abb5af8abe5e) Reviewed-on: https://go-review.googlesource.com/c/go/+/198957 Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-10-07[release-branch.go1.13] syscall: replace mksyscall_windows.go with wrapper ↵Jason A. Donenfeld
to new x/sys home We replace the existing file with a thin wrapper around its target so that we don't break anybody's workflow. This combines CL 198977 and CL 199277. Fixes #34388 Change-Id: I0d00371c483cb78f4be18fe987df33c79cd40f05 Reviewed-on: https://go-review.googlesource.com/c/go/+/199538 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-10-04[release-branch.go1.13] Revert "cmd/go: add a Latest field to the output of ↵Bryan C. Mills
'go mod download -json'" This reverts CL 183841. Updates #34533 Fixes #34679 Reason for revert: Introduced a significant performance regression for repos with many incompatible-version tags. Change-Id: I75d7fd76e6e1a0902b114b00167b38439e0f8221 Reviewed-on: https://go-review.googlesource.com/c/go/+/198699 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 961837dec23f900bbf8b04230c72397a0aab4be6) Reviewed-on: https://go-review.googlesource.com/c/go/+/199079
2019-10-04[release-branch.go1.13] runtime: scavenge on growth instead of inline with ↵Michael Anthony Knyszek
allocation Inline scavenging causes significant performance regressions in tail latency for k8s and has relatively little benefit for RSS footprint. We disabled inline scavenging in Go 1.12.5 (CL 174102) as well, but we thought other changes in Go 1.13 had mitigated the issues with inline scavenging. Apparently we were wrong. This CL switches back to only doing foreground scavenging on heap growth, rather than doing it when allocation tries to allocate from scavenged space. Fixes #34556 Change-Id: I1f5df44046091f0b4f89fec73c2cde98bf9448cb Reviewed-on: https://go-review.googlesource.com/c/go/+/183857 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> (cherry picked from commit eb96f8a57444d174bba500b3a5d2a8b21b7e6d1e) Reviewed-on: https://go-review.googlesource.com/c/go/+/198486 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Andrew Bonventre <andybons@golang.org>
2019-10-04[release-branch.go1.13] runtime: redefine scavenge goal in terms of heap_inuseMichael Anthony Knyszek
This change makes it so that the scavenge goal is defined primarily in terms of heap_inuse at the end of the last GC rather than next_gc. The reason behind this change is that next_gc doesn't take into account fragmentation, and we can fall into situation where the scavenger thinks it should have work to do but there's no free and unscavenged memory available. In order to ensure the scavenge goal still tracks next_gc, we multiply heap_inuse by the ratio between the current heap goal and the last heap goal, which describes whether the heap is growing or shrinking, and by how much. Finally, this change updates the documentation for scavenging and elaborates on why the scavenge goal is defined the way it is. Fixes #34149 Change-Id: I8deaf87620b5dc12a40ab8a90bf27932868610da Reviewed-on: https://go-review.googlesource.com/c/go/+/193040 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit 9b30811280427a6d50d2558f316d62210e948656) Reviewed-on: https://go-review.googlesource.com/c/go/+/198487 Run-TryBot: Andrew Bonventre <andybons@golang.org>
2019-10-04[release-branch.go1.13] runtime: grow the heap incrementallyAustin Clements
Currently, we map and grow the heap a whole arena (64MB) at a time. Unfortunately, in order to fix #32828, we need to switch from scavenging inline with allocation back to scavenging on heap growth, but heap-growth scavenging happens in large jumps because we grow the heap in large jumps. In order to prepare for better heap-growth scavenging, this CL separates mapping more space for the heap from actually "growing" it (tracking the new space with spans). Instead, growing the heap keeps track of the "current arena" it's growing into. It track that with new spans as needed, and only maps more arena space when the current arena is inadequate. The effect to the user is the same, but this will let us scavenge on much smaller increments of heap growth. There are two slightly subtleties to this change: 1. If an allocation requires mapping a new arena and that new arena isn't contiguous with the current arena, we don't want to lose the unused space in the current arena, so we have to immediately track that with a span. 2. The mapped space must be accounted as released and idle, even though it isn't actually tracked in a span. For #32828, since this makes heap-growth scavenging far more effective, especially at small heap sizes. For example, this change is necessary for TestPhysicalMemoryUtilization to pass once we remove inline scavenging. Updates #34556 Change-Id: I300e74a0534062467e4ce91cdc3508e5ef9aa73a Reviewed-on: https://go-review.googlesource.com/c/go/+/189957 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> (cherry picked from commit f18109d7e30c8d1a6e1c87ba3458499ac7ab2a79) Reviewed-on: https://go-review.googlesource.com/c/go/+/198485 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2019-10-04[release-branch.go1.13] net/http: update bundled http2 for memory leak fixBrad Fitzpatrick
This re-runs go generate with x/net checked out at CL 198617 on the release-branch.go1.13 branch for: [release-branch.go1.13] http2: fix memory leak in random write scheduler Fixes golang/go#34636 Updates golang/go#33812 Change-Id: Ibce630c6c7ffe43ff760d2ad40b44731c07ba870 Reviewed-on: https://go-review.googlesource.com/c/go/+/198897 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-10-04[release-branch.go1.13] runtime: monitor for suspend/resume to kick timeoutsJason A. Donenfeld
Starting in Windows 8, the wait functions don't take into account suspend time, even though the monotonic counters do. This results in timer buckets stalling on resume. Therefore, this commit makes it so that on resume, we return from the wait functions and recalculate the amount of time left to wait. This is a cherry pick of CL 191957 and its cleanup, CL 198417. Updates #31528 Fixes #34130 Change-Id: I0db02cc72188cb620954e87a0180e0a3c83f4a56 Reviewed-on: https://go-review.googlesource.com/c/go/+/193607 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2019-10-03[release-branch.go1.13] cmd/go/internal/modfetch: update TestCodeRepo for ↵Tobias Klauser
gopkg.in/yaml.v2 again Update the expected data to fix the longtest builder. Updates #28856 Change-Id: I7fb6ee72e8469d974561b4b4057f40142f5b3654 Reviewed-on: https://go-review.googlesource.com/c/go/+/198557 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> (cherry picked from commit 64785bf96c5942e5e2a3d326b48eae4e7b189e03) Reviewed-on: https://go-review.googlesource.com/c/go/+/198700 Run-TryBot: Bryan C. Mills <bcmills@google.com>
2019-10-03[release-branch.go1.13] net: avoid an infinite loop in LookupAddrMichael Hendricks
If a request for a PTR record returned a response with a non-PTR answer, goLookupPTR would loop forever. Skipping non-PTR answers guarantees progress through the DNS response. Fixes #34662 Updates #34660 Change-Id: I56f9d21e5342d07e7d843d253267e93a29707904 Reviewed-on: https://go-review.googlesource.com/c/go/+/198460 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit f0e940ebc985661f54d31c8d9ba31a553b87041b) Reviewed-on: https://go-review.googlesource.com/c/go/+/198489 Reviewed-by: Michael Hendricks <michael@ndrix.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-10-02[release-branch.go1.13] runtime: fix lock acquire cycles related to ↵Michael Anthony Knyszek
scavenge.lock There are currently two edges in the lock cycle graph caused by scavenge.lock: with sched.lock and mheap_.lock. These edges appear because of the call to ready() and stack growths respectively. Furthermore, there's already an invariant in the code wherein mheap_.lock must be acquired before scavenge.lock, hence the cycle. The fix to this is to bring scavenge.lock higher in the lock cycle graph, such that sched.lock and mheap_.lock are only acquired once scavenge.lock is already held. To faciliate this change, we move scavenger waking outside of gcSetTriggerRatio such that it doesn't have to happen with the heap locked. Furthermore, we check scavenge generation numbers with the heap locked by using gopark instead of goparkunlock, and specify a function which aborts the park should there be any skew in generation count. Fixes #34150. Change-Id: I3519119214bac66375e2b1262b36ce376c820d12 Reviewed-on: https://go-review.googlesource.com/c/go/+/191977 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit 62e415655238a3c0103c1b70e6805edf8193c543) Reviewed-on: https://go-review.googlesource.com/c/go/+/197501 Reviewed-by: Austin Clements <austin@google.com>
2019-10-01[release-branch.go1.13] cmd/go: don't include package dir in cache key when ↵Jay Conrod
-trimpath is set The '-trimpath' flag tells 'go build' to trim any paths from the output files that are tied to the current workspace or toolchain. When this flag is set, we do not need to include the package directory in the text hashed to construct the action ID for each package. Updates #33772 Fixes #34326 Change-Id: I20b902d2f58019709b15864ca79aa0d9255ae707 Reviewed-on: https://go-review.googlesource.com/c/go/+/195318 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit aa680c0c49b55722a72ad3772e590cd2f9af541d) Reviewed-on: https://go-review.googlesource.com/c/go/+/198259 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-09-27[release-branch.go1.13] net/http: remove TestTimeoutHandlerAndFlusher due to ↵Emmanuel T Odeke
flakes Removes TestTimeoutHandlerAndFlusher due to flakes on one of the builders due to timing issues. Perhaps later, we might need to bring it back when we've figured out the timing issues. Updates #34573 Fixes #34579 Change-Id: Ia88d4da31fb228296144dc31f9a4288167fb4a53 Reviewed-on: https://go-review.googlesource.com/c/go/+/197757 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 55738850c43bd1ae46326f7419dbd8f49808c776) Reviewed-on: https://go-review.googlesource.com/c/go/+/197719 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-09-27[release-branch.go1.13] net/http, doc/go1.13.html: revert TimeoutHandler.FlushEmmanuel T Odeke
Also added a test to ensure that any interactions between TimeoutHandler and Flusher result in the correct status code and body, but also that we don't get superfluous logs from stray writes as was seen in the bug report. Fixes #34560. Change-Id: I4af62db256742326f9353f98a2fcb5f71d2a5fd9 Reviewed-on: https://go-review.googlesource.com/c/go/+/197659 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 4faf8a8dc44555c4fdbe4fb108f42144e58ae6b1) Reviewed-on: https://go-review.googlesource.com/c/go/+/197543
2019-09-26[release-branch.go1.13] all: merge release-branch.go1.13-security into ↵Filippo Valsorda
release-branch.go1.13 Change-Id: Ifd5550b88100c8714ca11bf18b12aa197e3069e5
2019-09-26[release-branch.go1.13] net/http: remove http2 connections when no longer cachedMichael Fraenkel
When the http2 transport returns a NoCachedConnError, the connection must be removed from the idle list as well as the connections per host. Fixes #34498 Change-Id: I7875c9c95e694a37a339bb04385243b49f9b20d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/196665 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/197377 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>