1. 17 Apr, 2019 4 commits
  2. 16 Apr, 2019 34 commits
    • David Benjamin's avatar
      crypto/tls: fix a minor MAC vs padding leak · d7df9de5
      David Benjamin authored
      The CBC mode ciphers in TLS are a disaster. By ordering authentication
      and encryption wrong, they are very subtly dependent on details and
      implementation of the padding check, admitting attacks such as POODLE
      and Lucky13.
      
      crypto/tls does not promise full countermeasures for Lucky13 and still
      contains some timing variations. This change fixes one of the easy ones:
      by checking the MAC, then the padding, rather than all at once, there is
      a very small timing variation between bad MAC and (good MAC, bad
      padding).
      
      The consequences depend on the effective padding value used in the MAC
      when the padding is bad. extractPadding simply uses the last byte's
      value, leaving the padding bytes effectively unchecked. This is the
      scenario in SSL 3.0 that led to POODLE. Specifically, the attacker can
      take an input record which uses 16 bytes of padding (a full block) and
      replace the final block with some interesting block. The MAC check will
      succeed with 1/256 probability due to the final byte being 16. This
      again means that after 256 queries, the attacker can decrypt one byte.
      
      To fix this, bitwise AND the two values so they may be checked with one
      branch. Additionally, zero the padding if the padding check failed, to
      make things more robust.
      
      Updates #27071
      
      Change-Id: I332b14d215078928ffafe3cfeba1a68189f08db3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170701Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d7df9de5
    • Sergey Yanykin's avatar
      cmd/link/internal/ld: inline dosymtab · 850844ef
      Sergey Yanykin authored
      Updates #20205
      
      Change-Id: I44a7ee46a1cdc7fe6fd36c4db4c0dd87a19f7f5d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171733Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      850844ef
    • Brad Fitzpatrick's avatar
      crypto/tls, crypto/x509: update spelling of marshal* · 431b5c69
      Brad Fitzpatrick authored
      Per https://golang.org/wiki/Spelling and CL 33017.
      
      Change-Id: Ia813a81d25603883114c4e4b6997eb560d6a3690
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172457Reviewed-by: default avatarDmitri Shuralyov <dmitshur@golang.org>
      431b5c69
    • Ainar Garipov's avatar
      test: add regress test for issue 28369 · 7cdacf55
      Ainar Garipov authored
      Also gofmt test/escape5.go.
      
      Fixes #28369.
      
      Change-Id: I0a11748fd2b5cf01cb5437ae15827d9db91c0c0d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172358Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7cdacf55
    • Josh Bleecher Snyder's avatar
      all: s/cancelation/cancellation/ · 5781df42
      Josh Bleecher Snyder authored
      Though there is variation in the spelling of canceled,
      cancellation is always spelled with a double l.
      
      Reference: https://www.grammarly.com/blog/canceled-vs-cancelled/
      
      Change-Id: I240f1a297776c8e27e74f3eca566d2bc4c856f2f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170060
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      5781df42
    • Bryan C. Mills's avatar
      cmd/go/internal/renameio: mask spurious "Access is denied" errors on Windows · 34b1f210
      Bryan C. Mills authored
      Fixes #31247
      
      Change-Id: I85a760a5d36ae835c97a13f980804d06b658857e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172418
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      34b1f210
    • Matthew Dempsky's avatar
      runtime/internal/atomic: fix s390x's StorepNoWB implementation · 13b7c04d
      Matthew Dempsky authored
      Same as CL 170323, but for s390x instead of wasm.
      
      Fixes #31495.
      
      Change-Id: Ie39f649f5e33690375a8bcb1bc3b92d912ca4398
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172417
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      13b7c04d
    • LE Manh Cuong's avatar
      cmd/compile: fix const declaration group broken with closure · 644543dd
      LE Manh Cuong authored
      In typecheckclosure, a xfunc node will be put to xtop. But that node can
      be shared between multiple closures, like in a const declaration group:
      
      const (
      	x = unsafe.Sizeof(func() {})
      	y
      )
      
      It makes a xfunc node appears multiple times in xtop, causing duplicate
      initLSym run.
      
      To fix this issue, we only do typecheck for xfunc one time, and setup
      closure node earlier in typecheckclosure process.
      
      Fixes #30709
      
      Change-Id: Ic924a157ee9f3e5d776214bef5390849ddc8aab9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172298Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      644543dd
    • Jay Conrod's avatar
      cmd/go: print package import chains for some build list errors · 2bdbc942
      Jay Conrod authored
      When we construct the build list by loading packages (e.g., in
      "go build", "go list", or "go test"), we may load additional modules
      not mentioned in the original build list. If we encounter an error
      loading one of these modules, mvs.BuildList currently returns a
      BuildListError with a chain of requirments. Unfortunately, this is not
      helpful, since the graph is structured such that these missing modules
      are direct requirements of the main module.
      
      With this change, loader.load keeps track of the package that caused
      each "missing" module to be added. If an error occurs in a missing
      module, the chain of package imports is printed instead of the module
      requirements.
      
      Fixes #31475
      
      Change-Id: Ie484814af42ceea3e85fedc38e705ba3a38cd495
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171859
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      2bdbc942
    • Jay Conrod's avatar
      cmd/go: describe dependencies in build list error messages · f7c96725
      Jay Conrod authored
      mvs.BuildList reports errors with a chain of modules to make it
      clear why the module where the error occurred was part of the
      build. This is a little confusing with "go get -u" since there are
      edges in the module graph for requirements and for updates.
      
      With this change, we now print "requires" or "updates to" between
      each module version in the chain.
      
      Updates #30661
      
      Change-Id: Ie689500ea86857e715b250b9e0cae0bc6686dc32
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171150
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      f7c96725
    • Jay Conrod's avatar
      cmd/go: handle wildcards for unknown modules in "go get" · 6997671d
      Jay Conrod authored
      For example, "go get golang.org/x/tools/cmd/..." will add a
      requirement for "golang.org/x/tools" to go.mod and will install
      executables from the "cmd" subdirectory.
      
      Fixes #29363
      
      Change-Id: Id53f051710708d7760ffe831d4274fd54533d2b7
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171138
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      6997671d
    • Constantin Konstantinidis's avatar
      cmd/go: remove auto-deriving module path for github.com · 75308c98
      Constantin Konstantinidis authored
      This fix removes the special case of auto-deriving the module path
      only for VCS github.com. Error message now explicitly requests
      the module path. Documentation and its FAQ do not need an update
      as only the beginning of the message is mentioned and is not modified.
      
      Fixes #27951
      
      Change-Id: Icaf87a38b5c58451edba9beaa12ae9a68e288ca1
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172019Reviewed-by: default avatarDaniel Lublin <daniel@lublin.se>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      Run-TryBot: Jay Conrod <jayconrod@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      75308c98
    • Matthew Dempsky's avatar
      cmd/compile: enable -newescape by default · 996a687e
      Matthew Dempsky authored
      RELNOTE=yes
      
      The new escape analysis pass is more precise, which for most Go code
      should be an improvement. However, it may also break code that
      happened to work before (e.g., code that violated the unsafe.Pointer
      safety rules).
      
      The old escape analysis pass can be re-enabled with "go build
      -gcflags=all=-newescape=false". N.B., it's NOT recommended to mix the
      old and new escape analysis passes such as by omitting "all=". While
      the old and new escape analysis passes use similar and mostly
      compatible metadata, there are cases (e.g., closure handling) where
      they semantically differ and could lead to memory corruption errors in
      compiled programs.
      
      Fixes #23109.
      
      Change-Id: I0b1b6a6de5e240cb30c87a165f47bb8795491158
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170448
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      996a687e
    • Gergely Brautigam's avatar
      cmd/go: report non-Go files as package error · a16dcc00
      Gergely Brautigam authored
      This change modifies cmd/go/list to format the error correctly in case
      -e flag is set. It also fixes a bug where the package loader was only
      ever checking the first pattern if it had the go extension. This caused
      and error when a file without .go extension was not the first argument.
      
      Fixes #29899
      
      Change-Id: I029bf4465ad4ad054434b8337c1d2a59369783da
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166398
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      a16dcc00
    • Bryan C. Mills's avatar
      cmd/go: retry RemoveAll(workdir) for up to 500ms · 56b8ee23
      Bryan C. Mills authored
      On some configurations of Windows, directories containing executable
      files may be locked for a while after the executable exits (perhaps
      due to antivirus scans?). It's probably worth a little extra latency
      on exit to avoid filling up the user's temporary directory with leaked
      files.
      
      Updates #30789
      
      Change-Id: Iae7fcdd07fb9ecfb05967cfe0c8833db646d2f85
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172337
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      56b8ee23
    • ShiKaiWi's avatar
      expvar: improve Map.addKey for large number of keys · 518ee55d
      ShiKaiWi authored
      The existing implementation has poor performance for inserting large
      number of keys because it chooses to append the new key to the sorted
      keys array and then sort the new array again (time complexity is
      O(nlogn)).
      
      The improvement tries to utilize the sorted keys array by searching the
      index and doing an insertion if any (time complexity is O(logn)).
      
      Benchmarked on 4-core machine with `go test -cpu 1,2,4,8 -count 5
      -benchmem -bench=.`(the equal results are omitted):
      
      name                          old time/op    new time/op    delta
      MapAddDifferentRandom-8          408µs ±11%      69µs ± 3%  -82.95%  (p=0.008 n=5+5)
      MapAddDifferentRandom-4          389µs ±19%      69µs ± 2%  -82.28%  (p=0.008 n=5+5)
      MapAddDifferentRandom-2          365µs ± 4%      75µs ± 6%  -79.51%  (p=0.008 n=5+5)
      MapSetDifferentRandom-8          365µs ± 4%      76µs ±40%  -79.07%  (p=0.008 n=5+5)
      MapAddDifferentRandom            366µs ± 3%      78µs ± 6%  -78.66%  (p=0.008 n=5+5)
      MapSetDifferentRandom            369µs ± 2%      81µs ±34%  -77.99%  (p=0.008 n=5+5)
      MapSetDifferentRandom-2          378µs ±10%     100µs ±32%  -73.47%  (p=0.008 n=5+5)
      MapSetDifferentRandom-4          352µs ± 4%     108µs ± 7%  -69.40%  (p=0.008 n=5+5)
      IntAdd-2                        23.1ns ±21%    15.5ns ±23%  -32.79%  (p=0.032 n=5+5)
      IntSet-2                        21.4ns ±14%    16.7ns ±17%  -22.00%  (p=0.016 n=5+5)
      FloatAdd-8                      88.8ns ± 9%    70.8ns ±25%  -20.23%  (p=0.024 n=5+5)
      FloatSet-2                      22.3ns ±15%    17.8ns ±14%  -20.14%  (p=0.008 n=5+5)
      IntAdd-8                        21.7ns ± 3%    18.7ns ± 4%  -14.00%  (p=0.008 n=5+5)
      MapAddDifferent-8               1.58µs ± 7%    1.42µs ± 6%  -10.06%  (p=0.016 n=5+5)
      StringSet-2                     42.4ns ± 1%    43.7ns ± 5%   +3.07%  (p=0.048 n=4+5)
      FloatSet                        8.27ns ± 2%    8.60ns ± 1%   +3.94%  (p=0.008 n=5+5)
      FloatAdd                        12.5ns ± 2%    13.0ns ± 4%   +4.33%  (p=0.032 n=5+5)
      MapSetString-4                  94.6ns ± 0%   101.7ns ± 4%   +7.55%  (p=0.016 n=4+5)
      MapAddSameSteadyState-2         34.9ns ± 3%    37.7ns ± 5%   +8.14%  (p=0.008 n=5+5)
      StringSet-4                     34.5ns ± 0%    37.6ns ± 9%   +9.02%  (p=0.016 n=4+5)
      MapSetDifferent-8                377ns ± 3%     411ns ± 7%   +9.07%  (p=0.008 n=5+5)
      MapAddSameSteadyState           39.1ns ± 2%    42.8ns ± 6%   +9.36%  (p=0.008 n=5+5)
      MapAddDifferentSteadyState       172ns ± 4%     190ns ± 9%  +10.96%  (p=0.016 n=5+5)
      MapSet                           143ns ± 4%     159ns ± 2%  +11.06%  (p=0.008 n=5+5)
      MapSet-4                        96.9ns ± 5%   107.8ns ± 6%  +11.25%  (p=0.008 n=5+5)
      MapSet-2                         102ns ± 6%     114ns ± 8%  +11.94%  (p=0.008 n=5+5)
      IntSet                          8.18ns ± 1%   12.78ns ±13%  +56.31%  (p=0.008 n=5+5)
      
      name                          old alloc/op   new alloc/op   delta
      MapSetDifferentRandom-4         19.8kB ± 0%    16.6kB ± 0%  -16.21%  (p=0.008 n=5+5)
      MapSetDifferentRandom           19.8kB ± 0%    16.6kB ± 0%  -16.21%  (p=0.008 n=5+5)
      MapSetDifferentRandom-8         19.8kB ± 0%    16.6kB ± 0%  -16.20%  (p=0.008 n=5+5)
      MapSetDifferentRandom-2         19.8kB ± 0%    16.6kB ± 0%  -16.20%  (p=0.008 n=5+5)
      MapAddDifferentRandom           20.6kB ± 0%    17.4kB ± 0%  -15.57%  (p=0.008 n=5+5)
      MapAddDifferentRandom-8         20.6kB ± 0%    17.4kB ± 0%  -15.57%  (p=0.008 n=5+5)
      MapAddDifferentRandom-2         20.6kB ± 0%    17.4kB ± 0%  -15.56%  (p=0.008 n=5+5)
      MapAddDifferentRandom-4         20.6kB ± 0%    17.4kB ± 0%  -15.56%  (p=0.008 n=5+5)
      MapAddDifferent                 1.09kB ± 0%    0.96kB ± 0%  -11.76%  (p=0.008 n=5+5)
      MapAddDifferent-2               1.09kB ± 0%    0.96kB ± 0%  -11.76%  (p=0.008 n=5+5)
      MapAddDifferent-4               1.09kB ± 0%    0.96kB ± 0%  -11.76%  (p=0.008 n=5+5)
      MapAddDifferent-8               1.09kB ± 0%    0.96kB ± 0%  -11.76%  (p=0.008 n=5+5)
      MapAddSame                        480B ± 0%      448B ± 0%   -6.67%  (p=0.008 n=5+5)
      MapAddSame-2                      480B ± 0%      448B ± 0%   -6.67%  (p=0.008 n=5+5)
      MapAddSame-4                      480B ± 0%      448B ± 0%   -6.67%  (p=0.008 n=5+5)
      MapAddSame-8                      480B ± 0%      448B ± 0%   -6.67%  (p=0.008 n=5+5)
      
      name                          old allocs/op  new allocs/op  delta
      MapSetDifferentRandom              423 ± 0%       323 ± 0%  -23.64%  (p=0.008 n=5+5)
      MapSetDifferentRandom-2            423 ± 0%       323 ± 0%  -23.64%  (p=0.008 n=5+5)
      MapSetDifferentRandom-4            423 ± 0%       323 ± 0%  -23.64%  (p=0.008 n=5+5)
      MapSetDifferentRandom-8            423 ± 0%       323 ± 0%  -23.64%  (p=0.008 n=5+5)
      MapAddDifferentRandom              523 ± 0%       423 ± 0%  -19.12%  (p=0.008 n=5+5)
      MapAddDifferentRandom-2            523 ± 0%       423 ± 0%  -19.12%  (p=0.008 n=5+5)
      MapAddDifferentRandom-4            523 ± 0%       423 ± 0%  -19.12%  (p=0.008 n=5+5)
      MapAddDifferentRandom-8            523 ± 0%       423 ± 0%  -19.12%  (p=0.008 n=5+5)
      MapAddDifferent                   31.0 ± 0%      27.0 ± 0%  -12.90%  (p=0.008 n=5+5)
      MapAddDifferent-2                 31.0 ± 0%      27.0 ± 0%  -12.90%  (p=0.008 n=5+5)
      MapAddDifferent-4                 31.0 ± 0%      27.0 ± 0%  -12.90%  (p=0.008 n=5+5)
      MapAddDifferent-8                 31.0 ± 0%      27.0 ± 0%  -12.90%  (p=0.008 n=5+5)
      MapAddSame                        11.0 ± 0%      10.0 ± 0%   -9.09%  (p=0.008 n=5+5)
      MapAddSame-2                      11.0 ± 0%      10.0 ± 0%   -9.09%  (p=0.008 n=5+5)
      MapAddSame-4                      11.0 ± 0%      10.0 ± 0%   -9.09%  (p=0.008 n=5+5)
      MapAddSame-8                      11.0 ± 0%      10.0 ± 0%   -9.09%  (p=0.008 n=5+5)
      
      Fixes #31414
      
      Change-Id: I2dd655dec9dbbf8d7881a0f3f8edcb3d29199a48
      GitHub-Last-Rev: a816fe3f62498481500a0ce9695de9fd3aa9f7b7
      GitHub-Pull-Request: golang/go#31418
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171718
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      518ee55d
    • Kunpei Sakai's avatar
      net/http: rename DialerAndTLSConfigSupportsHTTP2 to ForceAttemptHTTP2 · 2a931bad
      Kunpei Sakai authored
      Transport.DialerAndTLSConfigSupportsHTTP2 was added just earlier
      in CL 130256 but we thought of a better name moments after submitting.
      ForceAttemptHTTP2 is shorter, more direct, and doesn't constrain what
      we can use it with in the future.
      
      Updates #14391
      Updates #27011
      
      Change-Id: Ie5fc71bafcbcaa1941b5d49f748b6d710503d477
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172299Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      2a931bad
    • Keith Randall's avatar
      syscall: skip DirentRepeat test on freebsd · 8285c85f
      Keith Randall authored
      Dirent doesn't work properly. Diable the test for now.
      
      Update #31416
      
      Change-Id: I34a8045598a9c303dcc754ce04da3c124f122d1a
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171818Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8285c85f
    • Matthew Dempsky's avatar
      cmd/compile: update escape analysis tests for newescape · a9831633
      Matthew Dempsky authored
      The new escape analysis implementation tries to emit debugging
      diagnostics that are compatible with the existing implementation, but
      there's a handful of cases that are easier to handle by updating the
      test expectations instead.
      
      For regress tests that need updating, the original file is copied to
      oldescapeXXX.go.go with -newescape=false added to the //errorcheck
      line, while the file is updated in place with -newescape=true and new
      test requirements.
      
      Notable test changes:
      
      1) escape_because.go looks for a lot of detailed internal debugging
      messages that are fairly particular to how esc.go works and that I
      haven't attempted to port over to escape.go yet.
      
      2) There are a lot of "leaking param: x to result ~r1 level=-1"
      messages for code like
      
          func(p *int) *T { return &T{p} }
      
      that were simply wrong. Here &T must be heap allocated unconditionally
      (because it's being returned); and since p is stored into it, p
      escapes unconditionally too. esc.go incorrectly reports that p escapes
      conditionally only if the returned pointer escaped.
      
      3) esc.go used to print each "leaking param" analysis result as it
      discovered them, which could lead to redundant messages (e.g., that a
      param leaks at level=0 and level=1). escape.go instead prints
      everything at the end, once it knows the shortest path to each sink.
      
      4) esc.go didn't precisely model direct-interface types, resulting in
      some values unnecessarily escaping to the heap when stored into
      non-escaping interface values.
      
      5) For functions written in assembly, esc.go only printed "does not
      escape" messages, whereas escape.go prints "does not escape" or
      "leaking param" as appropriate, consistent with the behavior for
      functions written in Go.
      
      6) 12 tests included "BAD" annotations identifying cases where esc.go
      was unnecessarily heap allocating something. These are all fixed by
      escape.go.
      
      Updates #23109.
      
      Change-Id: Iabc9eb14c94c9cadde3b183478d1fd54f013502f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170447
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      a9831633
    • Kunpei Sakai's avatar
      net/http: introduce DialerAndTLSConfigSupportsHTTP2 in Transport · 94e72005
      Kunpei Sakai authored
      Even when a custom TLS config or custom dialer is specified,
      enables HTTP/2 if DialerAndTLSConfigSupportsHTTP2 is true.
      By this change, avoid automatically enabling HTTP/2 if DialContext is set.
      
      This change also ensures that DefaultTransport still automatically
      enable HTTP/2 as discussed in #14391.
      
      Updates #14391
      Fixes #27011
      
      Change-Id: Icc46416810bee61dbd65ebc96468335030b80573
      Reviewed-on: https://go-review.googlesource.com/c/go/+/130256Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      94e72005
    • Fedor Korotkiy's avatar
      cmd/go: PackageVetx in vet.cfg should list only immediate dependencies. · 1eed2a5a
      Fedor Korotkiy authored
      Updates #30296
      
      Change-Id: Ifea1a4c82c1c5b31fdc2e96fdbb1274748c8f50e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/164459Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      1eed2a5a
    • Michael Munday's avatar
      math: use new mnemonics for 'rotate then insert' on s390x · 64dc4ba7
      Michael Munday authored
      Mnemonics for these instructions were added to the assembler in
      CL 159357.
      
      Change-Id: Ie11c45ecc9cead9a8850fcc929b0211cfd980fe5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/160157
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      64dc4ba7
    • 喜欢兰花山丘's avatar
      context: simplify stringify with a type switch · c4953a62
      喜欢兰花山丘 authored
      Minor style change.
      
      Change-Id: Ib30243a71a83de1a67d3d005bfdd1e04265fca1e
      GitHub-Last-Rev: 9d654de10eaa6f01ece29790fb81bc41dfd61eaf
      GitHub-Pull-Request: golang/go#31479
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172199Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarSameer Ajmani <sameer@golang.org>
      c4953a62
    • Elias Naur's avatar
      misc/cgo/testcshared: support testing on self-hosted android · 4ee85e67
      Elias Naur authored
      Only invoke adb for android if we're not running on android already.
      
      Change-Id: I4eb94286a5bf09b382716a0474f3aebec40f5d74
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170953
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      4ee85e67
    • Elias Naur's avatar
      runtime: avoid getg in preinit on Android · ae85ae5d
      Elias Naur authored
      sigaction is called as part of library mode initializers
      (_rt0_*_lib). Sigaction in turn calls getg, but on Android the TLS
      offset for g has not been initialized and getg might return garbage.
      
      Add a check for initialization before calling getg.
      
      Fixes the golang.org/x/mobile/bind/java tests on amd64 and 386.
      
      Fixes #31476
      
      Change-Id: Id2c41fdc983239eca039b49a54b8853c5669d127
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172158Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      ae85ae5d
    • Richard Musiol's avatar
      runtime, cmd/link: optimize memory allocation on wasm · 460f9c60
      Richard Musiol authored
      WebAssembly's memory is contiguous. Allocating memory at a high address
      also allocates all memory up to that address. This change reduces
      the initial memory allocated on wasm from 1GB to 16MB by using multiple
      heap arenas and reducing the size of a heap arena.
      
      Fixes #27462.
      
      Change-Id: Ic941e6edcadd411e65a14cb2f9fd6c8eae02fc7a
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170950
      Run-TryBot: Richard Musiol <neelance@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      460f9c60
    • Dmitry Savintsev's avatar
      doc: fix typo in go1.12 release notes · e47090ab
      Dmitry Savintsev authored
      Change-Id: I3cb4fb7cacba51bfd611ade918f16c618e2569fd
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172159Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e47090ab
    • Daniel Martí's avatar
      all: clean up code with token.IsExported · 9b968df1
      Daniel Martí authored
      A handful of packages were reimplementing IsExported, so use
      token.IsExported instead. This caused the deps test to fail for net/rpc.
      However, net/rpc deals with Go types, and go/token is light and fairly
      low-level in terms of Go tooling packages, so that's okay.
      
      While at it, replace all uses of ast.IsExported with token.IsExported.
      This is more consistent, and also means that the import graphs are
      leaner. A couple of files no longer need to import go/ast, for example.
      
      We can't get rid of cmd/compile/internal/types.IsExported, as the
      compiler can only depend on go/token as of Go 1.4. However, gc used
      different implementations in a couple of places, so consolidate the use
      of types.IsExported there.
      
      Finally, we can't get rid of the copied IsExported implementation in
      encoding/gob, as go/token depends on it as part of a test. That test
      can't be an external test either, so there's no easy way to break the
      import cycle.
      
      Overall, this removes about forty lines of unnecessary code.
      
      Change-Id: I86a475b7614261e6a7b0b153d5ca02b9f64a7b2d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172037
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      9b968df1
    • Clément Chigot's avatar
      syscall: move helper handler before AIX handler in TestPassFD · b39d0eab
      Clément Chigot authored
      The AIX special handler which skips this test if unix network isn't
      supported, doesn't need to be called inside the helper process.
      
      Change-Id: I7ff2c4e6b20eceb977380294858cae63034ffe0d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172160
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
      b39d0eab
    • Ivan Osadchiy's avatar
      crypto/sha256: Use bits.RotateLeft32 instead of ad-hoc implementation · 36b0593f
      Ivan Osadchiy authored
      Improves readability of the generic implementation.
      
      Updates #31456.
      
      Benchmarks (i7-4980HQ CPU)
      
      name          old time/op    new time/op    delta
      Hash8Bytes-8     339ns ± 3%     337ns ± 2%   ~     (p=0.595 n=5+5)
      Hash1K-8        5.12µs ± 6%    4.97µs ± 6%   ~     (p=0.310 n=5+5)
      Hash8K-8        37.6µs ± 5%    38.1µs ± 6%   ~     (p=0.841 n=5+5)
      
      name          old speed      new speed      delta
      Hash8Bytes-8  23.6MB/s ± 3%  23.8MB/s ± 3%   ~     (p=0.690 n=5+5)
      Hash1K-8       200MB/s ± 6%   206MB/s ± 5%   ~     (p=0.310 n=5+5)
      Hash8K-8       218MB/s ± 5%   215MB/s ± 6%   ~     (p=0.841 n=5+5)
      
      Change-Id: Ic488841699138efde76e900bce1dd38fdbc88ec6
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171731Reviewed-by: default avatarIlya Tokar <tocarip@gmail.com>
      Run-TryBot: Ilya Tokar <tocarip@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      36b0593f
    • Michael Munday's avatar
      cmd/asm: add s390x 'rotate then ... selected bits' instructions · 0f79510d
      Michael Munday authored
      This CL adds the following instructions, useful for shifting/rotating
      and masking operations:
      
       * RNSBG - rotate then and selected bits
       * ROSBG - rotate then or selected bits
       * RXSBG - rotate then exclusive or selected bits
       * RISBG - rotate then insert selected bits
      
      It also adds the 'T' (test), 'Z' (zero), 'H' (high), 'L' (low) and
      'N' (no test) variants of these instructions as appropriate.
      
      Operands are ordered as: I₃, I₄, I₅, R₂, R₁.
      
      Key: I₃=start, I₄=end, I₅=amount, R₂=source, R₁=destination
      
      Change-Id: I200d12287e1df7447f37f4919da5e9a93d27c792
      Reviewed-on: https://go-review.googlesource.com/c/go/+/159357
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0f79510d
    • Michael Munday's avatar
      cmd/internal/obj/s390x: handle RestArgs in s390x assembler · 9c843f03
      Michael Munday authored
      Allow up to 3 RestArgs arguments to be specified. This is needed to
      for us to add the 'rotate and ... bits' instructions, which require
      5 arguments, cleanly.
      
      Change-Id: I76b89adfb5e3cd85a43023e412f0cc202d489e0b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171726
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      9c843f03
    • Michael Munday's avatar
      cmd/internal/obj/s390x: remove param field from optab · e6198542
      Michael Munday authored
      The param field isn't useful, we can just use REGSP instead.
      
      Change-Id: I2ac68131c390209cc84e43aa7620ccbf5ae69120
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171725
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      e6198542
    • Josh Bleecher Snyder's avatar
      runtime: print more information when testCgoPprof fails · f248cd3a
      Josh Bleecher Snyder authored
      Change-Id: I820dae0303959096f0c434b7e69ecb3bf070df09
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172197
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      f248cd3a
  3. 15 Apr, 2019 2 commits