1. 11 Dec, 2017 4 commits
    • 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 13 commits
  6. 06 Dec, 2017 2 commits
    • Joe Tsai's avatar
      encoding/json: error when trying to set an embedded pointer to unexported struct types · 70f441bc
      Joe Tsai authored
      This CL reverts CL 76851 and takes a different approach to #21357.
      The changes in encode.go and encode_test.go are reverts that
      rolls back the changed behavior in CL 76851 where
      embedded pointers to unexported struct types were
      unilaterally ignored in both marshal and unmarshal.
      
      Instead, these fields are handled as before with the exception that
      it returns an error when Unmarshal is unable to set an unexported field.
      The behavior of Marshal is now unchanged with regards to #21357.
      
      This policy maintains the greatest degree of backwards compatibility
      and avoids silently discarding data the user may have expected to be present.
      
      Fixes #21357
      
      Change-Id: I7dc753280c99f786ac51acf7e6c0246618c8b2b1
      Reviewed-on: https://go-review.googlesource.com/82135
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      70f441bc
    • Tobias Klauser's avatar
      lib/time: update tzdata to 2017c · 0e76143e
      Tobias Klauser authored
      Update the tzdata database to version 2017c (released 2017-10-20).
      
      Updates #22487
      
      Change-Id: If58ff89173ef1f1044075505f42ff132b57795f0
      Reviewed-on: https://go-review.googlesource.com/74230Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0e76143e