1. 11 Aug, 2014 4 commits
  2. 01 Aug, 2014 1 commit
  3. 25 Jul, 2014 1 commit
  4. 19 Jun, 2014 1 commit
  5. 18 Jun, 2014 3 commits
  6. 17 Jun, 2014 2 commits
  7. 13 Jun, 2014 3 commits
  8. 12 Jun, 2014 5 commits
  9. 11 Jun, 2014 6 commits
  10. 07 Jun, 2014 4 commits
  11. 05 Jun, 2014 1 commit
  12. 04 Jun, 2014 2 commits
  13. 03 Jun, 2014 7 commits
    • Russ Cox's avatar
      [release-branch.go1.3] crypto/tls: fix typo referencing the required Config field · 764cb069
      Russ Cox authored
      ««« CL 107740043 / d86ec79a5f30
      crypto/tls: fix typo referencing the required Config field
      
      Thanks to Frithjof Schulze for noticing.
      
      LGTM=adg
      R=adg
      CC=agl, golang-codereviews, r
      https://golang.org/cl/107740043
      
      »»»
      
      LGTM=r
      R=golang-codereviews, r
      CC=bradfitz, golang-codereviews, iant
      https://golang.org/cl/103020043
      764cb069
    • Russ Cox's avatar
      [release-branch.go1.3] cmd/gc: fix escape analysis of func returning indirect of parameter · 9381fe2d
      Russ Cox authored
      ««« CL 102040046 / a078b2056ebc
      cmd/gc: fix escape analysis of func returning indirect of parameter
      
      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
      »»»
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews
      https://golang.org/cl/103870043
      9381fe2d
    • David Symonds's avatar
      [release-branch.go1.3] time: support version 3 zone records · 53479b82
      David Symonds authored
      ««« CL 100930044 / fde405c62fca
      time: support version 3 zone records
      
      Fixes #8134
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews, r, rsc
      https://golang.org/cl/100930044
      »»»
      
      LGTM=rsc
      R=adg, rsc
      CC=golang-codereviews
      https://golang.org/cl/96690043
      53479b82
    • David Symonds's avatar
      [release-branch.go1.3] cmd/gc: fix liveness for address-taken variables in inlined functions · a1fa208f
      David Symonds authored
      ««« CL 96670046 / 1bec455e95f1
      cmd/gc: fix liveness for address-taken variables in inlined functions
      
      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
      »»»
      
      TBR=adg
      R=adg
      CC=golang-codereviews
      https://golang.org/cl/103810046
      a1fa208f
    • David Symonds's avatar
      [release-branch.go1.3] runtime: fix 1-byte return during x.(T) for 0-byte T · f096cad5
      David Symonds authored
      ««« CL 100940043 / 93baf7bea171
      runtime: fix 1-byte return during x.(T) for 0-byte T
      
      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
      »»»
      
      TBR=adg
      CC=golang-codereviews
      https://golang.org/cl/105760045
      f096cad5
    • David Symonds's avatar
      [release-branch.go1.3] cmd/gc: don't generate zillions of linehists for wrapper functions · f34a051a
      David Symonds authored
      ««« CL 104840043 / 876107512a67
      cmd/gc: don't generate zillions of linehists for wrapper functions
      This is a workaround - the code should be better than this - but the
      fix avoids generating large numbers of linehist entries for the wrapper
      functions that enable interface conversions. There can be many of
      them, they all happen at the end of compilation, and they can all
      share a linehist entry.
      Avoids bad n^2 behavior in liblink.
      Test case in issue 8135 goes from 64 seconds to 2.5 seconds (still bad
      but not intolerable).
      
      Fixes #8135.
      
      LGTM=rsc
      R=rsc
      CC=golang-codereviews
      https://golang.org/cl/104840043
      »»»
      
      TBR=adg
      CC=golang-codereviews
      https://golang.org/cl/102070045
      f34a051a
    • David Symonds's avatar
      [release-branch.go1.3] cmd/cgo: use same Go type for typedef to anonymous struct · e82cde2d
      David Symonds authored
      ««« CL 102080043 / 256d975c53cb
      cmd/cgo: use same Go type for typedef to anonymous struct
      
      If we see a typedef to an anonymous struct more than once,
      presumably in two different Go files that import "C", use the
      same Go type name.
      
      Fixes #8133.
      
      LGTM=rsc
      R=rsc
      CC=golang-codereviews
      https://golang.org/cl/102080043
      »»»
      
      TBR=adg
      CC=golang-codereviews
      https://golang.org/cl/102100043
      e82cde2d