1. 21 May, 2019 7 commits
  2. 20 May, 2019 11 commits
  3. 17 May, 2019 12 commits
  4. 16 May, 2019 10 commits
    • Jay Conrod's avatar
      cmd/go: don't panic when explaining lost upgrades due to downgrades · 97ecc432
      Jay Conrod authored
      If a user runs 'go get mod@vers' where the module transitively
      requires itself at a newer version, 'go get' attempts to perform a
      downgrade, which necessarily excludes the requested version of the
      module.
      
      Previously, we called mvs.BuildList with the requested module
      version as the target. This panicked because BuildList doesn't allow
      the target module (typically the main module) to require a newer
      version of itself.
      
      With this change, when we lose an upgrade due to a downgrade, we call
      mvs.BuildList through a wrapper that treats the lost module version as
      requirement of a synthetic root module, rather than the target
      module. This avoids the panic.
      
      This change also starts reporting errors when an upgraded module is
      lost entirely (downgrades caused the module to be completely removed
      from the build list).
      
      Fixes #31491
      
      Change-Id: I70ca261c20af7553cad2d3b840a1eaf3d18a4191
      Reviewed-on: https://go-review.googlesource.com/c/go/+/177602
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      97ecc432
    • Michael Anthony Knyszek's avatar
      runtime: mark newly-mapped memory as scavenged · 4e7bef84
      Michael Anthony Knyszek authored
      On most platforms newly-mapped memory is untouched, meaning the pages
      backing the region haven't been faulted in yet. However, we mark this
      memory as unscavenged which means the background scavenger
      aggressively "returns" this memory to the OS if the heap is small.
      
      The only platform where newly-mapped memory is actually unscavenged (and
      counts toward the application's RSS) is on Windows, since
      (*mheap).sysAlloc commits the reservation. Instead of making a special
      case for Windows, I change the requirements a bit for a sysReserve'd
      region. It must now be both sysMap'd and sysUsed'd, with sysMap being a
      no-op on Windows. Comments about memory allocation have been updated to
      include a more up-to-date mental model of which states a region of memory
      may be in (at a very low level) and how to transition between these
      states.
      
      Now this means we can correctly mark newly-mapped heap memory as
      scavenged on every platform, reducing the load on the background
      scavenger early on in the application for small heaps. As a result,
      heap-growth scavenging is no longer necessary, since any actual RSS
      growth will be accounted for on the allocation codepath.
      
      Finally, this change also cleans up grow a little bit to avoid
      pretending that it's freeing an in-use span and just does the necessary
      operations directly.
      
      Fixes #32012.
      Fixes #31966.
      Updates #26473.
      
      Change-Id: Ie06061eb638162e0560cdeb0b8993d94cfb4d290
      Reviewed-on: https://go-review.googlesource.com/c/go/+/177097
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      4e7bef84
    • Brad Fitzpatrick's avatar
      net/http: update vendored, bundled x/net/http2 · cb5c82bc
      Brad Fitzpatrick authored
      For:
      
          http2: track reused connections
          https://golang.org/cl/176720 (updates golang/go#31982)
      
      Some x/sys/unix updates come along for the ride too.
      
      I filed #32031 for making the bundling process less difficult and
      error-prone in the future.
      
      Change-Id: Ic822080991ffa2d50352c5f613e45648a327cf16
      Reviewed-on: https://go-review.googlesource.com/c/go/+/177037
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      cb5c82bc
    • Bryan C. Mills's avatar
      cmd/go: include "gccgo stdlib" in lost build action check · e1fb8e42
      Bryan C. Mills authored
      Fixes #32060
      
      Change-Id: I49ab48a9bdd64a7ed777a045e2d92d28a37b5c0b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/177600
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e1fb8e42
    • Bryan C. Mills's avatar
      cmd/go: always add 'go' directive to the go.mod file if missing · 48b7bdd0
      Bryan C. Mills authored
      Updates #30790
      Fixes #31960
      
      Change-Id: Ib3ac074cf1f98fe69f53af82d2a0441582116570
      Reviewed-on: https://go-review.googlesource.com/c/go/+/176925
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      48b7bdd0
    • Josh Bleecher Snyder's avatar
      cmd/compile: invalidate CFG when fuseIf triggers · e7b7f874
      Josh Bleecher Snyder authored
      The compiler appears to have a latent bug:
      fusePlain calls invalidateCFG when it changes block structure,
      but fuseIf does not.
      
      Fix this by hoisting the call to invalidateCFG to the top level.
      
      Change-Id: Ic960fb3ac963b15b4a225aad84863d58efa954e6
      Reviewed-on: https://go-review.googlesource.com/c/go/+/177198
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      e7b7f874
    • fanzha02's avatar
      cmd/compile: fix the error of absorbing boolean tests into block(FGE, FGT) · 822a9f53
      fanzha02 authored
      The CL 164718 mistyped the comparison flags. The rules for floating
      point comparison should be GreaterThanF and GreaterEqualF. Fortunately,
      the wrong optimizations were overwritten by other integer rules, so the
      issue won't cause failure but just some performance impact.
      
      The fixed CL optimizes the floating point test as follows.
      
      source code: func foo(f float64) bool { return f > 4 || f < -4}
      previous version: "FCMPD", "CSET\tGT", "CBZ"
      fixed version: "FCMPD", BLE"
      
      Add the test case.
      
      Change-Id: Iea954fdbb8272b2d642dae0f816dc77286e6e1fa
      Reviewed-on: https://go-review.googlesource.com/c/go/+/177121Reviewed-by: default avatarBen Shi <powerman1st@163.com>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Ben Shi <powerman1st@163.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      822a9f53
    • Jason A. Donenfeld's avatar
      os: pass correct environment when creating Windows processes · 12279faa
      Jason A. Donenfeld authored
      This is CVE-2019-11888.
      
      Previously, passing a nil environment but a non-nil token would result
      in the new potentially unprivileged process inheriting the parent
      potentially privileged environment, or would result in the new
      potentially privileged process inheriting the parent potentially
      unprivileged environment. Either way, it's bad. In the former case, it's
      an infoleak. In the latter case, it's a possible EoP, since things like
      PATH could be overwritten.
      
      Not specifying an environment currently means, "use the existing
      environment". This commit amends the behavior to be, "use the existing
      environment of the token the process is being created for." The behavior
      therefore stays the same when creating processes without specifying a
      token. And it does the correct thing when creating processes when
      specifying a token.
      
      Fixes #32000
      
      Change-Id: Ia57f6e89b97bdbaf7274d6a89c1d9948b6d40ef5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/176619
      Run-TryBot: Jason Donenfeld <Jason@zx2c4.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAlex Brainman <alex.brainman@gmail.com>
      12279faa
    • David Chase's avatar
      cmd/compile: add debugging and stats output to numberlines · fba60669
      David Chase authored
      This is useful for debugging line number assignment and
      also for making sense of pathological line number inputs.
      
      Activated with
      -gcflags=-d=ssa/number_lines/stats=1 (the bit matters)
      -gcflags=-d=ssa/number_lines/debug
      
      Stats:
      "SUM_LINE_RANGE",
         SUM for f in files {MAX line in f {line}-MIN line in f {line}}
      "MAXMIN_LINE_RANGE",
         MAX for f in files {MAX line in f {line}} -
         MIN for f in files {MIN line in f {line}}
      "MAXFILE", maxfile,
         MAX for f in files {f}
      "NFILES", len(entries)
         | files |
      
      Change-Id: I8a7336e6370452fe2e3a62de17606db9bd6a6fd3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174947
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      fba60669
    • Russ Cox's avatar
      testing: shorten go test -short testing · f2694534
      Russ Cox authored
      This cuts the time for 'go test -short testing' from 0.9s to < 0.1s.
      
      Change-Id: Ib8402f80239e1e96ea5221dfd5cd0db08170d85b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/177420
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      f2694534