1. 07 Oct, 2014 6 commits
    • Russ Cox's avatar
      runtime: crash if we see an invalid pointer into GC arena · 11e53e46
      Russ Cox authored
      This will help find bugs during the release freeze.
      It's not clear it should be kept for the release itself.
      That's issue 8861.
      
      The most likely thing that would trigger this is stale
      pointers that previously were ignored or caused memory
      leaks. These were allowed due to the use of conservative
      collection. Now that everything is precise, we should not
      see them anymore.
      
      The small number check reinforces what the stack copier
      is already doing, catching the storage of integers in pointers.
      It caught issue 8864.
      
      The check is disabled if _cgo_allocate is linked into the binary,
      which is to say if the binary is using SWIG to allocate untyped
      Go memory. In that case, there are invalid pointers and there's
      nothing we can do about it.
      
      LGTM=rlh
      R=golang-codereviews, dvyukov, rlh
      CC=golang-codereviews, iant, khr, r
      https://golang.org/cl/148470043
      11e53e46
    • Russ Cox's avatar
      encoding/json: fix handling of null with ,string fields · 7b2b8ede
      Russ Cox authored
      Fixes #8587.
      
      LGTM=bradfitz
      R=golang-codereviews, bradfitz
      CC=golang-codereviews, iant, r
      https://golang.org/cl/152270044
      7b2b8ede
    • Russ Cox's avatar
      runtime: remove type-punning for Type.gc[0], gc[1] · 18172c42
      Russ Cox authored
      Depending on flags&KindGCProg,
      gc[0] and gc[1] are either pointers or inlined bitmap bits.
      That's not compatible with a precise garbage collector:
      it needs to be always pointers or never pointers.
      
      Change the inlined bitmap case to store a pointer to an
      out-of-line bitmap in gc[0]. The out-of-line bitmaps are
      dedup'ed, so that for example all pointer types share the
      same out-of-line bitmap.
      
      Fixes #8864.
      
      LGTM=r
      R=golang-codereviews, dvyukov, r
      CC=golang-codereviews, iant, khr, rlh
      https://golang.org/cl/155820043
      18172c42
    • Jens Frederich's avatar
      net/http: fix authentication info leakage in Referer header (potential security risk) · f739b775
      Jens Frederich authored
      http.Client calls URL.String() to fill in the Referer header, which may
      contain authentication info. This patch removes authentication info from
      the Referer header without introducing any API changes.
      
      A new test for net/http is also provided.
      
      This is the polished version of Alberto García Hierro's
      https://golang.org/cl/9766046/
      
      It should handle https Referer right.
      
      Fixes #8417
      
      LGTM=bradfitz
      R=golang-codereviews, gobot, bradfitz, mikioh.mikioh
      CC=golang-codereviews
      https://golang.org/cl/151430043
      f739b775
    • Brad Fitzpatrick's avatar
      doc/go1.4.txt: useless change to tickle builders · 6e8f7b4f
      Brad Fitzpatrick authored
      Debugging the builders and need a commit to make them run.
      
      R=adg
      CC=golang-codereviews
      https://golang.org/cl/149600043
      6e8f7b4f
    • Russ Cox's avatar
      cmd/ld: ignore .Linfo_stringNN variables in clang .o files · 82a5e95c
      Russ Cox authored
      http://build.golang.org/log/c7a91b6eac8f8daa2bd17801be273e58403a15f2
      
      # cmd/pprof
      /linux-386-clang-9115aad1dc4a/go/pkg/linux_386/net.a(_all.o): sym#16: ignoring .Linfo_string0 in section 16 (type 0)
      /linux-386-clang-9115aad1dc4a/go/pkg/linux_386/net.a(_all.o): sym#17: ignoring .Linfo_string1 in section 16 (type 0)
      /linux-386-clang-9115aad1dc4a/go/pkg/linux_386/net.a(_all.o): sym#18: ignoring .Linfo_string2 in section 16 (type 0)
      /linux-386-clang-9115aad1dc4a/go/pkg/linux_386/net.a(_all.o): sym#20: ignoring .Linfo_string0 in section 16 (type 0)
      /linux-386-clang-9115aad1dc4a/go/pkg/linux_386/net.a(_all.o): sym#21: ignoring .Linfo_string1 in section 16 (type 0)
      ...
      
      I don't know what these are. Let's ignore them and see if we get any further.
      
      TBR=iant
      CC=golang-codereviews
      https://golang.org/cl/155030043
      82a5e95c
  2. 06 Oct, 2014 16 commits
  3. 05 Oct, 2014 1 commit
  4. 04 Oct, 2014 4 commits
  5. 03 Oct, 2014 7 commits
  6. 02 Oct, 2014 6 commits
    • Rob Pike's avatar
      fmt: make the %#v verb a special flag · 7c8e057a
      Rob Pike authored
      The %#v verb is special: it says all values below need to print as %#v.
      However, for some situations the # flag has other meanings and this
      causes some issues, particularly in how Formatters work. Since %#v
      dominates all formatting, translate it into actual state of the formatter
      and decouple it from the # flag itself within the calculations (although
      it must be restored when methods are doing the work.)
      The result is cleaner code and correct handling of # for Formatters.
      TODO: Apply the same thinking to the + flag in a followup CL.
      
      Also, the wasString return value in handleMethods is always false,
      so eliminate it.
      
      Update #8835
      
      LGTM=iant
      R=golang-codereviews, iant
      CC=golang-codereviews
      https://golang.org/cl/146650043
      7c8e057a
    • Robert Griesemer's avatar
      math/big: math.Exp should return result >= 0 for |m| > 0 · 28ddfb09
      Robert Griesemer authored
      The documentation states that Exp(x, y, m)
      computes x**y mod |m| for m != nil && m > 0.
      In math.big, Mod is the Euclidean modulus,
      which is always >= 0.
      
      Fixes #8822.
      
      LGTM=agl, r, rsc
      R=agl, r, rsc
      CC=golang-codereviews
      https://golang.org/cl/145650043
      28ddfb09
    • Robert Griesemer's avatar
      encoding/binary: fix error message · 1dba6eb4
      Robert Griesemer authored
      In the process, simplified internal sizeOf and
      dataSize functions. Minor positive impact on
      performance. Added test case.
      
      benchmark                         old ns/op     new ns/op     delta
      BenchmarkReadSlice1000Int32s      14006         14122         +0.83%
      BenchmarkReadStruct               2508          2447          -2.43%
      BenchmarkReadInts                 921           928           +0.76%
      BenchmarkWriteInts                2086          2081          -0.24%
      BenchmarkWriteSlice1000Int32s     13440         13497         +0.42%
      BenchmarkPutUvarint32             28.5          26.3          -7.72%
      BenchmarkPutUvarint64             81.3          76.7          -5.66%
      
      benchmark                         old MB/s     new MB/s     speedup
      BenchmarkReadSlice1000Int32s      285.58       283.24       0.99x
      BenchmarkReadStruct               27.90        28.60        1.03x
      BenchmarkReadInts                 32.57        32.31        0.99x
      BenchmarkWriteInts                14.38        14.41        1.00x
      BenchmarkWriteSlice1000Int32s     297.60       296.36       1.00x
      BenchmarkPutUvarint32             140.55       151.92       1.08x
      BenchmarkPutUvarint64             98.36        104.33       1.06x
      
      Fixes #6818.
      
      LGTM=r
      R=r
      CC=golang-codereviews
      https://golang.org/cl/149290045
      1dba6eb4
    • Mrunal Patel's avatar
      syscall: support UID/GID map files for Linux user namespaces · f9d7e139
      Mrunal Patel authored
      Fixes #8447.
      
      LGTM=iant
      R=golang-codereviews, bradfitz, iant
      CC=golang-codereviews
      https://golang.org/cl/126190043
      f9d7e139
    • Ian Lance Taylor's avatar
      A+C: add Mrunal Patel (Red Hat corporate CLA) · ea491c5f
      Ian Lance Taylor authored
      LGTM=bradfitz
      R=golang-codereviews, bradfitz
      CC=golang-codereviews
      https://golang.org/cl/152010043
      ea491c5f
    • Nicolas Owens's avatar
      syscall: fix Setenv for plan 9 · e9d5fca9
      Nicolas Owens authored
      envi needs to be updated during Setenv so the key can be correctly deleted later with Unsetenv.
      
      Update #8849.
      
      LGTM=0intro
      R=bradfitz, 0intro
      CC=golang-codereviews
      https://golang.org/cl/149300046
      e9d5fca9