1. 24 Oct, 2018 9 commits
    • Elias Naur's avatar
      internal/traceparser: skip test on iOS · 536a7d67
      Elias Naur authored
      The iOS test harness only include files from the tested package or
      below. Skip a test on iOS that required files outside the package.
      
      Change-Id: Iaee7e488eb783b443f2b2b84d8be2de01227ab62
      Reviewed-on: https://go-review.googlesource.com/c/144110
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarPeter Weinberger <pjw@google.com>
      536a7d67
    • Brian Kessler's avatar
      math/bits: correct BenchmarkSub64 · 127c51e4
      Brian Kessler authored
      Previously, the benchmark was measuring Add64 instead of Sub64.
      
      Change-Id: I0cf30935c8a4728bead9868834377aae0b34f008
      Reviewed-on: https://go-review.googlesource.com/c/144380Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      127c51e4
    • Clément Chigot's avatar
      cmd/link: add AIX operating system · 269e5319
      Clément Chigot authored
      This commit adds AIX operating system to cmd/link package for ppc64
      architecture.
      
      Updates: #25893
      
      Change-Id: I349e0a2658c31919b72117b62c4c9935c9af07c0
      Reviewed-on: https://go-review.googlesource.com/c/138730
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      269e5319
    • Tobias Klauser's avatar
      internal/syscall/unix: omit unnecessary randomTrap check in GetRandom · 61550910
      Tobias Klauser authored
      The randomTrap const is initialized to a non-zero value for linux in
      getrandom_linux_$GOARCH.go and for freebsd in getrandom_freebsd.go
      directly since CL 16662. Thus, omit the unnecessary check.
      
      Change-Id: Id20cd628dfe6fab9908fa5258c3132e3b422a6b4
      Reviewed-on: https://go-review.googlesource.com/c/144108
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      61550910
    • Clément Chigot's avatar
      cmd: add DWARF64 support for aix port · 75a0b9db
      Clément Chigot authored
      This commit adds support for DWARF 64bits which is needed for AIX
      operating system.
      
      It also adds the save of each compilation unit's size which will be
      used during XCOFF generation in a following patch.
      
      Updates: #25893
      
      Change-Id: Icdd0a4dd02bc0a9f0df319c351fb1db944610015
      Reviewed-on: https://go-review.googlesource.com/c/138729
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      75a0b9db
    • Daniel Martí's avatar
      cmd/go: use os.UserCacheDir for the default GOCACHE · bcc3447b
      Daniel Martí authored
      This piece of code predates the addition of os.UserCacheDir, and it
      looks like os.UserCacheDir was based on this piece of code.
      
      The two behaved exactly the same, minus cmd/go's addition of AppData for
      Windows XP in CL 87675. However, Go 1.11 dropped support for Windows XP,
      so we can safely ignore that change now.
      
      The only tweaks necessary are to return "off" if an error is
      encountered, and to disable warnings if we're using "/.cache".
      
      Change-Id: Ia00577d4575ce4870f7fb103eafaa4d2b630743e
      Reviewed-on: https://go-review.googlesource.com/c/141538
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
      bcc3447b
    • Filippo Valsorda's avatar
      crypto/tls: replace custom *block with standard buffers · ab51b1d6
      Filippo Valsorda authored
      The crypto/tls record layer used a custom buffer implementation with its
      own semantics, freelist, and offset management. Replace it all with
      per-task bytes.Buffer, bytes.Reader and byte slices, along with a
      refactor of all the encrypt and decrypt code.
      
      The main quirk of *block was to do a best-effort read past the record
      boundary, so that if a closeNotify was waiting it would be peeked and
      surfaced along with the last Read. Address that with atLeastReader and
      ReadFrom to avoid a useless copy (instead of a LimitReader or CopyN).
      
      There was also an optimization to split blocks along record boundary
      lines without having to copy in and out the data. Replicate that by
      aliasing c.input into consumed c.rawInput (after an in-place decrypt
      operation). This is safe because c.rawInput is not used until c.input is
      drained.
      
      The benchmarks are noisy but look like an improvement across the board,
      which is a nice side effect :)
      
      name                                       old time/op   new time/op   delta
      HandshakeServer/RSA-8                        817µs ± 2%    797µs ± 2%  -2.52%  (p=0.000 n=10+9)
      HandshakeServer/ECDHE-P256-RSA-8             984µs ±11%    897µs ± 0%  -8.89%  (p=0.000 n=10+9)
      HandshakeServer/ECDHE-P256-ECDSA-P256-8      206µs ±10%    199µs ± 3%    ~     (p=0.113 n=10+9)
      HandshakeServer/ECDHE-X25519-ECDSA-P256-8    204µs ± 3%    202µs ± 1%  -1.06%  (p=0.013 n=10+9)
      HandshakeServer/ECDHE-P521-ECDSA-P521-8     15.5ms ± 0%   15.6ms ± 1%    ~     (p=0.095 n=9+10)
      Throughput/MaxPacket/1MB-8                  5.35ms ±19%   5.39ms ±36%    ~     (p=1.000 n=9+10)
      Throughput/MaxPacket/2MB-8                  9.20ms ±15%   8.30ms ± 8%  -9.79%  (p=0.035 n=10+9)
      Throughput/MaxPacket/4MB-8                  13.8ms ± 7%   13.6ms ± 8%    ~     (p=0.315 n=10+10)
      Throughput/MaxPacket/8MB-8                  25.1ms ± 3%   23.2ms ± 2%  -7.66%  (p=0.000 n=10+9)
      Throughput/MaxPacket/16MB-8                 46.9ms ± 1%   43.0ms ± 3%  -8.29%  (p=0.000 n=9+10)
      Throughput/MaxPacket/32MB-8                 88.9ms ± 2%   82.3ms ± 2%  -7.40%  (p=0.000 n=9+9)
      Throughput/MaxPacket/64MB-8                  175ms ± 2%    164ms ± 4%  -6.18%  (p=0.000 n=10+10)
      Throughput/DynamicPacket/1MB-8              5.79ms ±26%   5.82ms ±22%    ~     (p=0.912 n=10+10)
      Throughput/DynamicPacket/2MB-8              9.23ms ±14%   9.50ms ±23%    ~     (p=0.971 n=10+10)
      Throughput/DynamicPacket/4MB-8              14.5ms ±11%   13.8ms ± 6%  -4.66%  (p=0.019 n=10+10)
      Throughput/DynamicPacket/8MB-8              25.6ms ± 4%   23.5ms ± 3%  -8.33%  (p=0.000 n=10+10)
      Throughput/DynamicPacket/16MB-8             47.3ms ± 3%   44.6ms ± 7%  -5.65%  (p=0.000 n=10+10)
      Throughput/DynamicPacket/32MB-8             91.9ms ±14%   85.0ms ± 4%  -7.55%  (p=0.000 n=10+10)
      Throughput/DynamicPacket/64MB-8              177ms ± 2%    168ms ± 4%  -4.97%  (p=0.000 n=8+10)
      Latency/MaxPacket/200kbps-8                  694ms ± 0%    694ms ± 0%    ~     (p=0.315 n=10+9)
      Latency/MaxPacket/500kbps-8                  279ms ± 0%    279ms ± 0%    ~     (p=0.447 n=9+10)
      Latency/MaxPacket/1000kbps-8                 140ms ± 0%    140ms ± 0%    ~     (p=0.661 n=9+10)
      Latency/MaxPacket/2000kbps-8                71.1ms ± 0%   71.1ms ± 0%  +0.05%  (p=0.019 n=9+9)
      Latency/MaxPacket/5000kbps-8                30.4ms ± 7%   30.5ms ± 4%    ~     (p=0.720 n=9+10)
      Latency/DynamicPacket/200kbps-8              134ms ± 0%    134ms ± 0%    ~     (p=0.075 n=10+10)
      Latency/DynamicPacket/500kbps-8             54.8ms ± 0%   54.8ms ± 0%    ~     (p=0.631 n=10+10)
      Latency/DynamicPacket/1000kbps-8            28.5ms ± 0%   28.5ms ± 0%    ~     (p=1.000 n=8+8)
      Latency/DynamicPacket/2000kbps-8            15.7ms ±12%   16.1ms ± 0%    ~     (p=0.109 n=10+7)
      Latency/DynamicPacket/5000kbps-8            8.20ms ±26%   8.17ms ±13%    ~     (p=1.000 n=9+9)
      
      name                                       old speed     new speed     delta
      Throughput/MaxPacket/1MB-8                 193MB/s ±14%  202MB/s ±30%    ~     (p=0.897 n=8+10)
      Throughput/MaxPacket/2MB-8                 230MB/s ±14%  249MB/s ±17%    ~     (p=0.089 n=10+10)
      Throughput/MaxPacket/4MB-8                 304MB/s ± 6%  309MB/s ± 7%    ~     (p=0.315 n=10+10)
      Throughput/MaxPacket/8MB-8                 334MB/s ± 3%  362MB/s ± 2%  +8.29%  (p=0.000 n=10+9)
      Throughput/MaxPacket/16MB-8                358MB/s ± 1%  390MB/s ± 3%  +9.08%  (p=0.000 n=9+10)
      Throughput/MaxPacket/32MB-8                378MB/s ± 2%  408MB/s ± 2%  +8.00%  (p=0.000 n=9+9)
      Throughput/MaxPacket/64MB-8                384MB/s ± 2%  410MB/s ± 4%  +6.61%  (p=0.000 n=10+10)
      Throughput/DynamicPacket/1MB-8             178MB/s ±24%  182MB/s ±24%    ~     (p=0.604 n=9+10)
      Throughput/DynamicPacket/2MB-8             228MB/s ±13%  225MB/s ±20%    ~     (p=0.971 n=10+10)
      Throughput/DynamicPacket/4MB-8             291MB/s ±10%  305MB/s ± 6%  +4.83%  (p=0.019 n=10+10)
      Throughput/DynamicPacket/8MB-8             327MB/s ± 4%  357MB/s ± 3%  +9.08%  (p=0.000 n=10+10)
      Throughput/DynamicPacket/16MB-8            355MB/s ± 3%  376MB/s ± 6%  +6.07%  (p=0.000 n=10+10)
      Throughput/DynamicPacket/32MB-8            366MB/s ±12%  395MB/s ± 4%  +7.91%  (p=0.000 n=10+10)
      Throughput/DynamicPacket/64MB-8            380MB/s ± 2%  400MB/s ± 4%  +5.26%  (p=0.000 n=8+10)
      
      Note that this reduced the buffer for the first read from 1024 to 5+512,
      so it triggered the issue described at #24198 when using a synchronous
      net.Pipe: the first server flight was not being consumed entirely by the
      first read anymore, causing a deadlock as both the client and the server
      were trying to send (the client a reply to the ServerHello, the server
      the rest of the buffer). Fixed by rebasing on top of CL 142817.
      
      Change-Id: Ie31b0a572b2ad37878469877798d5c6a5276f931
      Reviewed-on: https://go-review.googlesource.com/c/142818
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAdam Langley <agl@golang.org>
      ab51b1d6
    • Daniel Martí's avatar
      text/template: recover panics during function calls · 202e9031
      Daniel Martí authored
      There's precedent in handling panics that happen in functions called
      from the standard library. For example, if a fmt.Formatter
      implementation fails, fmt will absorb the panic into the output text.
      
      Recovering panics is useful, because otherwise one would have to wrap
      some Template.Execute calls with a recover. For example, if there's a
      chance that the callbacks may panic, or if part of the input data is nil
      when it shouldn't be.
      
      In particular, it's a common confusion amongst new Go developers that
      one can call a method on a nil receiver. Expecting text/template to
      error on such a call, they encounter a long and confusing panic if the
      method expects the receiver to be non-nil.
      
      To achieve this, introduce safeCall, which takes care of handling error
      returns as well as recovering panics. Handling panics in the "call"
      function isn't strictly necessary, as that func itself is run via
      evalCall. However, this makes the code more consistent, and can allow
      for better context in panics via the "call" function.
      
      Finally, add some test cases with a mix of funcs, methods, and func
      fields that panic.
      
      Fixes #28242.
      
      Change-Id: Id67be22cc9ebaedeb4b17fa84e677b4b6e09ec67
      Reviewed-on: https://go-review.googlesource.com/c/143097
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRob Pike <r@golang.org>
      202e9031
    • Martin Möhrmann's avatar
      internal/cpu: add options and warnings for required cpu features · 980340ad
      Martin Möhrmann authored
      Updates #27218
      
      Change-Id: I8603f3a639cdd9ee201c4f1566692e5b88877fc4
      Reviewed-on: https://go-review.googlesource.com/c/144107
      Run-TryBot: Martin Möhrmann <martisch@uos.de>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      980340ad
  2. 23 Oct, 2018 24 commits
  3. 22 Oct, 2018 7 commits