[Pkg-golang-commits] [golang] 01/04: Imported Upstream version 1.7~rc3

Michael Hudson-Doyle mwhudson-guest at moszumanska.debian.org
Thu Jul 21 22:23:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

mwhudson-guest pushed a commit to branch golang-1.7
in repository golang.

commit e77459e300a9610a3da46e4dea74bc726d1a84f0
Author: Michael Hudson-Doyle <michael.hudson at canonical.com>
Date:   Fri Jul 22 10:01:00 2016 +1200

    Imported Upstream version 1.7~rc3
---
 VERSION                                            |   2 +-
 doc/devel/release.html                             |   8 ++
 doc/effective_go.html                              |  14 ++-
 doc/go1.7.html                                     |  43 ++++++++-
 misc/trace/trace_viewer_lean.html                  |   2 +-
 src/cmd/api/goapi.go                               |   2 +-
 .../internal/gc/sparselocatephifunctions.go        |   5 +-
 src/cmd/compile/internal/ssa/compile.go            |   1 +
 src/cmd/compile/internal/ssa/sparsetreemap.go      | 104 ++++++++++++---------
 src/cmd/compile/internal/ssa/tighten.go            |  23 +++++
 src/cmd/go/build.go                                |  10 +-
 src/cmd/gofmt/gofmt.go                             |   1 -
 src/fmt/scan.go                                    |   6 +-
 src/fmt/scan_test.go                               | 101 +++++++++-----------
 src/go/build/build_test.go                         |   8 +-
 src/go/build/deps_test.go                          |   8 +-
 src/math/rand/race_test.go                         |  47 ++++++++++
 src/math/rand/rand.go                              |  42 ++++++++-
 src/net/dial_test.go                               |   5 +
 src/net/http/h2_bundle.go                          |   4 +-
 src/net/http/http.go                               |   2 +-
 src/net/http/server.go                             |   7 +-
 src/net/http/transfer.go                           |   2 +-
 src/net/http/transport.go                          |   2 +-
 src/net/interface_bsd.go                           |   2 +-
 src/net/interface_bsdvar.go                        |   2 +-
 src/net/interface_darwin.go                        |   2 +-
 src/net/interface_freebsd.go                       |   2 +-
 src/net/smtp/smtp.go                               |   5 +
 src/reflect/all_test.go                            |   2 +
 src/reflect/type.go                                |   3 +
 src/runtime/cgocall.go                             |   5 +-
 src/runtime/internal/atomic/asm_386.s              |   6 +-
 src/runtime/internal/atomic/asm_amd64.s            |   2 +-
 src/runtime/internal/atomic/asm_amd64p32.s         |   4 +-
 src/runtime/internal/atomic/asm_arm.s              |   6 +-
 src/runtime/internal/atomic/asm_arm64.s            |   4 +-
 src/runtime/internal/atomic/asm_ppc64x.s           |   2 +-
 src/runtime/mbarrier.go                            |   4 +-
 src/runtime/mem_linux.go                           |  22 +++--
 src/runtime/mfinal.go                              |   2 +-
 src/runtime/mheap.go                               |   5 +
 src/runtime/os_nacl.go                             |   2 +-
 src/runtime/pprof/pprof.go                         |   5 +-
 src/runtime/pprof/pprof_test.go                    |   4 +
 src/runtime/proc.go                                |  28 +++++-
 src/runtime/race/README                            |   2 +-
 src/runtime/race/race_darwin_amd64.syso            | Bin 341304 -> 326172 bytes
 src/runtime/race/race_freebsd_amd64.syso           | Bin 399904 -> 404216 bytes
 src/runtime/race/race_linux_amd64.syso             | Bin 371032 -> 376048 bytes
 src/runtime/race/race_test.go                      |  18 ++++
 src/runtime/race/race_windows_amd64.syso           | Bin 363595 -> 367717 bytes
 src/runtime/signal1_unix.go                        |   2 +-
 src/runtime/signal_darwin.go                       |   4 +-
 src/runtime/signal_freebsd.go                      |   4 +-
 src/runtime/signal_openbsd.go                      |   4 +-
 src/runtime/signal_sigtramp.go                     |   4 +-
 src/runtime/stubs.go                               |   4 +-
 src/runtime/sys_darwin_amd64.s                     |   1 +
 src/syscall/exec_linux_test.go                     |   1 +
 .../x/net/http2/hpack/encode.go                    |   0
 .../x/net/http2/hpack/encode_test.go               |   0
 .../x/net/http2/hpack/hpack.go                     |   0
 .../x/net/http2/hpack/hpack_test.go                |   0
 .../x/net/http2/hpack/huffman.go                   |   0
 .../x/net/http2/hpack/tables.go                    |   0
 .../x/net/lex/httplex/httplex.go                   |   0
 .../x/net/lex/httplex/httplex_test.go              |   0
 .../x/net/route/address.go                         |   0
 .../x/net/route/address_darwin_test.go             |   0
 .../x/net/route/address_test.go                    |   0
 .../x/net/route/binary.go                          |   0
 .../x/net/route/defs_darwin.go                     |   0
 .../x/net/route/defs_dragonfly.go                  |   0
 .../x/net/route/defs_freebsd.go                    |   0
 .../x/net/route/defs_netbsd.go                     |   0
 .../x/net/route/defs_openbsd.go                    |   0
 .../x/net/route/interface.go                       |   0
 .../x/net/route/interface_announce.go              |   0
 .../x/net/route/interface_classic.go               |   0
 .../x/net/route/interface_freebsd.go               |   0
 .../x/net/route/interface_multicast.go             |   0
 .../x/net/route/interface_openbsd.go               |   0
 .../x/net/route/message.go                         |   0
 .../x/net/route/message_darwin_test.go             |   0
 .../x/net/route/message_freebsd_test.go            |   0
 .../x/net/route/message_test.go                    |   0
 .../x/net/route/route.go                           |   0
 .../x/net/route/route_classic.go                   |   0
 .../x/net/route/route_openbsd.go                   |   0
 .../x/net/route/route_test.go                      |   0
 .../{golang.org => golang_org}/x/net/route/sys.go  |   0
 .../x/net/route/sys_darwin.go                      |   0
 .../x/net/route/sys_dragonfly.go                   |   0
 .../x/net/route/sys_freebsd.go                     |   0
 .../x/net/route/sys_netbsd.go                      |   0
 .../x/net/route/sys_openbsd.go                     |   0
 .../x/net/route/syscall.go                         |   0
 .../x/net/route/syscall.s                          |   0
 .../x/net/route/zsys_darwin.go                     |   0
 .../x/net/route/zsys_dragonfly.go                  |   0
 .../x/net/route/zsys_freebsd_386.go                |   0
 .../x/net/route/zsys_freebsd_amd64.go              |   0
 .../x/net/route/zsys_freebsd_arm.go                |   0
 .../x/net/route/zsys_netbsd.go                     |   0
 .../x/net/route/zsys_openbsd.go                    |   0
 106 files changed, 420 insertions(+), 192 deletions(-)

diff --git a/VERSION b/VERSION
index 240b370..e95a35a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-go1.7rc2
\ No newline at end of file
+go1.7rc3
\ No newline at end of file
diff --git a/doc/devel/release.html b/doc/devel/release.html
index 97c4133..fcb8c19 100644
--- a/doc/devel/release.html
+++ b/doc/devel/release.html
@@ -53,6 +53,14 @@ See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.2">Go
 1.6.2 milestone</a> on our issue tracker for details.
 </p>
 
+<p>
+go1.6.3 (released 2016/07/17) includes security fixes to the
+<code>net/http/cgi</code> package and <code>net/http</code> package when used in
+a CGI environment. This release also adds support for macOS Sierra.
+See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.3">Go
+1.6.3 milestone</a> on our issue tracker for details.
+</p>
+
 <h2 id="go1.5">go1.5 (released 2015/08/19)</h2>
 
 <p>
