Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f2113d9
[release-branch.go1.11] doc/go1.11, cmd/go: elaborate on new GOFLAGS …
dmitshur Sep 12, 2018
b5ed6ec
[release-branch.go1.11] net/http: ensure null body in Fetch response …
johanbrandhorst Aug 24, 2018
e535c71
[release-branch.go1.11] runtime: ignore races between close and len/cap
randall77 Sep 17, 2018
05a0c7b
[release-branch.go1.11] net: fail fast for DNS rcode success with no …
iangudger Sep 6, 2018
7544ac6
[release-branch.go1.11] cmd/go: add GOMIPS value to build id for mipsle
ianlancetaylor Aug 27, 2018
34e5a85
[release-branch.go1.11] doc: add go1.11 to contrib.html
broady Sep 28, 2018
a2f1c8e
[release-branch.go1.11] reflect: use correct write barrier operations…
randall77 Sep 25, 2018
3afa9df
[release-branch.go1.11] reflect: ensure correct scanning of return va…
randall77 Sep 25, 2018
58c9bd9
[release-branch.go1.11] reflect: fix s390x reflect method calls
randall77 Sep 30, 2018
307f8b5
[release-branch.go1.11] net: concatenate multiple TXT strings in sing…
mwwaters Sep 24, 2018
92ae524
[release-branch.go1.11] encoding/json: fix UnmarshalTypeError without…
bigflood Aug 28, 2018
52c4bdb
[release-branch.go1.11] doc: document Go 1.11.1
katiehockman Oct 1, 2018
2695716
[release-branch.go1.11] go1.11.1
katiehockman Oct 1, 2018
e9c178d
[release-branch.go1.11] misc/wasm: add mention of polyfill for Edge s…
neelance Oct 2, 2018
19fe28a
[release-branch.go1.11] cmd/compile: don't crash reporting misuse of …
taylorza Sep 2, 2018
aa09661
[release-branch.go1.11] cmd/compile: fix type of OffPtr in some optim…
cherrymui Oct 3, 2018
c33153f
[release-branch.go1.11] cmd/go: don't mention -mod=release
mark-rushakoff Aug 30, 2018
844bb04
[release-branch.go1.11] doc: update docs.html with new tour import path
andybons Oct 12, 2018
05b2b9b
[release-branch.go1.11] cmd/go: ensure git attributes are set
jasonkeene Sep 13, 2018
edb6c16
[release-branch.go1.11] cmd/go, cmd/link: silence bogus Apple Xcode w…
rsc Oct 24, 2018
97781d2
[release-branch.go1.11] internal/poll: advance file position in windo…
alexbrainman Oct 30, 2018
ce6c8a5
[release-branch.go1.11] cmd/go/internal/modcmd: remove non-existent -…
agnivade Aug 28, 2018
eb46d15
[release-branch.go1.11] cmd/trace: don't drop sweep slice details
hyangah Sep 17, 2018
369c188
[release-branch.go1.11] database/sql: correctly report MaxIdleClosed …
kardianos Sep 30, 2018
68ad1d6
[release-branch.go1.11] go/types: use correct receiver types for embe…
griesemer Oct 11, 2018
6fb1030
[release-branch.go1.11] doc: document Go 1.10.5
andybons Nov 2, 2018
bbce36c
[release-branch.go1.11] doc: document Go 1.11.2
andybons Nov 2, 2018
e8a95ae
[release-branch.go1.11] go1.11.2
andybons Nov 2, 2018
402eb45
[release-branch.go1.11] runtime: never call into race detector with r…
benesch Nov 9, 2018
f3b9f36
[release-branch.go1.11] runtime: avoid arm64 8.1 atomics on Android
Nov 4, 2018
e602388
[release-branch.go1.11] cmd/go: don't panic when go run is passed ...…
mark-rushakoff Nov 14, 2018
c92a208
[release-branch.go1.11] cmd/compile: don't deadcode eliminate labels
randall77 Nov 6, 2018
3e6c171
runtime: when using explicit argmap, also use arglen
randall77 Nov 12, 2018
62b47c2
[release-branch.go1.11] cmd/compile: reintroduce work-around for cycl…
griesemer Nov 3, 2018
ba4638d
[release-branch.go1.11] cmd/compile/internal/gc: OMUL should be evalu…
Nov 9, 2018
6971090
[release-branch.go1.11] go/types: avoid certain problems with recursi…
griesemer Nov 5, 2018
3577891
Merge branch 'go-under-the-hood' into release-branch.go1.11
changkun Nov 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
go1.11.1
go1.11.2
14 changes: 14 additions & 0 deletions doc/devel/release.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ <h3 id="go1.11.minor">Minor revisions</h3>
1.11.1 milestone</a> on our issue tracker for details.
</p>

