1. 12 Jun, 2014 7 commits
  2. 11 Jun, 2014 7 commits
  3. 10 Jun, 2014 4 commits
  4. 06 Jun, 2014 1 commit
    • Russ Cox's avatar
      runtime: fix panic stack during runtime.Goexit during panic · 4534fdb1
      Russ Cox authored
      A runtime.Goexit during a panic-invoked deferred call
      left the panic stack intact even though all the stack frames
      are gone when the goroutine is torn down.
      The next goroutine to reuse that struct will have a
      bogus panic stack and can cause the traceback routines
      to walk into garbage.
      
      Most likely to happen during tests, because t.Fatal might
      be called during a deferred func and uses runtime.Goexit.
      
      This "not enough cleared in Goexit" failure mode has
      happened to us multiple times now. Clear all the pointers
      that don't make sense to keep, not just gp->panic.
      
      Fixes #8158.
      
      LGTM=iant, dvyukov
      R=iant, dvyukov
      CC=golang-codereviews
      https://golang.org/cl/102220043
      4534fdb1
  5. 05 Jun, 2014 4 commits
  6. 04 Jun, 2014 1 commit
  7. 03 Jun, 2014 7 commits
    • Ian Lance Taylor's avatar
      debug/elf: support DWARF that needs relocs for 386 · 0e197515
      Ian Lance Taylor authored
      It's not clear how widespread this issue is, but we do have a
      test case generated by a development version of clang.
      
      I don't know whether this should go into 1.3 or not; happy to
      hear arguments either way.
      
      LGTM=rsc
      R=golang-codereviews, bradfitz, rsc
      CC=golang-codereviews
      https://golang.org/cl/96680045
      0e197515
    • Ian Lance Taylor's avatar
      compress/gzip: allow Reset on Reader without NewReader · 68bbf9d4
      Ian Lance Taylor authored
      Fixes #8126.
      
      LGTM=bradfitz
      R=golang-codereviews, bradfitz
      CC=golang-codereviews
      https://golang.org/cl/103020044
      68bbf9d4
    • Russ Cox's avatar
      cmd/gc: fix escape analysis of func returning indirect of parameter · fe3c9134
      Russ Cox authored
      I introduced this bug when I changed the escape
      analysis to run in phases based on call graph
      dependency order, in order to be more precise about
      inputs escaping back to outputs (functions returning
      their arguments).
      
      Given
      
              func f(z **int) *int { return *z }
      
      we were tagging the function as 'z does not escape
      and is not returned', which is all true, but not
      enough information.
      
      If used as:
      
              var x int
              p := &x
              q := &p
              leak(f(q))
      
      then the compiler might try to keep x, p, and q all
      on the stack, since (according to the recorded
      information) nothing interesting ends up being
      passed to leak.
      
      In fact since f returns *q = p, &x is passed to leak
      and x needs to be heap allocated.
      
      To trigger the bug, you need a chain that the
      compiler wants to keep on the stack (like x, p, q
      above), and you need a function that returns an
      indirect of its argument, and you need to pass the
      head of the chain to that function. This doesn't
      come up very often: this bug has been present since
      June 2012 (between Go 1 and Go 1.1) and we haven't
      seen it until now. It helps that most functions that
      return indirects are getters that are simple enough
      to be inlined, avoiding the bug.
      
      Earlier versions of Go also had the benefit that if
      &x really wasn't used beyond x's lifetime, nothing
      broke if you put &x in a heap-allocated structure
      accidentally. With the new stack copying, though,
      heap-allocated structures containing &x are not
      updated when the stack is copied and x moves,
      leading to crashes in Go 1.3 that were not crashes
      in Go 1.2 or Go 1.1.
      
      The fix is in two parts.
      
      First, in the analysis of a function, recognize when
      a value obtained via indirect of a parameter ends up
      being returned. Mark those parameters as having
      content escape back to the return results (but we
      don't bother to write down which result).
      
      Second, when using the analysis to analyze, say,
      f(q), mark parameters with content escaping as
      having any indirections escape to the heap. (We
      don't bother trying to match the content to the
      return value.)
      
      The fix could be less precise (simpler).
      In the first part we might mark all content-escaping
      parameters as plain escaping, and then the second
      part could be dropped. Or we might assume that when
      calling f(q) all the things pointed at by q escape
      always (for any f and q).
      
      The fix could also be more precise (more complex).
      We might record the specific mapping from parameter
      to result along with the number of indirects from the
      parameter to the thing being returned as the result,
      and then at the call sites we could set up exactly the
      right graph for the called function. That would make
      notleaks(f(q)) be able to keep x on the stack, because
      the reuslt of f(q) isn't passed to anything that leaks it.
      
      The less precise the fix, the more stack allocations
      become heap allocations.
      
      This fix is exactly as precise as it needs to be so that
      none of the current stack allocations in the standard
      library turn into heap allocations.
      
      Fixes #8120.
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews, khr, r
      https://golang.org/cl/102040046
      fe3c9134
    • Brad Fitzpatrick's avatar
      crypto/tls: fix typo referencing the required Config field · 19fe9a2c
      Brad Fitzpatrick authored
      Thanks to Frithjof Schulze for noticing.
      
      LGTM=adg
      R=adg
      CC=agl, golang-codereviews, r
      https://golang.org/cl/107740043
      19fe9a2c
    • Brad Fitzpatrick's avatar
      time: support version 3 zone records · 14a75ecf
      Brad Fitzpatrick authored
      Fixes #8134
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews, r, rsc
      https://golang.org/cl/100930044
      14a75ecf
    • Russ Cox's avatar
      cmd/gc: fix liveness for address-taken variables in inlined functions · eb540792
      Russ Cox authored
      The 'address taken' bit in a function variable was not
      propagating into the inlined copies, causing incorrect
      liveness information.
      
      LGTM=dsymonds, bradfitz
      R=golang-codereviews, bradfitz
      CC=dsymonds, golang-codereviews, iant, khr, r
      https://golang.org/cl/96670046
      eb540792
    • Russ Cox's avatar
      runtime: fix 1-byte return during x.(T) for 0-byte T · d646040f
      Russ Cox authored
      The 1-byte write was silently clearing a byte on the stack.
      If there was another function call with more arguments
      in the same stack frame, no harm done.
      Otherwise, if the variable at that location was already zero,
      no harm done.
      Otherwise, problems.
      
      Fixes #8139.
      
      LGTM=dsymonds
      R=golang-codereviews, dsymonds
      CC=golang-codereviews, iant, r
      https://golang.org/cl/100940043
      d646040f
  8. 02 Jun, 2014 8 commits
  9. 01 Jun, 2014 1 commit