diff --git a/doc/effective_go.html b/doc/effective_go.html
index 1e66c0c..f6fe48c 100644
--- a/doc/effective_go.html
+++ b/doc/effective_go.html
@@ -2238,13 +2238,12 @@ if str, ok := value.(string); ok {
 
 <h3 id="generality">Generality</h3>
 <p>
-If a type exists only to implement an interface
-and has no exported methods beyond that interface,
-there is no need to export the type itself.
-Exporting just the interface makes it clear that
-it's the behavior that matters, not the implementation,
-and that other implementations with different properties
-can mirror the behavior of the original type.
+If a type exists only to implement an interface and will
+never have exported methods beyond that interface, there is
+no need to export the type itself.
+Exporting just the interface makes it clear the value has no
+interesting behavior beyond what is described in the
+interface.
 It also avoids the need to repeat the documentation
 on every instance of a common method.
 </p>
@@ -3665,4 +3664,3 @@ var _ image.Color = Black
 var _ image.Image = Black
 </pre>
 -->
-
diff --git a/doc/go1.7.html b/doc/go1.7.html
index a460754..cf5d8a4 100644
--- a/doc/go1.7.html
+++ b/doc/go1.7.html
@@ -75,6 +75,13 @@ This change has no effect on the correctness of existing programs.
 <h2 id="ports">Ports</h2>
 
 <p>
+Go 1.7 adds support for macOS 10.12 Sierra.
+This support was backported to Go 1.6.3.
+Binaries built with versions of Go before 1.6.3 will not work
+correctly on Sierra.
+</p>
+
+<p>
 Go 1.7 adds an experimental port to <a href="https://en.wikipedia.org/wiki/Linux_on_z_Systems">Linux on z Systems</a> (<code>linux/s390x</code>)
 and the beginning of a port to Plan 9 on ARM (<code>plan9/arm</code>).
 </p>
@@ -85,8 +92,10 @@ added in Go 1.6 now have full support for cgo and external linking.
 </p>
 
 <p>
-The experimental port to Linux on big-endian 64-bit PowerPC (<code>linux/ppc64</code>)
+The experimental port to Linux on little-endian 64-bit PowerPC (<code>linux/ppc64le</code>)
 now requires the POWER8 architecture or later.
+Big-endian 64-bit PowerPC (<code>linux/ppc64</code>) only requires the
+POWER5 architecture.
 </p>
 
 <p>
@@ -367,6 +376,12 @@ and
 packages.
 </p>
 
+<p>
+Garbage collection pauses should be significantly shorter than they
+were in Go 1.6 for programs with large numbers of idle goroutines,
+substantial stack size fluctuation, or large package-level variables.
+</p>
+
 <h2 id="library">Core library</h2>
 
 <h3 id="context">Context</h3>
@@ -463,6 +478,13 @@ common in some environments.
 </p>
 
 <p>
+The runtime can now return unused memory to the operating system on
+all architectures.
+In Go 1.6 and earlier, the runtime could not
+release memory on ARM64, 64-bit PowerPC, or MIPS.
+</p>
+
+<p>
 On Windows, Go programs in Go 1.5 and earlier forced
 the global Windows timer resolution to 1ms at startup
 by calling <code>timeBeginPeriod(1)</code>.
@@ -793,6 +815,16 @@ The
 now produce a pseudo-random stream of bytes that is consistent and not
 dependent on the size of the input buffer.
 </p>
+
+<p>
+The documentation clarifies that
+Rand's <a href="/pkg/math/rand/#Rand.Seed"><code>Seed</code></a>
+and <a href="/pkg/math/rand/#Rand.Read"><code>Read</code></a> methods
+are not safe to call concurrently, though the global
+functions <a href="/pkg/math/rand/#Seed"><code>Seed</code></a>
+and <a href="/pkg/math/rand/#Read"><code>Read</code></a> are (and have
+always been) safe.
+</p>
 </dd>
 </dl>
 
@@ -887,6 +919,13 @@ is set explicitly, following <a href="https://tools.ietf.org/html/rfc7230#sectio
 </p>
 
 <p>
+The server implementation is now stricter about rejecting requests with invalid HTTP versions.
+Invalid requests claiming to be HTTP/0.x are now rejected (HTTP/0.9 was never fully supported),
+and plaintext HTTP/2 requests other than the "PRI * HTTP/2.0" upgrade request are now rejected as well.
+The server continues to handle encrypted HTTP/2 requests.
+</p>
+
+<p>
 In the server, a 200 status code is sent back by the timeout handler on an empty
 response body, instead of sending back 0 as the status code.
 </p>
@@ -1062,7 +1101,7 @@ from URLs with empty query strings (like <code>/search?</code>).
 
 <dd>
 <p>
-<a href="/pkg/os/#IsExists"><code>IsExists</code></a> now returns true for <code>syscall.ENOTEMPTY</code>,
+<a href="/pkg/os/#IsExist"><code>IsExist</code></a> now returns true for <code>syscall.ENOTEMPTY</code>,
 on systems where that error exists.
 </p>
 
diff --git a/misc/trace/trace_viewer_lean.html b/misc/trace/trace_viewer_lean.html
index 7939aae..076cb43 100644
--- a/misc/trace/trace_viewer_lean.html
+++ b/misc/trace/trace_viewer_lean.html
@@ -5281,7 +5281,7 @@ if(traces.length&&!this.hasEventDataDecoder_(importers)){throw new Error('Could
 importers.sort(function(x,y){return x.importPriority-y.importPriority;});},this);lastTask=lastTask.timedAfter('TraceImport',function importClockSyncMarkers(task){importers.forEach(function(importer,index){task.subTask(Timing.wrapNamedFunction('TraceImport',importer.importerName,function runImportClockSyncMarkersOnOneImporter(){progressMeter.update('Importing clock sync markers '+(index+1)+' of '+
 importers.length);importer.importClockSyncMarkers();}),this);},this);},this);lastTask=lastTask.timedAfter('TraceImport',function runImport(task){importers.forEach(function(importer,index){task.subTask(Timing.wrapNamedFunction('TraceImport',importer.importerName,function runImportEventsOnOneImporter(){progressMeter.update('Importing '+(index+1)+' of '+importers.length);importer.importEvents();}),this);},this);},this);if(this.importOptions_.customizeModelCallback){lastTask=lastTask.timedAf [...]
 lastTask=lastTask.timedAfter('TraceImport',function importSampleData(task){importers.forEach(function(importer,index){progressMeter.update('Importing sample data '+(index+1)+'/'+importers.length);importer.importSampleData();},this);},this);lastTask=lastTask.timedAfter('TraceImport',function runAutoclosers(){progressMeter.update('Autoclosing open slices...');this.model_.autoCloseOpenSlices();this.model_.createSubSlices();},this);lastTask=lastTask.timedAfter('TraceImport',function finalize [...]
-lastTask=lastTask.timedAfter('TraceImport',function runMergeKernelWithuserland(){progressMeter.update('Merging kernel with userland...');this.model_.mergeKernelWithUserland();},this);var auditors=[];lastTask=lastTask.timedAfter('TraceImport',function createAuditorsAndRunAnnotate(){progressMeter.update('Adding arbitrary data to model...');auditors=this.importOptions_.auditorConstructors.map(function(auditorConstructor){return new auditorConstructor(this.model_);},this);auditors.forEach(fu [...]
+lastTask=lastTask.timedAfter('TraceImport',function runMergeKernelWithuserland(){progressMeter.update('Merging kernel with userland...');this.model_.mergeKernelWithUserland();},this);var auditors=[];lastTask=lastTask.timedAfter('TraceImport',function createAuditorsAndRunAnnotate(){progressMeter.update('Adding arbitrary data to model...');auditors=this.importOptions_.auditorConstructors.map(function(auditorConstructor){return new auditorConstructor(this.model_);},this);auditors.forEach(fu [...]
 return new importerConstructor(this.model_,eventData);},hasEventDataDecoder_:function(importers){for(var i=0;i<importers.length;++i){if(!importers[i].isTraceDataContainer())
 return true;}
 return false;}};return{ImportOptions:ImportOptions,Import:Import};});'use strict';tr.exportTo('tr.e.cc',function(){function PictureAsImageData(picture,errorOrImageData){this.picture_=picture;if(errorOrImageData instanceof ImageData){this.error_=undefined;this.imageData_=errorOrImageData;}else{this.error_=errorOrImageData;this.imageData_=undefined;}};PictureAsImageData.Pending=function(picture){return new PictureAsImageData(picture,undefined);};PictureAsImageData.prototype={get picture(){ [...]
diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go
index e9c9147..936f9e5 100644
--- a/src/cmd/api/goapi.go
+++ b/src/cmd/api/goapi.go
@@ -425,7 +425,7 @@ func (w *Walker) Import(name string) (*types.Package, error) {
 	w.imported[name] = &importing
 
 	root := w.root
-	if strings.HasPrefix(name, "golang.org/x/") {
+	if strings.HasPrefix(name, "golang_org/x/") {
 		root = filepath.Join(root, "vendor")
 	}
 
diff --git a/src/cmd/compile/internal/gc/sparselocatephifunctions.go b/src/cmd/compile/internal/gc/sparselocatephifunctions.go
index e15f221..43cc50b 100644
--- a/src/cmd/compile/internal/gc/sparselocatephifunctions.go
+++ b/src/cmd/compile/internal/gc/sparselocatephifunctions.go
@@ -153,10 +153,13 @@ func (s *state) locatePotentialPhiFunctions(fn *Node) *sparseDefState {
 					p := e.Block()
 					dm.Use(t, p)                                // always count phi pred as "use"; no-op except for loop edges, which matter.
 					x := t.stm.Find(p, ssa.AdjustAfter, helper) // Look for defs reaching or within predecessors.
+					if x == nil {                               // nil def from a predecessor means a backedge that will be visited soon.
+						continue
+					}
 					if defseen == nil {
 						defseen = x
 					}
-					if defseen != x || x == nil { // TODO: too conservative at loops, does better if x == nil -> continue
+					if defseen != x {
 						// Need to insert a phi function here because predecessors's definitions differ.
 						change = true
 						// Phi insertion is at AdjustBefore, visible with find in same block at AdjustWithin or AdjustAfter.
diff --git a/src/cmd/compile/internal/ssa/compile.go b/src/cmd/compile/internal/ssa/compile.go
index b3c7544..d8b0b0a 100644
--- a/src/cmd/compile/internal/ssa/compile.go
+++ b/src/cmd/compile/internal/ssa/compile.go
@@ -270,6 +270,7 @@ var passes = [...]pass{
 	{name: "checkLower", fn: checkLower, required: true},
 	{name: "late phielim", fn: phielim},
 	{name: "late copyelim", fn: copyelim},
+	{name: "phi tighten", fn: phiTighten},
 	{name: "late deadcode", fn: deadcode},
 	{name: "critical", fn: critical, required: true}, // remove critical edges
 	{name: "likelyadjust", fn: likelyadjust},
diff --git a/src/cmd/compile/internal/ssa/sparsetreemap.go b/src/cmd/compile/internal/ssa/sparsetreemap.go
index 6127698..3e6f296 100644
--- a/src/cmd/compile/internal/ssa/sparsetreemap.go
+++ b/src/cmd/compile/internal/ssa/sparsetreemap.go
@@ -14,8 +14,8 @@ import "fmt"
 // the nearest tree ancestor of a given node such that the
 // ancestor is also in the set.
 //
-// Given a set of blocks {B1, B2, B3} within the dominator tree, established by
-// stm.Insert()ing B1, B2, B3, etc, a query at block B
+// Given a set of blocks {B1, B2, B3} within the dominator tree, established
+// by stm.Insert()ing B1, B2, B3, etc, a query at block B
 // (performed with stm.Find(stm, B, adjust, helper))
 // will return the member of the set that is the nearest strict
 // ancestor of B within the dominator tree, or nil if none exists.
@@ -49,9 +49,9 @@ type SparseTreeMap RBTint32
 // packages, such as gc.
 type SparseTreeHelper struct {
 	Sdom   []SparseTreeNode // indexed by block.ID
-	Po     []*Block         // exported data
-	Dom    []*Block         // exported data
-	Ponums []int32          // exported data
+	Po     []*Block         // exported data; the blocks, in a post-order
+	Dom    []*Block         // exported data; the dominator of this block.
+	Ponums []int32          // exported data; Po[Ponums[b.ID]] == b; the index of b in Po
 }
 
 // NewSparseTreeHelper returns a SparseTreeHelper for use
@@ -79,11 +79,19 @@ func makeSparseTreeHelper(sdom SparseTree, dom, po []*Block, ponums []int32) *Sp
 // A sparseTreeMapEntry contains the data stored in a binary search
 // data structure indexed by (dominator tree walk) entry and exit numbers.
 // Each entry is added twice, once keyed by entry-1/entry/entry+1 and
-// once keyed by exit+1/exit/exit-1. (there are three choices of paired indices, not 9, and they properly nest)
+// once keyed by exit+1/exit/exit-1.
+//
+// Within a sparse tree, the two entries added bracket all their descendant
+// entries within the tree; the first insertion is keyed by entry number,
+// which comes before all the entry and exit numbers of descendants, and
+// the second insertion is keyed by exit number, which comes after all the
+// entry and exit numbers of the descendants.
 type sparseTreeMapEntry struct {
-	index *SparseTreeNode
-	block *Block // TODO: store this in a separate index.
-	data  interface{}
+	index        *SparseTreeNode // references the entry and exit numbers for a block in the sparse tree
+	block        *Block          // TODO: store this in a separate index.
+	data         interface{}
+	sparseParent *sparseTreeMapEntry // references the nearest ancestor of this block in the sparse tree.
+	adjust       int32               // at what adjustment was this node entered into the sparse tree? The same block may be entered more than once, but at different adjustments.
 }
 
 // Insert creates a definition within b with data x.
@@ -98,12 +106,25 @@ func (m *SparseTreeMap) Insert(b *Block, adjust int32, x interface{}, helper *Sp
 		// assert unreachable
 		return
 	}
-	entry := &sparseTreeMapEntry{index: blockIndex, data: x}
+	// sp will be the sparse parent in this sparse tree (nearest ancestor in the larger tree that is also in this sparse tree)
+	sp := m.findEntry(b, adjust, helper)
+	entry := &sparseTreeMapEntry{index: blockIndex, block: b, data: x, sparseParent: sp, adjust: adjust}
+
 	right := blockIndex.exit - adjust
 	_ = rbtree.Insert(right, entry)
 
 	left := blockIndex.entry + adjust
 	_ = rbtree.Insert(left, entry)
+
+	// This newly inserted block may now be the sparse parent of some existing nodes (the new sparse children of this block)
+	// Iterate over nodes bracketed by this new node to correct their parent, but not over the proper sparse descendants of those nodes.
+	_, d := rbtree.Lub(left) // Lub (not EQ) of left is either right or a sparse child
+	for tme := d.(*sparseTreeMapEntry); tme != entry; tme = d.(*sparseTreeMapEntry) {
+		tme.sparseParent = entry
+		// all descendants of tme are unchanged;
+		// next sparse sibling (or right-bracketing sparse parent == entry) is first node after tme.index.exit - tme.adjust
+		_, d = rbtree.Lub(tme.index.exit - tme.adjust)
+	}
 }
 
 // Find returns the definition visible from block b, or nil if none can be found.
@@ -118,45 +139,41 @@ func (m *SparseTreeMap) Insert(b *Block, adjust int32, x interface{}, helper *Sp
 //
 // Another way to think of this is that Find searches for inputs, Insert defines outputs.
 func (m *SparseTreeMap) Find(b *Block, adjust int32, helper *SparseTreeHelper) interface{} {
+	v := m.findEntry(b, adjust, helper)
+	if v == nil {
+		return nil
+	}
+	return v.data
+}
+
+func (m *SparseTreeMap) findEntry(b *Block, adjust int32, helper *SparseTreeHelper) *sparseTreeMapEntry {
 	rbtree := (*RBTint32)(m)
 	if rbtree == nil {
 		return nil
 	}
 	blockIndex := &helper.Sdom[b.ID]
+
+	// The Glb (not EQ) of this probe is either the entry-indexed end of a sparse parent
+	// or the exit-indexed end of a sparse sibling
 	_, v := rbtree.Glb(blockIndex.entry + adjust)
-	for v != nil {
-		otherEntry := v.(*sparseTreeMapEntry)
-		otherIndex := otherEntry.index
-		// Two cases -- either otherIndex brackets blockIndex,
-		// or it doesn't.
-		//
-		// Note that if otherIndex and blockIndex are
-		// the same block, then the glb test only passed
-		// because the definition is "before",
-		// i.e., k == blockIndex.entry-1
-		// allowing equality is okay on the blocks check.
-		if otherIndex.exit >= blockIndex.exit {
-			// bracketed.
-			return otherEntry.data
+
+	if v == nil {
+		return nil
+	}
+
+	otherEntry := v.(*sparseTreeMapEntry)
+	if otherEntry.index.exit >= blockIndex.exit { // otherEntry exit after blockIndex exit; therefore, brackets
+		return otherEntry
+	}
+	// otherEntry is a sparse Sibling, and shares the same sparse parent (nearest ancestor within larger tree)
+	sp := otherEntry.sparseParent
+	if sp != nil {
+		if sp.index.exit < blockIndex.exit { // no ancestor found
+			return nil
 		}
-		// In the not-bracketed case, we could memoize the results of
-		// walking up the tree, but for now we won't.
-		// Memoize plan is to take the gap (inclusive)
-		// from otherIndex.exit+1 to blockIndex.entry-1
-		// and insert it into this or a second tree.
-		// Said tree would then need adjusting whenever
-		// an insertion occurred.
-
-		// Expectation is that per-variable tree is sparse,
-		// therefore probe siblings instead of climbing up.
-		// Note that each sibling encountered in this walk
-		// to find a defining ancestor shares that ancestor
-		// because the walk skips over the interior -- each
-		// Glb will be an exit, and the iteration is to the
-		// Glb of the entry.
-		_, v = rbtree.Glb(otherIndex.entry - 1)
+		return sp
 	}
-	return nil // nothing found
+	return nil
 }
 
 func (m *SparseTreeMap) String() string {
@@ -165,5 +182,8 @@ func (m *SparseTreeMap) String() string {
 }
 
 func (e *sparseTreeMapEntry) String() string {
-	return fmt.Sprintf("index=%v, data=%v", e.index, e.data)
+	if e == nil {
+		return "nil"
+	}
+	return fmt.Sprintf("(index=%v, block=%v, data=%v)->%v", e.index, e.block, e.data, e.sparseParent)
 }
diff --git a/src/cmd/compile/internal/ssa/tighten.go b/src/cmd/compile/internal/ssa/tighten.go
index ecb43c1..2f7c309 100644
--- a/src/cmd/compile/internal/ssa/tighten.go
+++ b/src/cmd/compile/internal/ssa/tighten.go
@@ -86,3 +86,26 @@ func tighten(f *Func) {
 		}
 	}
 }
+
+// phiTighten moves constants closer to phi users.
+// This pass avoids having lots of constants live for lots of the program.
+// See issue 16407.
+func phiTighten(f *Func) {
+	for _, b := range f.Blocks {
+		for _, v := range b.Values {
+			if v.Op != OpPhi {
+				continue
+			}
+			for i, a := range v.Args {
+				if !a.rematerializeable() {
+					continue // not a constant we can move around
+				}
+				if a.Block == b.Preds[i].b {
+					continue // already in the right place
+				}
+				// Make a copy of a, put in predecessor block.
+				v.SetArg(i, a.copyInto(b.Preds[i].b))
+			}
+		}
+	}
+}
diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go
index 11a4eab..3c0b994 100644
--- a/src/cmd/go/build.go
+++ b/src/cmd/go/build.go
@@ -673,11 +673,6 @@ func init() {
 	goarch = buildContext.GOARCH
 	goos = buildContext.GOOS
 
-	if _, ok := osArchSupportsCgo[goos+"/"+goarch]; !ok {
-		fmt.Fprintf(os.Stderr, "cmd/go: unsupported GOOS/GOARCH pair %s/%s\n", goos, goarch)
-		os.Exit(2)
-	}
-
 	if goos == "windows" {
 		exeSuffix = ".exe"
 	}
@@ -1226,6 +1221,11 @@ func allArchiveActions(root *action) []*action {
 
 // do runs the action graph rooted at root.
 func (b *builder) do(root *action) {
+	if _, ok := osArchSupportsCgo[goos+"/"+goarch]; !ok && buildContext.Compiler == "gc" {
+		fmt.Fprintf(os.Stderr, "cmd/go: unsupported GOOS/GOARCH pair %s/%s\n", goos, goarch)
+		os.Exit(2)
+	}
+
 	// Build list of all actions, assigning depth-first post-order priority.
 	// The original implementation here was a true queue
 	// (using a channel) but it had the effect of getting
diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go
index b10b804..f29b6cb 100644
--- a/src/cmd/gofmt/gofmt.go
+++ b/src/cmd/gofmt/gofmt.go
@@ -55,7 +55,6 @@ func report(err error) {
 func usage() {
 	fmt.Fprintf(os.Stderr, "usage: gofmt [flags] [path ...]\n")
 	flag.PrintDefaults()
-	os.Exit(2)
 }
 
 func initParserMode() {
diff --git a/src/fmt/scan.go b/src/fmt/scan.go
index 08b0bf9..fdf4197 100644
--- a/src/fmt/scan.go
+++ b/src/fmt/scan.go
@@ -325,9 +325,9 @@ func (r *readRune) readByte() (b byte, err error) {
 		r.pending--
 		return
 	}
-	_, err = r.reader.Read(r.pendBuf[:1])
-	if err != nil {
-		return
+	n, err := io.ReadFull(r.reader, r.pendBuf[:1])
+	if n != 1 {
+		return 0, err
 	}
 	return r.pendBuf[0], err
 }
diff --git a/src/fmt/scan_test.go b/src/fmt/scan_test.go
index 364d4fb..e36b62e 100644
--- a/src/fmt/scan_test.go
+++ b/src/fmt/scan_test.go
@@ -15,6 +15,7 @@ import (
 	"regexp"
 	"strings"
 	"testing"
+	"testing/iotest"
 	"unicode/utf8"
 )
 
@@ -118,20 +119,6 @@ func (s *IntString) Scan(state ScanState, verb rune) error {
 
 var intStringVal IntString
 
-// myStringReader implements Read but not ReadRune, allowing us to test our readRune wrapper
-// type that creates something that can read runes given only Read().
-type myStringReader struct {
-	r *strings.Reader
-}
-
-func (s *myStringReader) Read(p []byte) (n int, err error) {
-	return s.r.Read(p)
-}
-
-func newReader(s string) *myStringReader {
-	return &myStringReader{strings.NewReader(s)}
-}
-
 var scanTests = []ScanTest{
 	// Basic types
 	{"T\n", &boolVal, true},  // boolean test vals toggle to be sure they are written
@@ -363,25 +350,38 @@ var multiTests = []ScanfMultiTest{
 	{"%v%v", "FALSE23", args(&truth, &i), args(false, 23), ""},
 }
 
-func testScan(name string, t *testing.T, scan func(r io.Reader, a ...interface{}) (int, error)) {
+var readers = []struct {
+	name string
+	f    func(string) io.Reader
+}{
+	{"StringReader", func(s string) io.Reader {
+		return strings.NewReader(s)
+	}},
+	{"ReaderOnly", func(s string) io.Reader {
+		return struct{ io.Reader }{strings.NewReader(s)}
+	}},
+	{"OneByteReader", func(s string) io.Reader {
+		return iotest.OneByteReader(strings.NewReader(s))
+	}},
+	{"DataErrReader", func(s string) io.Reader {
+		return iotest.DataErrReader(strings.NewReader(s))
+	}},
+}
+
+func testScan(t *testing.T, f func(string) io.Reader, scan func(r io.Reader, a ...interface{}) (int, error)) {
 	for _, test := range scanTests {
-		var r io.Reader
-		if name == "StringReader" {
-			r = strings.NewReader(test.text)
-		} else {
-			r = newReader(test.text)
-		}
+		r := f(test.text)
 		n, err := scan(r, test.in)
 		if err != nil {
 			m := ""
 			if n > 0 {
 				m = Sprintf(" (%d fields ok)", n)
 			}
-			t.Errorf("%s got error scanning %q: %s%s", name, test.text, err, m)
+			t.Errorf("got error scanning %q: %s%s", test.text, err, m)
 			continue
 		}
 		if n != 1 {
-			t.Errorf("%s count error on entry %q: got %d", name, test.text, n)
+			t.Errorf("count error on entry %q: got %d", test.text, n)
 			continue
 		}
 		// The incoming value may be a pointer
@@ -391,25 +391,25 @@ func testScan(name string, t *testing.T, scan func(r io.Reader, a ...interface{}
 		}
 		val := v.Interface()
 		if !reflect.DeepEqual(val, test.out) {
-			t.Errorf("%s scanning %q: expected %#v got %#v, type %T", name, test.text, test.out, val, val)
+			t.Errorf("scanning %q: expected %#v got %#v, type %T", test.text, test.out, val, val)
 		}
 	}
 }
 
 func TestScan(t *testing.T) {
-	testScan("StringReader", t, Fscan)
-}
-
-func TestMyReaderScan(t *testing.T) {
-	testScan("myStringReader", t, Fscan)
+	for _, r := range readers {
+		t.Run(r.name, func(t *testing.T) {
+			testScan(t, r.f, Fscan)
+		})
+	}
 }
 
 func TestScanln(t *testing.T) {
-	testScan("StringReader", t, Fscanln)
-}
-
-func TestMyReaderScanln(t *testing.T) {
-	testScan("myStringReader", t, Fscanln)
+	for _, r := range readers {
+		t.Run(r.name, func(t *testing.T) {
+			testScan(t, r.f, Fscanln)
+		})
+	}
 }
 
 func TestScanf(t *testing.T) {
@@ -500,15 +500,10 @@ func TestInf(t *testing.T) {
 	}
 }
 
-func testScanfMulti(name string, t *testing.T) {
+func testScanfMulti(t *testing.T, f func(string) io.Reader) {
 	sliceType := reflect.TypeOf(make([]interface{}, 1))
 	for _, test := range multiTests {
-		var r io.Reader
-		if name == "StringReader" {
-			r = strings.NewReader(test.text)
-		} else {
-			r = newReader(test.text)
-		}
+		r := f(test.text)
 		n, err := Fscanf(r, test.format, test.in...)
 		if err != nil {
 			if test.err == "" {
@@ -539,11 +534,11 @@ func testScanfMulti(name string, t *testing.T) {
 }
 
 func TestScanfMulti(t *testing.T) {
-	testScanfMulti("StringReader", t)
-}
-
-func TestMyReaderScanfMulti(t *testing.T) {
-	testScanfMulti("myStringReader", t)
+	for _, r := range readers {
+		t.Run(r.name, func(t *testing.T) {
+			testScanfMulti(t, r.f)
+		})
+	}
 }
 
 func TestScanMultiple(t *testing.T) {
@@ -818,20 +813,10 @@ func TestMultiLine(t *testing.T) {
 	}
 }
 
-// simpleReader is a strings.Reader that implements only Read, not ReadRune.
-// Good for testing readahead.
-type simpleReader struct {
-	sr *strings.Reader
-}
-
-func (s *simpleReader) Read(b []byte) (n int, err error) {
-	return s.sr.Read(b)
-}
-
 // TestLineByLineFscanf tests that Fscanf does not read past newline. Issue
 // 3481.
 func TestLineByLineFscanf(t *testing.T) {
-	r := &simpleReader{strings.NewReader("1\n2\n")}
+	r := struct{ io.Reader }{strings.NewReader("1\n2\n")}
 	var i, j int
 	n, err := Fscanf(r, "%v\n", &i)
 	if n != 1 || err != nil {
@@ -1000,7 +985,7 @@ func BenchmarkScanRecursiveIntReaderWrapper(b *testing.B) {
 	ints := makeInts(intCount)
 	var r RecursiveInt
 	for i := b.N - 1; i >= 0; i-- {
-		buf := newReader(string(ints))
+		buf := struct{ io.Reader }{strings.NewReader(string(ints))}
 		b.StartTimer()
 		Fscan(buf, &r)
 		b.StopTimer()
diff --git a/src/go/build/build_test.go b/src/go/build/build_test.go
index c9f906a..198a649 100644
--- a/src/go/build/build_test.go
+++ b/src/go/build/build_test.go
@@ -303,11 +303,11 @@ func TestImportVendor(t *testing.T) {
 	testenv.MustHaveGoBuild(t) // really must just have source
 	ctxt := Default
 	ctxt.GOPATH = ""
-	p, err := ctxt.Import("golang.org/x/net/http2/hpack", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
+	p, err := ctxt.Import("golang_org/x/net/http2/hpack", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
 	if err != nil {
-		t.Fatalf("cannot find vendored golang.org/x/net/http2/hpack from net/http directory: %v", err)
+		t.Fatalf("cannot find vendored golang_org/x/net/http2/hpack from net/http directory: %v", err)
 	}
-	want := "vendor/golang.org/x/net/http2/hpack"
+	want := "vendor/golang_org/x/net/http2/hpack"
 	if p.ImportPath != want {
 		t.Fatalf("Import succeeded but found %q, want %q", p.ImportPath, want)
 	}
@@ -333,7 +333,7 @@ func TestImportVendorParentFailure(t *testing.T) {
 	ctxt := Default
 	ctxt.GOPATH = ""
 	// This import should fail because the vendor/golang.org/x/net/http2 directory has no source code.
-	p, err := ctxt.Import("golang.org/x/net/http2", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
+	p, err := ctxt.Import("golang_org/x/net/http2", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
 	if err == nil {
 		t.Fatalf("found empty parent in %s", p.Dir)
 	}
diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go
index 335e774..5b25291 100644
--- a/src/go/build/deps_test.go
+++ b/src/go/build/deps_test.go
@@ -297,7 +297,7 @@ var pkgDeps = map[string][]string{
 		"context", "math/rand", "os", "sort", "syscall", "time",
 		"internal/nettrace",
 		"internal/syscall/windows", "internal/singleflight", "internal/race",
-		"golang.org/x/net/route",
+		"golang_org/x/net/route",
 	},
 
 	// NET enables use of basic network-related packages.
@@ -378,8 +378,8 @@ var pkgDeps = map[string][]string{
 		"context", "compress/gzip", "container/list", "crypto/tls",
 		"mime/multipart", "runtime/debug",
 		"net/http/internal",
-		"golang.org/x/net/http2/hpack",
-		"golang.org/x/net/lex/httplex",
+		"golang_org/x/net/http2/hpack",
+		"golang_org/x/net/lex/httplex",
 		"internal/nettrace",
 		"net/http/httptrace",
 	},
@@ -443,7 +443,7 @@ func listStdPkgs(goroot string) ([]string, error) {
 		}
 
 		name := filepath.ToSlash(path[len(src):])
-		if name == "builtin" || name == "cmd" || strings.Contains(name, ".") {
+		if name == "builtin" || name == "cmd" || strings.Contains(name, "golang_org") {
 			return filepath.SkipDir
 		}
 
diff --git a/src/math/rand/race_test.go b/src/math/rand/race_test.go
new file mode 100644
index 0000000..48f6c29
--- /dev/null
+++ b/src/math/rand/race_test.go
@@ -0,0 +1,47 @@
+// Copyright 2016 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.
+
+package rand
+
+import (
+	"sync"
+	"testing"
+)
+
+// TestConcurrent exercises the rand API concurrently, triggering situations
+// where the race detector is likely to detect issues.
+func TestConcurrent(t *testing.T) {
+	const (
+		numRoutines = 10
+		numCycles   = 10
+	)
+	var wg sync.WaitGroup
+	defer wg.Wait()
+	wg.Add(numRoutines)
+	for i := 0; i < numRoutines; i++ {
+		go func(i int) {
+			defer wg.Done()
+			buf := make([]byte, 997)
+			for j := 0; j < numCycles; j++ {
+				var seed int64
+				seed += int64(ExpFloat64())
+				seed += int64(Float32())
+				seed += int64(Float64())
+				seed += int64(Intn(Int()))
+				seed += int64(Int31n(Int31()))
+				seed += int64(Int63n(Int63()))
+				seed += int64(NormFloat64())
+				seed += int64(Uint32())
+				for _, p := range Perm(10) {
+					seed += int64(p)
+				}
+				Read(buf)
+				for _, b := range buf {
+					seed += int64(b)
+				}
+				Seed(int64(i*j) * seed)
+			}
+		}(i)
+	}
+}
diff --git a/src/math/rand/rand.go b/src/math/rand/rand.go
index 8f31b0e..dd8d43c 100644
--- a/src/math/rand/rand.go
+++ b/src/math/rand/rand.go
@@ -49,7 +49,13 @@ type Rand struct {
 func New(src Source) *Rand { return &Rand{src: src} }
 
 // Seed uses the provided seed value to initialize the generator to a deterministic state.
+// Seed should not be called concurrently with any other Rand method.
 func (r *Rand) Seed(seed int64) {
+	if lk, ok := r.src.(*lockedSource); ok {
+		lk.seedPos(seed, &r.readPos)
+		return
+	}
+
 	r.src.Seed(seed)
 	r.readPos = 0
 }
@@ -172,20 +178,28 @@ func (r *Rand) Perm(n int) []int {
 
 // Read generates len(p) random bytes and writes them into p. It
 // always returns len(p) and a nil error.
+// Read should not be called concurrently with any other Rand method.
 func (r *Rand) Read(p []byte) (n int, err error) {
-	pos := r.readPos
-	val := r.readVal
+	if lk, ok := r.src.(*lockedSource); ok {
+		return lk.read(p, &r.readVal, &r.readPos)
+	}
+	return read(p, r.Int63, &r.readVal, &r.readPos)
+}
+
+func read(p []byte, int63 func() int64, readVal *int64, readPos *int8) (n int, err error) {
+	pos := *readPos
+	val := *readVal
 	for n = 0; n < len(p); n++ {
 		if pos == 0 {
-			val = r.Int63()
+			val = int63()
 			pos = 7
 		}
 		p[n] = byte(val)
 		val >>= 8
 		pos--
 	}
-	r.readPos = pos
-	r.readVal = val
+	*readPos = pos
+	*readVal = val
 	return
 }
 
@@ -199,6 +213,7 @@ var globalRand = New(&lockedSource{src: NewSource(1)})
 // deterministic state. If Seed is not called, the generator behaves as
 // if seeded by Seed(1). Seed values that have the same remainder when
 // divided by 2^31-1 generate the same pseudo-random sequence.
+// Seed, unlike the Rand.Seed method, is safe for concurrent use.
 func Seed(seed int64) { globalRand.Seed(seed) }
 
 // Int63 returns a non-negative pseudo-random 63-bit integer as an int64
@@ -245,6 +260,7 @@ func Perm(n int) []int { return globalRand.Perm(n) }
 
 // Read generates len(p) random bytes from the default Source and
 // writes them into p. It always returns len(p) and a nil error.
+// Read, unlike the Rand.Read method, is safe for concurrent use.
 func Read(p []byte) (n int, err error) { return globalRand.Read(p) }
 
 // NormFloat64 returns a normally distributed float64 in the range
@@ -285,3 +301,19 @@ func (r *lockedSource) Seed(seed int64) {
 	r.src.Seed(seed)
 	r.lk.Unlock()
 }
+
+// seedPos implements Seed for a lockedSource without a race condiiton.
+func (r *lockedSource) seedPos(seed int64, readPos *int8) {
+	r.lk.Lock()
+	r.src.Seed(seed)
+	*readPos = 0
+	r.lk.Unlock()
+}
+
+// read implements Read for a lockedSource without a race condition.
+func (r *lockedSource) read(p []byte, readVal *int64, readPos *int8) (n int, err error) {
+	r.lk.Lock()
+	n, err = read(p, r.src.Int63, readVal, readPos)
+	r.lk.Unlock()
+	return
+}
diff --git a/src/net/dial_test.go b/src/net/dial_test.go
index 9fe507e..8b21e6b 100644
--- a/src/net/dial_test.go
+++ b/src/net/dial_test.go
@@ -695,6 +695,11 @@ func TestDialerLocalAddr(t *testing.T) {
 }
 
 func TestDialerDualStack(t *testing.T) {
+	// This test is known to be flaky. Don't frighten regular
+	// users about it; only fail on the build dashboard.
+	if testenv.Builder() == "" {
+		testenv.SkipFlaky(t, 13324)
+	}
 	if !supportsIPv4 || !supportsIPv6 {
 		t.Skip("both IPv4 and IPv6 are required")
 	}
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 352a41d..47e5f57 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -41,8 +41,8 @@ import (
 	"sync"
 	"time"
 
-	"golang.org/x/net/http2/hpack"
-	"golang.org/x/net/lex/httplex"
+	"golang_org/x/net/http2/hpack"
+	"golang_org/x/net/lex/httplex"
 )
 
 // ClientConnPool manages a pool of HTTP/2 client connections.
diff --git a/src/net/http/http.go b/src/net/http/http.go
index 4d088a5..b34ae41 100644
--- a/src/net/http/http.go
+++ b/src/net/http/http.go
@@ -7,7 +7,7 @@ package http
 import (
 	"strings"
 
-	"golang.org/x/net/lex/httplex"
+	"golang_org/x/net/lex/httplex"
 )
 
 // maxInt64 is the effective "infinite" value for the Server and
diff --git a/src/net/http/server.go b/src/net/http/server.go
index 7c3237c..7b2b4b2 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -28,7 +28,7 @@ import (
 	"sync/atomic"
 	"time"
 
-	"golang.org/x/net/lex/httplex"
+	"golang_org/x/net/lex/httplex"
 )
 
 // Errors used by the HTTP server.
@@ -775,9 +775,6 @@ func (c *conn) readRequest(ctx context.Context) (w *response, err error) {
 		return nil, badRequestError("unsupported protocol version")
 	}
 
-	ctx, cancelCtx := context.WithCancel(ctx)
-	req.ctx = ctx
-
 	c.lastMethod = req.Method
 	c.r.setInfiniteReadLimit()
 
@@ -804,6 +801,8 @@ func (c *conn) readRequest(ctx context.Context) (w *response, err error) {
 	}
 	delete(req.Header, "Host")
 
+	ctx, cancelCtx := context.WithCancel(ctx)
+	req.ctx = ctx
 	req.RemoteAddr = c.remoteAddr
 	req.TLS = c.tlsState
 	if body, ok := req.Body.(*body); ok {
diff --git a/src/net/http/transfer.go b/src/net/http/transfer.go
index b27ace6..c653467 100644
--- a/src/net/http/transfer.go
+++ b/src/net/http/transfer.go
@@ -18,7 +18,7 @@ import (
 	"strings"
 	"sync"
 
-	"golang.org/x/net/lex/httplex"
+	"golang_org/x/net/lex/httplex"
 )
 
 // ErrLineTooLong is returned when reading request or response bodies
diff --git a/src/net/http/transport.go b/src/net/http/transport.go
index eb54703..9164d0d 100644
--- a/src/net/http/transport.go
+++ b/src/net/http/transport.go
@@ -27,7 +27,7 @@ import (
 	"sync"
 	"time"
 
-	"golang.org/x/net/lex/httplex"
+	"golang_org/x/net/lex/httplex"
 )
 
 // DefaultTransport is the default implementation of Transport and is
diff --git a/src/net/interface_bsd.go b/src/net/interface_bsd.go
index d791cb3..35b1c26 100644
--- a/src/net/interface_bsd.go
+++ b/src/net/interface_bsd.go
@@ -9,7 +9,7 @@ package net
 import (
 	"syscall"
 
-	"golang.org/x/net/route"
+	"golang_org/x/net/route"
 )
 
 // If the ifindex is zero, interfaceTable returns mappings of all
diff --git a/src/net/interface_bsdvar.go b/src/net/interface_bsdvar.go
index a809b5f..0b84ca3 100644
--- a/src/net/interface_bsdvar.go
+++ b/src/net/interface_bsdvar.go
@@ -9,7 +9,7 @@ package net
 import (
 	"syscall"
 
-	"golang.org/x/net/route"
+	"golang_org/x/net/route"
 )
 
 func interfaceMessages(ifindex int) ([]route.Message, error) {
diff --git a/src/net/interface_darwin.go b/src/net/interface_darwin.go
index bb4fd73..2ec8e1c 100644
--- a/src/net/interface_darwin.go
+++ b/src/net/interface_darwin.go
@@ -7,7 +7,7 @@ package net
 import (
 	"syscall"
 
-	"golang.org/x/net/route"
+	"golang_org/x/net/route"
 )
 
 func interfaceMessages(ifindex int) ([]route.Message, error) {
diff --git a/src/net/interface_freebsd.go b/src/net/interface_freebsd.go
index 45badd6..8a7d6f6 100644
--- a/src/net/interface_freebsd.go
+++ b/src/net/interface_freebsd.go
@@ -7,7 +7,7 @@ package net
 import (
 	"syscall"
 
-	"golang.org/x/net/route"
+	"golang_org/x/net/route"
 )
 
 func interfaceMessages(ifindex int) ([]route.Message, error) {
diff --git a/src/net/smtp/smtp.go b/src/net/smtp/smtp.go
index b4e4867..9e04dd7 100644
--- a/src/net/smtp/smtp.go
+++ b/src/net/smtp/smtp.go
@@ -8,6 +8,11 @@
 //	AUTH      RFC 2554
 //	STARTTLS  RFC 3207
 // Additional extensions may be handled by clients.
+//
+// The smtp package is frozen and not accepting new features.
+// Some external packages provide more functionality. See:
+//
+//   https://godoc.org/?q=smtp
 package smtp
 
 import (
diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go
index adde582..bbb098f 100644
--- a/src/reflect/all_test.go
+++ b/src/reflect/all_test.go
@@ -2261,6 +2261,8 @@ func TestImportPath(t *testing.T) {
 		{TypeOf((*int64)(nil)), ""},
 		{TypeOf(map[string]int{}), ""},
 		{TypeOf((*error)(nil)).Elem(), ""},
+		{TypeOf((*Point)(nil)), ""},
+		{TypeOf((*Point)(nil)).Elem(), "reflect_test"},
 	}
 	for _, test := range tests {
 		if path := test.t.PkgPath(); path != test.path {
diff --git a/src/reflect/type.go b/src/reflect/type.go
index bedfba4..de6e05f 100644
--- a/src/reflect/type.go
+++ b/src/reflect/type.go
@@ -876,6 +876,9 @@ func (t *rtype) MethodByName(name string) (m Method, ok bool) {
 }
 
 func (t *rtype) PkgPath() string {
+	if t.tflag&tflagNamed == 0 {
+		return ""
+	}
 	ut := t.uncommon()
 	if ut == nil {
 		return ""
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go
index 0f8386b..f8d6930 100644
--- a/src/runtime/cgocall.go
+++ b/src/runtime/cgocall.go
@@ -44,7 +44,7 @@
 // call arbitrary Go code directly and must be careful not to allocate
 // memory or use up m->g0's stack.
 //
-// _cgoexp_GoF calls runtime.cgocallback(p.GoF, frame, framesize).
+// _cgoexp_GoF calls runtime.cgocallback(p.GoF, frame, framesize, ctxt).
 // (The reason for having _cgoexp_GoF instead of writing a crosscall3
 // to make this call directly is that _cgoexp_GoF, because it is compiled
 // with 6c instead of gcc, can refer to dotted names like
@@ -80,6 +80,7 @@
 package runtime
 
 import (
+	"runtime/internal/atomic"
 	"runtime/internal/sys"
 	"unsafe"
 )
@@ -176,7 +177,7 @@ func cgocallbackg(ctxt uintptr) {
 
 func cgocallbackg1(ctxt uintptr) {
 	gp := getg()
-	if gp.m.needextram {
+	if gp.m.needextram || atomic.Load(&extraMWaiters) > 0 {
 		gp.m.needextram = false
 		systemstack(newextram)
 	}
diff --git a/src/runtime/internal/atomic/asm_386.s b/src/runtime/internal/atomic/asm_386.s
index ebecd0b..357d830 100644
--- a/src/runtime/internal/atomic/asm_386.s
+++ b/src/runtime/internal/atomic/asm_386.s
@@ -32,13 +32,13 @@ TEXT runtime∕internal∕atomic·Loaduint(SB), NOSPLIT, $0-8
 TEXT runtime∕internal∕atomic·Storeuintptr(SB), NOSPLIT, $0-8
 	JMP	runtime∕internal∕atomic·Store(SB)
 
-TEXT runtime∕internal∕atomic·Xadduintptr(SB), NOSPLIT, $0-8
+TEXT runtime∕internal∕atomic·Xadduintptr(SB), NOSPLIT, $0-12
 	JMP runtime∕internal∕atomic·Xadd(SB)
 
-TEXT runtime∕internal∕atomic·Loadint64(SB), NOSPLIT, $0-16
+TEXT runtime∕internal∕atomic·Loadint64(SB), NOSPLIT, $0-12
 	JMP runtime∕internal∕atomic·Load64(SB)
 
-TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-16
+TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-20
 	JMP runtime∕internal∕atomic·Xadd64(SB)
 
 
diff --git a/src/runtime/internal/atomic/asm_amd64.s b/src/runtime/internal/atomic/asm_amd64.s
index 94d4ac2..0001d23 100644
--- a/src/runtime/internal/atomic/asm_amd64.s
+++ b/src/runtime/internal/atomic/asm_amd64.s
@@ -52,7 +52,7 @@ TEXT runtime∕internal∕atomic·Storeuintptr(SB), NOSPLIT, $0-16
 TEXT runtime∕internal∕atomic·Loadint64(SB), NOSPLIT, $0-16
 	JMP	runtime∕internal∕atomic·Load64(SB)
 
-TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-16
+TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-24
 	JMP	runtime∕internal∕atomic·Xadd64(SB)
 
 // bool Casp(void **val, void *old, void *new)
diff --git a/src/runtime/internal/atomic/asm_amd64p32.s b/src/runtime/internal/atomic/asm_amd64p32.s
index 74c79d0..22c707c 100644
--- a/src/runtime/internal/atomic/asm_amd64p32.s
+++ b/src/runtime/internal/atomic/asm_amd64p32.s
@@ -29,10 +29,10 @@ TEXT runtime∕internal∕atomic·Loaduintptr(SB), NOSPLIT, $0-12
 TEXT runtime∕internal∕atomic·Loaduint(SB), NOSPLIT, $0-12
 	JMP	runtime∕internal∕atomic·Load(SB)
 
-TEXT runtime∕internal∕atomic·Storeuintptr(SB), NOSPLIT, $0-12
+TEXT runtime∕internal∕atomic·Storeuintptr(SB), NOSPLIT, $0-8
 	JMP	runtime∕internal∕atomic·Store(SB)
 
-TEXT runtime∕internal∕atomic·Loadint64(SB), NOSPLIT, $0-24
+TEXT runtime∕internal∕atomic·Loadint64(SB), NOSPLIT, $0-16
 	JMP	runtime∕internal∕atomic·Load64(SB)
 
 TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-24
diff --git a/src/runtime/internal/atomic/asm_arm.s b/src/runtime/internal/atomic/asm_arm.s
index 235e8bf..12da223 100644
--- a/src/runtime/internal/atomic/asm_arm.s
+++ b/src/runtime/internal/atomic/asm_arm.s
@@ -61,11 +61,11 @@ TEXT runtime∕internal∕atomic·Loaduint(SB),NOSPLIT,$0-8
 TEXT runtime∕internal∕atomic·Storeuintptr(SB),NOSPLIT,$0-8
 	B	runtime∕internal∕atomic·Store(SB)
 
-TEXT runtime∕internal∕atomic·Xadduintptr(SB),NOSPLIT,$0-8
+TEXT runtime∕internal∕atomic·Xadduintptr(SB),NOSPLIT,$0-12
 	B	runtime∕internal∕atomic·Xadd(SB)
 
-TEXT runtime∕internal∕atomic·Loadint64(SB),NOSPLIT,$0-16
+TEXT runtime∕internal∕atomic·Loadint64(SB),NOSPLIT,$0-12
 	B	runtime∕internal∕atomic·Load64(SB)
 
-TEXT runtime∕internal∕atomic·Xaddint64(SB),NOSPLIT,$0-16
+TEXT runtime∕internal∕atomic·Xaddint64(SB),NOSPLIT,$0-20
 	B	runtime∕internal∕atomic·Xadd64(SB)
diff --git a/src/runtime/internal/atomic/asm_arm64.s b/src/runtime/internal/atomic/asm_arm64.s
index c255677..929bf71 100644
--- a/src/runtime/internal/atomic/asm_arm64.s
+++ b/src/runtime/internal/atomic/asm_arm64.s
@@ -38,13 +38,13 @@ TEXT runtime∕internal∕atomic·Loaduint(SB), NOSPLIT, $-8-16
 TEXT runtime∕internal∕atomic·Storeuintptr(SB), NOSPLIT, $0-16
 	B	runtime∕internal∕atomic·Store64(SB)
 
-TEXT runtime∕internal∕atomic·Xadduintptr(SB), NOSPLIT, $0-16
+TEXT runtime∕internal∕atomic·Xadduintptr(SB), NOSPLIT, $0-24
 	B	runtime∕internal∕atomic·Xadd64(SB)
 
 TEXT runtime∕internal∕atomic·Loadint64(SB), NOSPLIT, $0-16
 	B	runtime∕internal∕atomic·Load64(SB)
 
-TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-16
+TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-24
 	B	runtime∕internal∕atomic·Xadd64(SB)
 
 // bool Casp(void **val, void *old, void *new)
diff --git a/src/runtime/internal/atomic/asm_ppc64x.s b/src/runtime/internal/atomic/asm_ppc64x.s
index de4f895..aa6067e 100644
--- a/src/runtime/internal/atomic/asm_ppc64x.s
+++ b/src/runtime/internal/atomic/asm_ppc64x.s
@@ -77,7 +77,7 @@ TEXT runtime∕internal∕atomic·Xadduintptr(SB), NOSPLIT, $0-24
 TEXT runtime∕internal∕atomic·Loadint64(SB), NOSPLIT, $0-16
 	BR	runtime∕internal∕atomic·Load64(SB)
 
-TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-16
+TEXT runtime∕internal∕atomic·Xaddint64(SB), NOSPLIT, $0-24
 	BR	runtime∕internal∕atomic·Xadd64(SB)
 
 // bool casp(void **val, void *old, void *new)
diff --git a/src/runtime/mbarrier.go b/src/runtime/mbarrier.go
index bf75934..4a8f501 100644
--- a/src/runtime/mbarrier.go
+++ b/src/runtime/mbarrier.go
@@ -145,7 +145,7 @@ func writebarrierptr(dst *uintptr, src uintptr) {
 	if !writeBarrier.needed {
 		return
 	}
-	if src != 0 && src < sys.PhysPageSize {
+	if src != 0 && src < minPhysPageSize {
 		systemstack(func() {
 			print("runtime: writebarrierptr *", dst, " = ", hex(src), "\n")
 			throw("bad pointer in write barrier")
@@ -164,7 +164,7 @@ func writebarrierptr_nostore(dst *uintptr, src uintptr) {
 	if !writeBarrier.needed {
 		return
 	}
-	if src != 0 && src < sys.PhysPageSize {
+	if src != 0 && src < minPhysPageSize {
 		systemstack(func() { throw("bad pointer in write barrier") })
 	}
 	writebarrierptr_nostore1(dst, src)
diff --git a/src/runtime/mem_linux.go b/src/runtime/mem_linux.go
index 61fdcee..cd0bf26 100644
--- a/src/runtime/mem_linux.go
+++ b/src/runtime/mem_linux.go
@@ -10,8 +10,8 @@ import (
 )
 
 const (
-	_PAGE_SIZE = sys.PhysPageSize
-	_EACCES    = 13
+	_EACCES = 13
+	_EINVAL = 22
 )
 
 // NOTE: vec must be just 1 byte long here.
@@ -22,13 +22,19 @@ const (
 var addrspace_vec [1]byte
 
 func addrspace_free(v unsafe.Pointer, n uintptr) bool {
-	var chunk uintptr
-	for off := uintptr(0); off < n; off += chunk {
-		chunk = _PAGE_SIZE * uintptr(len(addrspace_vec))
-		if chunk > (n - off) {
-			chunk = n - off
+	// Step by the minimum possible physical page size. This is
+	// safe even if we have the wrong physical page size; mincore
+	// will just return EINVAL for unaligned addresses.
+	for off := uintptr(0); off < n; off += minPhysPageSize {
+		// Use a length of 1 byte, which the kernel will round
+		// up to one physical page regardless of the true
+		// physical page size.
+		errval := mincore(unsafe.Pointer(uintptr(v)+off), 1, &addrspace_vec[0])
+		if errval == -_EINVAL {
+			// Address is not a multiple of the physical
+			// page size. That's fine.
+			continue
 		}
-		errval := mincore(unsafe.Pointer(uintptr(v)+off), chunk, &addrspace_vec[0])
 		// ENOMEM means unmapped, which is what we want.
 		// Anything else we assume means the pages are mapped.
 		if errval != -_ENOMEM {
diff --git a/src/runtime/mfinal.go b/src/runtime/mfinal.go
index 1a744e4..14ebec8 100644
--- a/src/runtime/mfinal.go
+++ b/src/runtime/mfinal.go
@@ -450,7 +450,7 @@ func findObject(v unsafe.Pointer) (s *mspan, x unsafe.Pointer, n uintptr) {
 // 	type File struct { d int }
 // 	d, err := syscall.Open("/file/path", syscall.O_RDONLY, 0)
 // 	// ... do something if err != nil ...
-// 	p := &FILE{d}
+// 	p := &File{d}
 // 	runtime.SetFinalizer(p, func(p *File) { syscall.Close(p.d) })
 // 	var buf [10]byte
 // 	n, err := syscall.Read(p.d, buf[:])
diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go
index 4093288..db60f7a 100644
--- a/src/runtime/mheap.go
+++ b/src/runtime/mheap.go
@@ -14,6 +14,11 @@ import (
 	"unsafe"
 )
 
+// minPhysPageSize is a lower-bound on the physical page size. The
+// true physical page size may be larger than this. In contrast,
+// sys.PhysPageSize is an upper-bound on the physical page size.
+const minPhysPageSize = 4096
+
 // Main malloc heap.
 // The heap itself is the "free[]" and "large" arrays,
 // but all the other global data is here too.
diff --git a/src/runtime/os_nacl.go b/src/runtime/os_nacl.go
index 6cbd16d..1dacc1a 100644
--- a/src/runtime/os_nacl.go
+++ b/src/runtime/os_nacl.go
@@ -246,7 +246,7 @@ func memlimit() uintptr {
 //go:norace
 //go:nowritebarrierrec
 func badsignal(sig uintptr) {
-	cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+	cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 }
 
 func badsignalgo(sig uintptr) {
diff --git a/src/runtime/pprof/pprof.go b/src/runtime/pprof/pprof.go
index f2cd81a..b7c41f1 100644
--- a/src/runtime/pprof/pprof.go
+++ b/src/runtime/pprof/pprof.go
@@ -353,12 +353,9 @@ func printStackRecord(w io.Writer, stk []uintptr, allFrames bool) {
 		if name == "" {
 			show = true
 			fmt.Fprintf(w, "#\t%#x\n", frame.PC)
-		} else {
+		} else if name != "runtime.goexit" && (show || !strings.HasPrefix(name, "runtime.")) {
 			// Hide runtime.goexit and any runtime functions at the beginning.
 			// This is useful mainly for allocation traces.
-			if name == "runtime.goexit" || !show && strings.HasPrefix(name, "runtime.") {
-				continue
-			}
 			show = true
 			fmt.Fprintf(w, "#\t%#x\t%s+%#x\t%s:%d\n", frame.PC, name, frame.PC-frame.Entry, frame.File, frame.Line)
 		}
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go
index a6f5eda..a093015 100644
--- a/src/runtime/pprof/pprof_test.go
+++ b/src/runtime/pprof/pprof_test.go
@@ -497,6 +497,10 @@ func TestBlockProfile(t *testing.T) {
 		t.Fatalf("Bad profile header:\n%v", prof)
 	}
 
+	if strings.HasSuffix(prof, "#\t0x0\n\n") {
+		t.Errorf("Useless 0 suffix:\n%v", prof)
+	}
+
 	for _, test := range tests {
 		if !regexp.MustCompile(strings.Replace(test.re, "\t", "\t+", -1)).MatchString(prof) {
 			t.Fatalf("Bad %v entry, expect:\n%v\ngot:\n%v", test.name, test.re, prof)
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 2c0b3df..1d00930 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -1389,10 +1389,27 @@ func needm(x byte) {
 
 var earlycgocallback = []byte("fatal error: cgo callback before cgo call\n")
 
-// newextram allocates an m and puts it on the extra list.
+// newextram allocates m's and puts them on the extra list.
 // It is called with a working local m, so that it can do things
 // like call schedlock and allocate.
 func newextram() {
+	c := atomic.Xchg(&extraMWaiters, 0)
+	if c > 0 {
+		for i := uint32(0); i < c; i++ {
+			oneNewExtraM()
+		}
+	} else {
+		// Make sure there is at least one extra M.
+		mp := lockextra(true)
+		unlockextra(mp)
+		if mp == nil {
+			oneNewExtraM()
+		}
+	}
+}
+
+// oneNewExtraM allocates an m and puts it on the extra list.
+func oneNewExtraM() {
 	// Create extra goroutine locked to extra m.
 	// The goroutine is the context in which the cgo callback will run.
 	// The sched.pc will never be returned to, but setting it to
@@ -1485,6 +1502,7 @@ func getm() uintptr {
 }
 
 var extram uintptr
+var extraMWaiters uint32
 
 // lockextra locks the extra list and returns the list head.
 // The caller must unlock the list by storing a new list head
@@ -1495,6 +1513,7 @@ var extram uintptr
 func lockextra(nilokay bool) *m {
 	const locked = 1
 
+	incr := false
 	for {
 		old := atomic.Loaduintptr(&extram)
 		if old == locked {
@@ -1503,6 +1522,13 @@ func lockextra(nilokay bool) *m {
 			continue
 		}
 		if old == 0 && !nilokay {
+			if !incr {
+				// Add 1 to the number of threads
+				// waiting for an M.
+				// This is cleared by newextram.
+				atomic.Xadd(&extraMWaiters, 1)
+				incr = true
+			}
 			usleep(1)
 			continue
 		}
diff --git a/src/runtime/race/README b/src/runtime/race/README
index 3a506b0..95e241c 100644
--- a/src/runtime/race/README
+++ b/src/runtime/race/README
@@ -4,4 +4,4 @@ the LLVM project (http://llvm.org/git/compiler-rt.git).
 
 To update the .syso files use golang.org/x/build/cmd/racebuild.
 
-Current runtime is built on rev 9d79ea3416bfbe3acac50e47802ee9621bf53254.
+Current runtime is built on rev e35e7c00b5c7e7ee5e24d537b80cb0d34cebb038.
diff --git a/src/runtime/race/race_darwin_amd64.syso b/src/runtime/race/race_darwin_amd64.syso
index 1822486..c19740f 100644
Binary files a/src/runtime/race/race_darwin_amd64.syso and b/src/runtime/race/race_darwin_amd64.syso differ
diff --git a/src/runtime/race/race_freebsd_amd64.syso b/src/runtime/race/race_freebsd_amd64.syso
index 75d9495..df1bc26 100644
Binary files a/src/runtime/race/race_freebsd_amd64.syso and b/src/runtime/race/race_freebsd_amd64.syso differ
diff --git a/src/runtime/race/race_linux_amd64.syso b/src/runtime/race/race_linux_amd64.syso
index 8f571af..1740330 100644
Binary files a/src/runtime/race/race_linux_amd64.syso and b/src/runtime/race/race_linux_amd64.syso differ
diff --git a/src/runtime/race/race_test.go b/src/runtime/race/race_test.go
index 81e51cc..53ec74c 100644
--- a/src/runtime/race/race_test.go
+++ b/src/runtime/race/race_test.go
@@ -221,3 +221,21 @@ func BenchmarkSyncLeak(b *testing.B) {
 	}
 	wg.Wait()
 }
+
+func BenchmarkStackLeak(b *testing.B) {
+	done := make(chan bool, 1)
+	for i := 0; i < b.N; i++ {
+		go func() {
+			growStack(rand.Intn(100))
+			done <- true
+		}()
+		<-done
+	}
+}
+
+func growStack(i int) {
+	if i == 0 {
+		return
+	}
+	growStack(i - 1)
+}
diff --git a/src/runtime/race/race_windows_amd64.syso b/src/runtime/race/race_windows_amd64.syso
index 64c54b6..fd93959 100644
Binary files a/src/runtime/race/race_windows_amd64.syso and b/src/runtime/race/race_windows_amd64.syso differ
diff --git a/src/runtime/signal1_unix.go b/src/runtime/signal1_unix.go
index 5080202..101d16d 100644
--- a/src/runtime/signal1_unix.go
+++ b/src/runtime/signal1_unix.go
@@ -338,7 +338,7 @@ func sigNotOnStack(sig uint32) {
 //go:norace
 //go:nowritebarrierrec
 func badsignal(sig uintptr, c *sigctxt) {
-	cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig)+unsafe.Sizeof(c))
+	cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig)+unsafe.Sizeof(c), 0)
 }
 
 func badsignalgo(sig uintptr, c *sigctxt) {
diff --git a/src/runtime/signal_darwin.go b/src/runtime/signal_darwin.go
index c8534ff..fb06de5 100644
--- a/src/runtime/signal_darwin.go
+++ b/src/runtime/signal_darwin.go
@@ -70,12 +70,12 @@ func sigtrampgo(fn uintptr, infostyle, sig uint32, info *siginfo, ctx unsafe.Poi
 		sigaltstack(nil, &st)
 		if st.ss_flags&_SS_DISABLE != 0 {
 			setg(nil)
-			cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+			cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 		}
 		stsp := uintptr(unsafe.Pointer(st.ss_sp))
 		if sp < stsp || sp >= stsp+st.ss_size {
 			setg(nil)
-			cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+			cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 		}
 		g.m.gsignal.stack.lo = stsp
 		g.m.gsignal.stack.hi = stsp + st.ss_size
diff --git a/src/runtime/signal_freebsd.go b/src/runtime/signal_freebsd.go
index c4cb687..c6c1269 100644
--- a/src/runtime/signal_freebsd.go
+++ b/src/runtime/signal_freebsd.go
@@ -66,12 +66,12 @@ func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
 		sigaltstack(nil, &st)
 		if st.ss_flags&_SS_DISABLE != 0 {
 			setg(nil)
-			cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+			cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 		}
 		stsp := uintptr(unsafe.Pointer(st.ss_sp))
 		if sp < stsp || sp >= stsp+st.ss_size {
 			setg(nil)
-			cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+			cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 		}
 		g.m.gsignal.stack.lo = stsp
 		g.m.gsignal.stack.hi = stsp + st.ss_size
diff --git a/src/runtime/signal_openbsd.go b/src/runtime/signal_openbsd.go
index 9275279..efe30da 100644
--- a/src/runtime/signal_openbsd.go
+++ b/src/runtime/signal_openbsd.go
@@ -66,12 +66,12 @@ func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
 		sigaltstack(nil, &st)
 		if st.ss_flags&_SS_DISABLE != 0 {
 			setg(nil)
-			cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+			cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 		}
 		stsp := uintptr(unsafe.Pointer(st.ss_sp))
 		if sp < stsp || sp >= stsp+st.ss_size {
 			setg(nil)
-			cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+			cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 		}
 		g.m.gsignal.stack.lo = stsp
 		g.m.gsignal.stack.hi = stsp + st.ss_size
diff --git a/src/runtime/signal_sigtramp.go b/src/runtime/signal_sigtramp.go
index 3e0b104..dbbbcd0 100644
--- a/src/runtime/signal_sigtramp.go
+++ b/src/runtime/signal_sigtramp.go
@@ -37,12 +37,12 @@ func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
 		sigaltstack(nil, &st)
 		if st.ss_flags&_SS_DISABLE != 0 {
 			setg(nil)
-			cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+			cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 		}
 		stsp := uintptr(unsafe.Pointer(st.ss_sp))
 		if sp < stsp || sp >= stsp+st.ss_size {
 			setg(nil)
-			cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
+			cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
 		}
 		g.m.gsignal.stack.lo = stsp
 		g.m.gsignal.stack.hi = stsp + st.ss_size
diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go
index 6c28fd2..a594c1b 100644
--- a/src/runtime/stubs.go
+++ b/src/runtime/stubs.go
@@ -98,7 +98,7 @@ func noescape(p unsafe.Pointer) unsafe.Pointer {
 	return unsafe.Pointer(x ^ 0)
 }
 
-func cgocallback(fn, frame unsafe.Pointer, framesize uintptr)
+func cgocallback(fn, frame unsafe.Pointer, framesize, ctxt uintptr)
 func gogo(buf *gobuf)
 func gosave(buf *gobuf)
 func mincore(addr unsafe.Pointer, n uintptr, dst *byte) int32
@@ -143,7 +143,7 @@ func goexit(neverCallThisFunction)
 // cgocallback_gofunc is not called from go, only from cgocallback,
 // so the arguments will be found via cgocallback's pointer-declared arguments.
 // See the assembly implementations for more details.
-func cgocallback_gofunc(fv uintptr, frame uintptr, framesize uintptr)
+func cgocallback_gofunc(fv uintptr, frame uintptr, framesize, ctxt uintptr)
 
 // publicationBarrier performs a store/store barrier (a "publication"
 // or "export" barrier). Some form of synchronization is required
diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
index e09b906..e4837ce 100644
--- a/src/runtime/sys_darwin_amd64.s
+++ b/src/runtime/sys_darwin_amd64.s
@@ -244,6 +244,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$32
 	MOVQ R8, 24(SP) // ctx
 	MOVQ $runtime·sigtrampgo(SB), AX
 	CALL AX
+	INT $3 // not reached (see issue 16453)
 
 TEXT runtime·mmap(SB),NOSPLIT,$0
 	MOVQ	addr+0(FP), DI		// arg 1 addr
diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go
index cb24c59..aaffa06 100644
--- a/src/syscall/exec_linux_test.go
+++ b/src/syscall/exec_linux_test.go
@@ -238,6 +238,7 @@ func TestGroupCleanupUserNamespace(t *testing.T) {
 		"uid=0(root) gid=0(root) groups=0(root)",
 		"uid=0(root) gid=0(root) groups=0(root),65534(nobody)",
 		"uid=0(root) gid=0(root) groups=0(root),65534(nogroup)",
+		"uid=0(root) gid=0(root) groups=0(root),65534",
 	}
 	for _, e := range expected {
 		if strOut == e {
diff --git a/src/vendor/golang.org/x/net/http2/hpack/encode.go b/src/vendor/golang_org/x/net/http2/hpack/encode.go
similarity index 100%
rename from src/vendor/golang.org/x/net/http2/hpack/encode.go
rename to src/vendor/golang_org/x/net/http2/hpack/encode.go
diff --git a/src/vendor/golang.org/x/net/http2/hpack/encode_test.go b/src/vendor/golang_org/x/net/http2/hpack/encode_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/http2/hpack/encode_test.go
rename to src/vendor/golang_org/x/net/http2/hpack/encode_test.go
diff --git a/src/vendor/golang.org/x/net/http2/hpack/hpack.go b/src/vendor/golang_org/x/net/http2/hpack/hpack.go
similarity index 100%
rename from src/vendor/golang.org/x/net/http2/hpack/hpack.go
rename to src/vendor/golang_org/x/net/http2/hpack/hpack.go
diff --git a/src/vendor/golang.org/x/net/http2/hpack/hpack_test.go b/src/vendor/golang_org/x/net/http2/hpack/hpack_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/http2/hpack/hpack_test.go
rename to src/vendor/golang_org/x/net/http2/hpack/hpack_test.go
diff --git a/src/vendor/golang.org/x/net/http2/hpack/huffman.go b/src/vendor/golang_org/x/net/http2/hpack/huffman.go
similarity index 100%
rename from src/vendor/golang.org/x/net/http2/hpack/huffman.go
rename to src/vendor/golang_org/x/net/http2/hpack/huffman.go
diff --git a/src/vendor/golang.org/x/net/http2/hpack/tables.go b/src/vendor/golang_org/x/net/http2/hpack/tables.go
similarity index 100%
rename from src/vendor/golang.org/x/net/http2/hpack/tables.go
rename to src/vendor/golang_org/x/net/http2/hpack/tables.go
diff --git a/src/vendor/golang.org/x/net/lex/httplex/httplex.go b/src/vendor/golang_org/x/net/lex/httplex/httplex.go
similarity index 100%
rename from src/vendor/golang.org/x/net/lex/httplex/httplex.go
rename to src/vendor/golang_org/x/net/lex/httplex/httplex.go
diff --git a/src/vendor/golang.org/x/net/lex/httplex/httplex_test.go b/src/vendor/golang_org/x/net/lex/httplex/httplex_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/lex/httplex/httplex_test.go
rename to src/vendor/golang_org/x/net/lex/httplex/httplex_test.go
diff --git a/src/vendor/golang.org/x/net/route/address.go b/src/vendor/golang_org/x/net/route/address.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/address.go
rename to src/vendor/golang_org/x/net/route/address.go
diff --git a/src/vendor/golang.org/x/net/route/address_darwin_test.go b/src/vendor/golang_org/x/net/route/address_darwin_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/address_darwin_test.go
rename to src/vendor/golang_org/x/net/route/address_darwin_test.go
diff --git a/src/vendor/golang.org/x/net/route/address_test.go b/src/vendor/golang_org/x/net/route/address_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/address_test.go
rename to src/vendor/golang_org/x/net/route/address_test.go
diff --git a/src/vendor/golang.org/x/net/route/binary.go b/src/vendor/golang_org/x/net/route/binary.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/binary.go
rename to src/vendor/golang_org/x/net/route/binary.go
diff --git a/src/vendor/golang.org/x/net/route/defs_darwin.go b/src/vendor/golang_org/x/net/route/defs_darwin.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/defs_darwin.go
rename to src/vendor/golang_org/x/net/route/defs_darwin.go
diff --git a/src/vendor/golang.org/x/net/route/defs_dragonfly.go b/src/vendor/golang_org/x/net/route/defs_dragonfly.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/defs_dragonfly.go
rename to src/vendor/golang_org/x/net/route/defs_dragonfly.go
diff --git a/src/vendor/golang.org/x/net/route/defs_freebsd.go b/src/vendor/golang_org/x/net/route/defs_freebsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/defs_freebsd.go
rename to src/vendor/golang_org/x/net/route/defs_freebsd.go
diff --git a/src/vendor/golang.org/x/net/route/defs_netbsd.go b/src/vendor/golang_org/x/net/route/defs_netbsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/defs_netbsd.go
rename to src/vendor/golang_org/x/net/route/defs_netbsd.go
diff --git a/src/vendor/golang.org/x/net/route/defs_openbsd.go b/src/vendor/golang_org/x/net/route/defs_openbsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/defs_openbsd.go
rename to src/vendor/golang_org/x/net/route/defs_openbsd.go
diff --git a/src/vendor/golang.org/x/net/route/interface.go b/src/vendor/golang_org/x/net/route/interface.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/interface.go
rename to src/vendor/golang_org/x/net/route/interface.go
diff --git a/src/vendor/golang.org/x/net/route/interface_announce.go b/src/vendor/golang_org/x/net/route/interface_announce.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/interface_announce.go
rename to src/vendor/golang_org/x/net/route/interface_announce.go
diff --git a/src/vendor/golang.org/x/net/route/interface_classic.go b/src/vendor/golang_org/x/net/route/interface_classic.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/interface_classic.go
rename to src/vendor/golang_org/x/net/route/interface_classic.go
diff --git a/src/vendor/golang.org/x/net/route/interface_freebsd.go b/src/vendor/golang_org/x/net/route/interface_freebsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/interface_freebsd.go
rename to src/vendor/golang_org/x/net/route/interface_freebsd.go
diff --git a/src/vendor/golang.org/x/net/route/interface_multicast.go b/src/vendor/golang_org/x/net/route/interface_multicast.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/interface_multicast.go
rename to src/vendor/golang_org/x/net/route/interface_multicast.go
diff --git a/src/vendor/golang.org/x/net/route/interface_openbsd.go b/src/vendor/golang_org/x/net/route/interface_openbsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/interface_openbsd.go
rename to src/vendor/golang_org/x/net/route/interface_openbsd.go
diff --git a/src/vendor/golang.org/x/net/route/message.go b/src/vendor/golang_org/x/net/route/message.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/message.go
rename to src/vendor/golang_org/x/net/route/message.go
diff --git a/src/vendor/golang.org/x/net/route/message_darwin_test.go b/src/vendor/golang_org/x/net/route/message_darwin_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/message_darwin_test.go
rename to src/vendor/golang_org/x/net/route/message_darwin_test.go
diff --git a/src/vendor/golang.org/x/net/route/message_freebsd_test.go b/src/vendor/golang_org/x/net/route/message_freebsd_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/message_freebsd_test.go
rename to src/vendor/golang_org/x/net/route/message_freebsd_test.go
diff --git a/src/vendor/golang.org/x/net/route/message_test.go b/src/vendor/golang_org/x/net/route/message_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/message_test.go
rename to src/vendor/golang_org/x/net/route/message_test.go
diff --git a/src/vendor/golang.org/x/net/route/route.go b/src/vendor/golang_org/x/net/route/route.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/route.go
rename to src/vendor/golang_org/x/net/route/route.go
diff --git a/src/vendor/golang.org/x/net/route/route_classic.go b/src/vendor/golang_org/x/net/route/route_classic.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/route_classic.go
rename to src/vendor/golang_org/x/net/route/route_classic.go
diff --git a/src/vendor/golang.org/x/net/route/route_openbsd.go b/src/vendor/golang_org/x/net/route/route_openbsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/route_openbsd.go
rename to src/vendor/golang_org/x/net/route/route_openbsd.go
diff --git a/src/vendor/golang.org/x/net/route/route_test.go b/src/vendor/golang_org/x/net/route/route_test.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/route_test.go
rename to src/vendor/golang_org/x/net/route/route_test.go
diff --git a/src/vendor/golang.org/x/net/route/sys.go b/src/vendor/golang_org/x/net/route/sys.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/sys.go
rename to src/vendor/golang_org/x/net/route/sys.go
diff --git a/src/vendor/golang.org/x/net/route/sys_darwin.go b/src/vendor/golang_org/x/net/route/sys_darwin.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/sys_darwin.go
rename to src/vendor/golang_org/x/net/route/sys_darwin.go
diff --git a/src/vendor/golang.org/x/net/route/sys_dragonfly.go b/src/vendor/golang_org/x/net/route/sys_dragonfly.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/sys_dragonfly.go
rename to src/vendor/golang_org/x/net/route/sys_dragonfly.go
diff --git a/src/vendor/golang.org/x/net/route/sys_freebsd.go b/src/vendor/golang_org/x/net/route/sys_freebsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/sys_freebsd.go
rename to src/vendor/golang_org/x/net/route/sys_freebsd.go
diff --git a/src/vendor/golang.org/x/net/route/sys_netbsd.go b/src/vendor/golang_org/x/net/route/sys_netbsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/sys_netbsd.go
rename to src/vendor/golang_org/x/net/route/sys_netbsd.go
diff --git a/src/vendor/golang.org/x/net/route/sys_openbsd.go b/src/vendor/golang_org/x/net/route/sys_openbsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/sys_openbsd.go
rename to src/vendor/golang_org/x/net/route/sys_openbsd.go
diff --git a/src/vendor/golang.org/x/net/route/syscall.go b/src/vendor/golang_org/x/net/route/syscall.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/syscall.go
rename to src/vendor/golang_org/x/net/route/syscall.go
diff --git a/src/vendor/golang.org/x/net/route/syscall.s b/src/vendor/golang_org/x/net/route/syscall.s
similarity index 100%
rename from src/vendor/golang.org/x/net/route/syscall.s
rename to src/vendor/golang_org/x/net/route/syscall.s
diff --git a/src/vendor/golang.org/x/net/route/zsys_darwin.go b/src/vendor/golang_org/x/net/route/zsys_darwin.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/zsys_darwin.go
rename to src/vendor/golang_org/x/net/route/zsys_darwin.go
diff --git a/src/vendor/golang.org/x/net/route/zsys_dragonfly.go b/src/vendor/golang_org/x/net/route/zsys_dragonfly.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/zsys_dragonfly.go
rename to src/vendor/golang_org/x/net/route/zsys_dragonfly.go
diff --git a/src/vendor/golang.org/x/net/route/zsys_freebsd_386.go b/src/vendor/golang_org/x/net/route/zsys_freebsd_386.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/zsys_freebsd_386.go
rename to src/vendor/golang_org/x/net/route/zsys_freebsd_386.go
diff --git a/src/vendor/golang.org/x/net/route/zsys_freebsd_amd64.go b/src/vendor/golang_org/x/net/route/zsys_freebsd_amd64.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/zsys_freebsd_amd64.go
rename to src/vendor/golang_org/x/net/route/zsys_freebsd_amd64.go
diff --git a/src/vendor/golang.org/x/net/route/zsys_freebsd_arm.go b/src/vendor/golang_org/x/net/route/zsys_freebsd_arm.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/zsys_freebsd_arm.go
rename to src/vendor/golang_org/x/net/route/zsys_freebsd_arm.go
diff --git a/src/vendor/golang.org/x/net/route/zsys_netbsd.go b/src/vendor/golang_org/x/net/route/zsys_netbsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/zsys_netbsd.go
rename to src/vendor/golang_org/x/net/route/zsys_netbsd.go
diff --git a/src/vendor/golang.org/x/net/route/zsys_openbsd.go b/src/vendor/golang_org/x/net/route/zsys_openbsd.go
similarity index 100%
rename from src/vendor/golang.org/x/net/route/zsys_openbsd.go
rename to src/vendor/golang_org/x/net/route/zsys_openbsd.go

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-golang/golang.git



More information about the pkg-golang-commits mailing list