<p>
go1.11.2 (released 2018/11/02) includes fixes to the compiler, linker,
documentation, go command, and the <code>database/sql</code> and
<code>go/types</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.2">Go
1.11.2 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.10">go1.10 (released 2018/02/16)</h2>

<p>
Expand Down Expand Up @@ -83,6 +90,13 @@ <h3 id="go1.10.minor">Minor revisions</h3>
1.10.4 milestone</a> on our issue tracker for details.
</p>

<p>
go1.10.5 (released 2018/11/02) includes fixes to the go command, linker, runtime
and the <code>database/sql</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.5">Go
1.10.5 milestone</a> on our issue tracker for details.
</p>

<h2 id="go1.9">go1.9 (released 2017/08/24)</h2>

<p>
Expand Down
4 changes: 2 additions & 2 deletions doc/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ <h3 id="go_tour">
online</a> or{{end}} install it locally with:
</p>
<pre>
$ go get golang.org/x/tour/gotour
$ go get golang.org/x/tour
</pre>
<p>
This will place the <code>gotour</code> binary in your workspace's <code>bin</code> directory.
This will place the <code>tour</code> binary in your workspace's <code>bin</code> directory.
</p>

<h3 id="code"><a href="code.html">How to write Go code</a></h3>
Expand Down
1 change: 1 addition & 0 deletions misc/cgo/test/cgo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func Test25143(t *testing.T) { test25143(t) }
func Test23356(t *testing.T) { test23356(t) }
func Test26066(t *testing.T) { test26066(t) }
func Test26213(t *testing.T) { test26213(t) }
func Test27660(t *testing.T) { test27660(t) }

func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }
func BenchmarkGoString(b *testing.B) { benchGoString(b) }
54 changes: 54 additions & 0 deletions misc/cgo/test/test27660.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Stress the interaction between the race detector and cgo in an
// attempt to reproduce the memory corruption described in #27660.
// The bug was very timing sensitive; at the time of writing this
// test would only trigger the bug about once out of every five runs.

package cgotest

// #include <unistd.h>
import "C"

import (
"context"
"math/rand"
"runtime"
"sync"
"testing"
"time"
)

func test27660(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ints := make([]int, 100)
locks := make([]sync.Mutex, 100)
// Slowly create threads so that ThreadSanitizer is forced to
// frequently resize its SyncClocks.
for i := 0; i < 100; i++ {
go func() {
for ctx.Err() == nil {
// Sleep in C for long enough that it is likely that the runtime
// will retake this goroutine's currently wired P.
C.usleep(1000 /* 1ms */)
runtime.Gosched() // avoid starvation (see #28701)
}
}()
go func() {
// Trigger lots of synchronization and memory reads/writes to
// increase the likelihood that the race described in #27660
// results in corruption of ThreadSanitizer's internal state
// and thus an assertion failure or segfault.
for ctx.Err() == nil {
j := rand.Intn(100)
locks[j].Lock()
ints[j]++
locks[j].Unlock()
}
}()
time.Sleep(time.Millisecond)
}
}
5 changes: 5 additions & 0 deletions misc/wasm/wasm_exec.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
</head>

