1. 31 Jul, 2017 2 commits
    • Austin Clements's avatar
      [release-branch.go1.9] runtime: map bitmap and spans during heap initialization · 196492a2
      Austin Clements authored
      We lazily map the bitmap and spans areas as the heap grows. However,
      right now we're very slightly too lazy. Specifically, the following
      can happen on 32-bit:
      
      1. mallocinit fails to allocate any heap arena, so
         arena_used == arena_alloc == arena_end == bitmap.
      
      2. There's less than 256MB between the end of the bitmap mapping and
         the next mapping.
      
      3. On the first allocation, mheap.sysAlloc sees that there's not
         enough room in [arena_alloc, arena_end) because there's no room at
         all. It gets a 256MB mapping from somewhere *lower* in the address
         space than arena_used and sets arena_alloc and arena_end to this
         hole.
      
      4. Since the new arena_alloc is lower than arena_used, mheap.sysAlloc
         doesn't bother to call mheap.setArenaUsed, so we still don't have a
         bitmap mapping or a spans array mapping.
      
      5. mheap.grow, which called mheap.sysAlloc, attempts to fill in the
         spans array and crashes.
      
      Fix this by mapping the metadata regions for the initial arena_used
      when the heap is initialized, rather than trying to wait for an
      allocation. This maintains the intended invariant that the structures
      are always mapped for [arena_start, arena_used).
      
      Fixes #21044.
      
      Cherry-pick of CL 51714. Fixes #21234.
      
      Change-Id: I4422375a6e234b9f979d22135fc63ae3395946b0
      Reviewed-on: https://go-review.googlesource.com/52191
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      196492a2
    • Austin Clements's avatar
      [release-branch.go1.9] runtime: fall back to small mmaps if we fail to grow reservation · 1a6d87d4
      Austin Clements authored
      Right now, if it's possible to grow the arena reservation but
      mheap.sysAlloc fails to get 256MB more of memory, it simply fails.
      However, on 32-bit we have a fallback path that uses much smaller
      mmaps that could take in this situation, but fail to.
      
      This commit fixes mheap.sysAlloc to use a common failure path in case
      it can't grow the reservation. On 32-bit, this path includes the
      fallback.
      
      Ideally, mheap.sysAlloc would attempt smaller reservation growths
      first, but taking the fallback path is a simple change for Go 1.9.
      
      Updates #21044 (fixes one of two issues).
      
      Cherry-pick of CL 51713. Updates #21234.
      
      Change-Id: I1e0035ffba986c3551479d5742809e43da5e7c73
      Reviewed-on: https://go-review.googlesource.com/52190
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      1a6d87d4
  2. 27 Jul, 2017 1 commit
  3. 24 Jul, 2017 5 commits
  4. 22 Jul, 2017 1 commit
    • Joe Tsai's avatar
      encoding/json: ignore embedded fields of pointers to unexported non-structs · b8173592
      Joe Tsai authored
      https://golang.org/cl/33773 fixes the JSON marshaler to avoid serializing
      embedded fields on unexported types of non-struct types. However, Go allows
      embedding pointer to types, so the check for whether the field is a non-struct
      type must first dereference the pointer to get at the underlying type.
      
      Furthermore, due to a edge-case in the behavior of StructField.PkgPath not
      being a reliable indicator of whether the field is unexported (see #21122),
      we use our own logic to determine whether the field is exported or not.
      
      The logic in this CL may be simplified depending on what happens in #21122.
      
      Fixes #21121
      Updates #21122
      
      Change-Id: I8dfd1cdfac8a87950df294a566fb96dfd04fd749
      Reviewed-on: https://go-review.googlesource.com/50711Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      b8173592
  5. 21 Jul, 2017 5 commits
  6. 20 Jul, 2017 8 commits
  7. 19 Jul, 2017 4 commits
  8. 18 Jul, 2017 5 commits
    • Ian Lance Taylor's avatar
      net/http: fix parameter name in comment · 83fb9c8d
      Ian Lance Taylor authored
      Fixes #21077
      
      Change-Id: Ic61d7313907f58ff4027fd2eee1ddb8c1656304d
      Reviewed-on: https://go-review.googlesource.com/49712Reviewed-by: default avatarDmitri Shuralyov <shurcool@gmail.com>
      83fb9c8d
    • Austin Clements's avatar
      runtime: move tSweepTerm capture closer to STW · 73d02735
      Austin Clements authored
      tSweepTerm and pauseStart are supposed to be when STW was triggered,
      but right now they're captured a bit before STW. Move these down to
      immediately before we trigger STW.
      
      Fixes #19590.
      
      Change-Id: Icd48a5c4d45c9b36187ff986e4f178b5064556c1
      Reviewed-on: https://go-review.googlesource.com/49612
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      73d02735
    • Austin Clements's avatar
      runtime: always use 2MB stacks on 64-bit Windows · c2c07c79
      Austin Clements authored
      Currently, Windows stacks are either 128kB or 2MB depending on whether
      the binary uses cgo. This is because we assume that Go system stacks
      and the small amount of C code invoked by the standard library can
      operate within smaller stacks, but general Windows C code assumes
      larger stacks.
      
      However, it's easy to call into arbitrary C code using the syscall
      package on Windows without ever importing cgo into a binary. Such
      binaries need larger system stacks even though they don't use cgo.
      
      Fix this on 64-bit by increasing the system stack size to 2MB always.
      This only costs address space, which is free enough on 64-bit to not
      worry about. We keep (for now) the existing heuristic on 32-bit, where
      address space comes at more of a premium.
      
      Updates #20975.
      
      Change-Id: Iaaaa9a2fcbadc825cddc797aaaea8d34ef8debf2
      Reviewed-on: https://go-review.googlesource.com/49331
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAlex Brainman <alex.brainman@gmail.com>
      c2c07c79
    • Alexey Palazhchenko's avatar
      database/sql: fix wrong method name in description · e9b9dfe3
      Alexey Palazhchenko authored
      Change-Id: Ie6a88b70d7c45c59995ee2f57fb28f9a3cbb404d
      Reviewed-on: https://go-review.googlesource.com/49470Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e9b9dfe3
    • Brad Fitzpatrick's avatar
      A+C: final updates for Go 1.9 · 235aff0a
      Brad Fitzpatrick authored
      Add Adam Kisala (individual CLA)
      Add Aditya Mukerjee (individual CLA)
      Add Akhil Indurti (individual CLA)
      Add André Carvalho (individual CLA)
      Add Andy Walker (individual CLA)
      Add Awn Umar (individual CLA)
      Add Bastian Ike (individual CLA)
      Add Brian Downs (individual CLA)
      Add Cody Oss (individual CLA)
      Add Costin Chirvasuta (corporate CLA for Google Inc.)
      Add Dan Ballard (individual CLA)
      Add Dong-hee Na (individual CLA)
      Add Dylan Waits (individual CLA)
      Add Evan Hicks (individual CLA)
      Add Fannie Zhang (corporate CLA for ARM Ltd.)
      Add Francisco Rojas (individual CLA)
      Add Gabriel Nicolas Avellaneda (individual CLA)
      Add Gabríel Arthúr Pétursson (individual CLA)
      Add Greg Poirier (individual CLA)
      Add Iccha Sethi (individual CLA)
      Add Ivan Moscoso (individual CLA)
      Add Jamie Kerr (individual CLA)
      Add Joe Kyo (individual CLA)
      Add Joey Geiger (individual CLA)
      Add John R. Lenton (individual CLA)
      Add Johnny Luo (individual CLA)
      Add Josh Roppo (individual CLA)
      Add Kate Manson (individual CLA)
      Add Leo Rudberg (corporate CLA for Google Inc.)
      Add Ma Peiqi (individual CLA)
      Add Martynas Budriūnas (corporate CLA for Google Inc.)
      Add Maryan Hratson (individual CLA)
      Add Michael Edwards (individual CLA)
      Add Michael Hendricks (individual CLA)
      Add Pablo Santiago Blum de Aguiar (individual CLA)
      Add Pat Moroney (individual CLA)
      Add Shi Han Ng (individual CLA)
      Add Steven Buss (corporate CLA for Google Inc.)
      Add Suzy Mueller (corporate CLA for Google Inc.)
      Add Taro Aoki (individual CLA)
      Add Tim Heckman (individual CLA)
      Add Tony Walker (individual CLA)
      Add Yasha Bubnov (individual CLA)
      
      Updates #12042
      
      Change-Id: Iee063dd6c5a39de16907acfb5af87e81a05ab417
      Reviewed-on: https://go-review.googlesource.com/49351Reviewed-by: default avatarAndrew Bonventre <andybons@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      235aff0a
  9. 17 Jul, 2017 7 commits
  10. 16 Jul, 2017 2 commits