1. 17 Jul, 2015 3 commits
    • Austin Clements's avatar
      runtime: don't free large spans until heapBitsSweepSpan returns · cc8f5441
      Austin Clements authored
      This fixes a race between 1) sweeping and freeing an unmarked large
      span and 2) reusing that span and allocating from it. This race arises
      because mSpan_Sweep returns spans for large objects to the heap
      *before* heapBitsSweepSpan clears the mark bit on the object in the
      span.
      
      Specifically, the following sequence of events can lead to an
      incorrectly zeroed bitmap byte, which causes the garbage collector to
      not trace any pointers in that object (the pointer bits for the first
      four words are cleared, and the scan bits are also cleared, so it
      looks like a no-scan object).
      
      1) P0 calls mSpan_Sweep on a large span S0 with an unmarked object on it.
      
      2) mSpan_Sweep calls heapBitsSweepSpan, which invokes the callback for
         the one (unmarked) object on the span.
      
      3) The callback calls mHeap_Free, which makes span S0 available for
         allocation, but this is too early.
      
      4) P1 grabs this S0 from the heap to use for allocation.
      
      5) P1 allocates an object on this span and writes that object's type
         bits to the bitmap.
      
      6) P0 returns from the callback to heapBitsSweepSpan.
         heapBitsSweepSpan clears the byte containing the mark, even though
         this span is now owned by P1 and this byte contains important
         bitmap information.
      
      This fixes this problem by simply delaying the mHeap_Free until after
      the heapBitsSweepSpan. I think the overall logic of mSpan_Sweep could
      be simplified now, but this seems like the minimal change.
      
      Fixes #11617.
      
      Change-Id: I6b1382c7e7cc35f81984467c0772fe9848b7522a
      Reviewed-on: https://go-review.googlesource.com/12320
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      cc8f5441
    • Rob Pike's avatar
      cmd/fix: add gotypes module · 5c62e5f9
      Rob Pike authored
      Adjusts for the move from golang.org/x/tools/go/types and .../go/exact
      to go/types and go/constant in the main repository.
      
      Change-Id: I0da7248c540939e3e9b09c915b0a296937f1be73
      Reviewed-on: https://go-review.googlesource.com/12284Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      5c62e5f9
    • Mikio Hara's avatar
      cmd/go: don't put mycmd in wrong directory · 29ffa4bd
      Mikio Hara authored
      Change-Id: Ia7cc1d52211b32a2eb2b3888d621b28d6932aca9
      Reviewed-on: https://go-review.googlesource.com/12290Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      29ffa4bd
  2. 16 Jul, 2015 11 commits
  3. 15 Jul, 2015 26 commits