<body>
<!--
Add the following polyfill for Microsoft Edge 17/18 support:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/encoding.min.js"></script>
(see https://caniuse.com/#feat=textencoder)
-->
<script src="wasm_exec.js"></script>
<script>
if (!WebAssembly.instantiateStreaming) { // polyfill
Expand Down
8 changes: 6 additions & 2 deletions src/cmd/compile/internal/gc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,17 @@ func Main(archInit func(*Arch)) {
// Phase 1: const, type, and names and types of funcs.
// This will gather all the information about types
// and methods but doesn't depend on any of it.
//
// We also defer type alias declarations until phase 2
// to avoid cycles like #18640.
// TODO(gri) Remove this again once we have a fix for #25838.
defercheckwidth()

// Don't use range--typecheck can add closures to xtop.
timings.Start("fe", "typecheck", "top1")
for i := 0; i < len(xtop); i++ {
n := xtop[i]
if op := n.Op; op != ODCL && op != OAS && op != OAS2 {
if op := n.Op; op != ODCL && op != OAS && op != OAS2 && (op != ODCLTYPE || !n.Left.Name.Param.Alias) {
xtop[i] = typecheck(n, Etop)
}
}
Expand All @@ -499,7 +503,7 @@ func Main(archInit func(*Arch)) {
timings.Start("fe", "typecheck", "top2")
for i := 0; i < len(xtop); i++ {
n := xtop[i]
if op := n.Op; op == ODCL || op == OAS || op == OAS2 {
if op := n.Op; op == ODCL || op == OAS || op == OAS2 || op == ODCLTYPE && n.Left.Name.Param.Alias {
xtop[i] = typecheck(n, Etop)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/subr.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ func calcHasCall(n *Node) bool {

// When using soft-float, these ops might be rewritten to function calls
// so we ensure they are evaluated first.
case OADD, OSUB, OMINUS:
case OADD, OSUB, OMINUS, OMUL:
if thearch.SoftFloat && (isFloat[n.Type.Etype] || isComplex[n.Type.Etype]) {
return true
}
Expand Down
26 changes: 22 additions & 4 deletions src/cmd/compile/internal/gc/typecheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,16 @@ func typecheck(n *Node, top int) *Node {
// since it would expand indefinitely when aliases
// are substituted.
cycle := cycleFor(n)
for _, n := range cycle {
if n.Name != nil && !n.Name.Param.Alias {
for _, n1 := range cycle {
if n1.Name != nil && !n1.Name.Param.Alias {
// Cycle is ok. But if n is an alias type and doesn't
// have a type yet, we have a recursive type declaration
// with aliases that we can't handle properly yet.
// Report an error rather than crashing later.
if n.Name != nil && n.Name.Param.Alias && n.Type == nil {
lineno = n.Pos
Fatalf("cannot handle alias type declaration (issue #25838): %v", n)
}
lineno = lno
return n
}
Expand Down Expand Up @@ -1263,7 +1271,7 @@ func typecheck1(n *Node, top int) *Node {
n.Op = OCALLFUNC
if t.Etype != TFUNC {
name := l.String()
if isBuiltinFuncName(name) {
if isBuiltinFuncName(name) && l.Name.Defn != nil {
// be more specific when the function
// name matches a predeclared function
yyerror("cannot call non-function %s (type %v), declared at %s",
Expand Down Expand Up @@ -3987,6 +3995,12 @@ func deadcode(fn *Node) {
}

func deadcodeslice(nn Nodes) {
var lastLabel = -1
for i, n := range nn.Slice() {
if n != nil && n.Op == OLABEL {
lastLabel = i
}
}
for i, n := range nn.Slice() {
// Cut is set to true when all nodes after i'th position
// should be removed.
Expand All @@ -4009,10 +4023,14 @@ func deadcodeslice(nn Nodes) {
// If "then" or "else" branch ends with panic or return statement,
// it is safe to remove all statements after this node.
// isterminating is not used to avoid goto-related complications.
// We must be careful not to deadcode-remove labels, as they
// might be the target of a goto. See issue 28616.
if body := body.Slice(); len(body) != 0 {
switch body[(len(body) - 1)].Op {
case ORETURN, ORETJMP, OPANIC:
cut = true
if i > lastLabel {
cut = true
}
}
}
}
Expand Down
72 changes: 36 additions & 36 deletions src/cmd/compile/internal/ssa/gen/generic.rules
Original file line number Diff line number Diff line change
Expand Up @@ -1539,21 +1539,21 @@
// Don't Move from memory if the values are likely to already be
// in registers.
(Move {t1} [n] dst p1
mem:(Store {t2} op2:(OffPtr [o2] p2) d1
(Store {t3} op3:(OffPtr [0] p3) d2 _)))
mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1
(Store {t3} op3:(OffPtr <tt3> [0] p3) d2 _)))
&& isSamePtr(p1, p2) && isSamePtr(p2, p3)
&& alignof(t2) <= alignof(t1)
&& alignof(t3) <= alignof(t1)
&& registerizable(b, t2)
&& registerizable(b, t3)
&& o2 == sizeof(t3)
&& n == sizeof(t2) + sizeof(t3)
-> (Store {t2} (OffPtr <t2.(*types.Type)> [o2] dst) d1
(Store {t3} (OffPtr <t3.(*types.Type)> [0] dst) d2 mem))
-> (Store {t2} (OffPtr <tt2> [o2] dst) d1
(Store {t3} (OffPtr <tt3> [0] dst) d2 mem))
(Move {t1} [n] dst p1
mem:(Store {t2} op2:(OffPtr [o2] p2) d1
(Store {t3} op3:(OffPtr [o3] p3) d2
(Store {t4} op4:(OffPtr [0] p4) d3 _))))
mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1
(Store {t3} op3:(OffPtr <tt3> [o3] p3) d2
(Store {t4} op4:(OffPtr <tt4> [0] p4) d3 _))))
&& isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4)
&& alignof(t2) <= alignof(t1)
&& alignof(t3) <= alignof(t1)
Expand All @@ -1564,14 +1564,14 @@
&& o3 == sizeof(t4)
&& o2-o3 == sizeof(t3)
&& n == sizeof(t2) + sizeof(t3) + sizeof(t4)
-> (Store {t2} (OffPtr <t2.(*types.Type)> [o2] dst) d1
(Store {t3} (OffPtr <t3.(*types.Type)> [o3] dst) d2
(Store {t4} (OffPtr <t4.(*types.Type)> [0] dst) d3 mem)))
-> (Store {t2} (OffPtr <tt2> [o2] dst) d1
(Store {t3} (OffPtr <tt3> [o3] dst) d2
(Store {t4} (OffPtr <tt4> [0] dst) d3 mem)))
(Move {t1} [n] dst p1
mem:(Store {t2} op2:(OffPtr [o2] p2) d1
(Store {t3} op3:(OffPtr [o3] p3) d2
(Store {t4} op4:(OffPtr [o4] p4) d3
(Store {t5} op5:(OffPtr [0] p5) d4 _)))))
mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1
(Store {t3} op3:(OffPtr <tt3> [o3] p3) d2
(Store {t4} op4:(OffPtr <tt4> [o4] p4) d3
(Store {t5} op5:(OffPtr <tt5> [0] p5) d4 _)))))
&& isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5)
&& alignof(t2) <= alignof(t1)
&& alignof(t3) <= alignof(t1)
Expand All @@ -1585,30 +1585,30 @@
&& o3-o4 == sizeof(t4)
&& o2-o3 == sizeof(t3)
&& n == sizeof(t2) + sizeof(t3) + sizeof(t4) + sizeof(t5)
-> (Store {t2} (OffPtr <t2.(*types.Type)> [o2] dst) d1
(Store {t3} (OffPtr <t3.(*types.Type)> [o3] dst) d2
(Store {t4} (OffPtr <t4.(*types.Type)> [o4] dst) d3
(Store {t5} (OffPtr <t5.(*types.Type)> [0] dst) d4 mem))))
-> (Store {t2} (OffPtr <tt2> [o2] dst) d1
(Store {t3} (OffPtr <tt3> [o3] dst) d2
(Store {t4} (OffPtr <tt4> [o4] dst) d3
(Store {t5} (OffPtr <tt5> [0] dst) d4 mem))))

// Same thing but with VarDef in the middle.
(Move {t1} [n] dst p1
mem:(VarDef
(Store {t2} op2:(OffPtr [o2] p2) d1
(Store {t3} op3:(OffPtr [0] p3) d2 _))))
(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1
(Store {t3} op3:(OffPtr <tt3> [0] p3) d2 _))))
&& isSamePtr(p1, p2) && isSamePtr(p2, p3)
&& alignof(t2) <= alignof(t1)
&& alignof(t3) <= alignof(t1)
&& registerizable(b, t2)
&& registerizable(b, t3)
&& o2 == sizeof(t3)
&& n == sizeof(t2) + sizeof(t3)
-> (Store {t2} (OffPtr <t2.(*types.Type)> [o2] dst) d1
(Store {t3} (OffPtr <t3.(*types.Type)> [0] dst) d2 mem))
-> (Store {t2} (OffPtr <tt2> [o2] dst) d1
(Store {t3} (OffPtr <tt3> [0] dst) d2 mem))
(Move {t1} [n] dst p1
mem:(VarDef
(Store {t2} op2:(OffPtr [o2] p2) d1
(Store {t3} op3:(OffPtr [o3] p3) d2
(Store {t4} op4:(OffPtr [0] p4) d3 _)))))
(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1
(Store {t3} op3:(OffPtr <tt3> [o3] p3) d2
(Store {t4} op4:(OffPtr <tt4> [0] p4) d3 _)))))
&& isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4)
&& alignof(t2) <= alignof(t1)
&& alignof(t3) <= alignof(t1)
Expand All @@ -1619,15 +1619,15 @@
&& o3 == sizeof(t4)
&& o2-o3 == sizeof(t3)
&& n == sizeof(t2) + sizeof(t3) + sizeof(t4)
-> (Store {t2} (OffPtr <t2.(*types.Type)> [o2] dst) d1
(Store {t3} (OffPtr <t3.(*types.Type)> [o3] dst) d2
(Store {t4} (OffPtr <t4.(*types.Type)> [0] dst) d3 mem)))
-> (Store {t2} (OffPtr <tt2> [o2] dst) d1
(Store {t3} (OffPtr <tt3> [o3] dst) d2
(Store {t4} (OffPtr <tt4> [0] dst) d3 mem)))
(Move {t1} [n] dst p1
mem:(VarDef
(Store {t2} op2:(OffPtr [o2] p2) d1
(Store {t3} op3:(OffPtr [o3] p3) d2
(Store {t4} op4:(OffPtr [o4] p4) d3
(Store {t5} op5:(OffPtr [0] p5) d4 _))))))
(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1
(Store {t3} op3:(OffPtr <tt3> [o3] p3) d2
(Store {t4} op4:(OffPtr <tt4> [o4] p4) d3
(Store {t5} op5:(OffPtr <tt5> [0] p5) d4 _))))))
&& isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5)
&& alignof(t2) <= alignof(t1)
&& alignof(t3) <= alignof(t1)
Expand All @@ -1641,10 +1641,10 @@
&& o3-o4 == sizeof(t4)
&& o2-o3 == sizeof(t3)
&& n == sizeof(t2) + sizeof(t3) + sizeof(t4) + sizeof(t5)
-> (Store {t2} (OffPtr <t2.(*types.Type)> [o2] dst) d1
(Store {t3} (OffPtr <t3.(*types.Type)> [o3] dst) d2
(Store {t4} (OffPtr <t4.(*types.Type)> [o4] dst) d3
(Store {t5} (OffPtr <t5.(*types.Type)> [0] dst) d4 mem))))
-> (Store {t2} (OffPtr <tt2> [o2] dst) d1
(Store {t3} (OffPtr <tt3> [o3] dst) d2
(Store {t4} (OffPtr <tt4> [o4] dst) d3
(Store {t5} (OffPtr <tt5> [0] dst) d4 mem))))

// Prefer to Zero and Store than to Move.
(Move {t1} [n] dst p1
Expand Down
Loading