1. 11 Dec, 2017 7 commits
    • Andrew Bonventre's avatar
      doc: fix misuse of “substantive” in 1.10 release notes · 05deefee
      Andrew Bonventre authored
      Use “substantial”, which is believed to be the correct word.
      Additionally, this change strips trailing whitespace from the file.
      
      Change-Id: I5b6b718fc09e4b8b911b95e8be0733abd58e165d
      Reviewed-on: https://go-review.googlesource.com/83356Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      05deefee
    • Brad Fitzpatrick's avatar
      strings: fix two Builder bugs allowing mutation of strings, remove ReadFrom · 3058d386
      Brad Fitzpatrick authored
      The Builder's ReadFrom method allows the underlying unsafe slice to
      escape, and for callers to subsequently modify memory that had been
      unsafely converted into an immutable string.
      
      In the original proposal for Builder (#18990), I'd noted there should
      be no Read methods:
      
      > There would be no Reset or Bytes or Truncate or Read methods.
      > Nothing that could mutate the []byte once it was unsafely converted
      > to a string.
      
      And in my prototype (https://golang.org/cl/37767), I handled ReadFrom
      properly, but when https://golang.org/cl/74931 arrived, I missed that
      it had a ReadFrom method and approved it.
      
      Because we're so close to the Go 1.10 release, just remove the
      ReadFrom method rather than think about possible fixes. It has
      marginal utility in a Builder anyway.
      
      Also, fix a separate bug that also allowed mutation of a slice's
      backing array after it had been converted into a slice by disallowing
      copies of the Builder by value.
      
      Updates #18990
      Fixes #23083
      Fixes #23084
      
      Change-Id: Id1f860f8a4f5f88b32213cf85108ebc609acb95f
      Reviewed-on: https://go-review.googlesource.com/83255Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      3058d386
    • Russ Cox's avatar
      cmd/go: invalidate cached test results if env vars or files change · 29be20a1
      Russ Cox authored
      When we write a cached test result, we now also write a log of the
      environment variables and files inspected by the test run,
      along with a hash of their content. Before reusing a cached test result,
      we recompute the hash of the content specified by the log, and only
      use the result if that content has not changed.
      
      This makes test caching behave correctly for tests that consult
      environment variables or stat or read files or directories.
      
      Fixes #22593.
      
      Change-Id: I8608798e73c90e0c1911a38bf7e03e1232d784dc
      Reviewed-on: https://go-review.googlesource.com/81895
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      29be20a1
    • Wèi Cōngruì's avatar
      internal/poll: fix error in increfAndClose documentation · 8c227765
      Wèi Cōngruì authored
      Change-Id: I0c387b6286bc18fd00c6ac4e42bdf175cf89ccb1
      Reviewed-on: https://go-review.googlesource.com/83155Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      8c227765
    • Austin Clements's avatar
      runtime: reset write barrier buffer on all flush paths · 043f112e
      Austin Clements authored
      Currently, wbBufFlush does nothing if the goroutine is dying on the
      assumption that the system is crashing anyway and running the write
      barrier may crash it even more. However, it fails to reset the
      buffer's "next" pointer. As a result, if there are later write
      barriers on the same P, the write barrier will overflow the write
      barrier buffer and start corrupting other fields in the P or other
      heap objects. Often, this corrupts fields in the next allocated P
      since they tend to be together in the heap.
      
      Fix this by always resetting the buffer's "next" pointer, even if
      we're not doing anything with the pointers in the buffer.
      
      Updates #22987 and #22988. (May fix; it's hard to say.)
      
      Change-Id: I82c11ea2d399e1658531c3e8065445a66b7282b2
      Reviewed-on: https://go-review.googlesource.com/83016
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      043f112e
    • Austin Clements's avatar
      runtime: mark heapBits.bits nosplit · 3675bff5
      Austin Clements authored
      heapBits.bits is used during bulkBarrierPreWrite via
      heapBits.isPointer, which means it must not be preempted. If it is
      preempted, several bad things can happen:
      
      1. This could allow a GC phase change, and the resulting shear between
      the barriers and the memory writes could result in a lost pointer.
      
      2. Since bulkBarrierPreWrite uses the P's local write barrier buffer,
      if it also migrates to a different P, it could try to append to the
      write barrier buffer concurrently with another write barrier. This can
      result in the buffer's next pointer skipping over its end pointer,
      which results in a buffer overflow that can corrupt arbitrary other
      fields in the Ps (or anything in the heap, really, but it'll probably
      crash from the corrupted P quickly).
      
      Fix this by marking heapBits.bits go:nosplit. This would be the
      perfect use for a recursive no-preempt annotation (#21314).
      
      This doesn't actually affect any binaries because this function was
      always inlined anyway. (I discovered it when I was modifying heapBits
      and make h.bits() no longer inline, which led to rampant crashes from
      problem 2 above.)
      
      Updates #22987 and #22988 (but doesn't fix because it doesn't actually
      change the generated code).
      
      Change-Id: I60ebb928b1233b0613361ac3d0558d7b1cb65610
      Reviewed-on: https://go-review.googlesource.com/83015
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3675bff5
    • Brad Fitzpatrick's avatar
      doc: update NetBSD status · 0da486dc
      Brad Fitzpatrick authored
      Fixes #23073
      
      Change-Id: Ia43b28beeff9e57579caf5dcb76146ee29d5033b
      Reviewed-on: https://go-review.googlesource.com/82918Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      0da486dc
  2. 10 Dec, 2017 2 commits
  3. 09 Dec, 2017 2 commits
  4. 08 Dec, 2017 17 commits
  5. 07 Dec, 2017 12 commits