1. 27 Jun, 2018 10 commits
    • Grégoire Delattre's avatar
      net: make concurrent resolver lookups independent · 63a4acba
      Grégoire Delattre authored
      The current resolver uses a global lookupGroup which merges LookupIPAddr
      calls together for lookups for the same hostname if used concurrently.
      As a result only one of the resolvers is actually used to perform the
      DNS lookup but the result is shared by all the resolvers.
      
      This commit limits the scope of the lookupGroup to the resolver itself
      allowing each resolver to make its own requests without sharing the
      result with other resolvers.
      
      Fixes #22908
      
      Change-Id: Ibba896eebb05e59f18ce4132564ea1f2b4b6c6d9
      Reviewed-on: https://go-review.googlesource.com/80775
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      63a4acba
    • Vlad Krasnov's avatar
      crypto/elliptic: implement P256 for arm64 · 0246915f
      Vlad Krasnov authored
      This patch ports the existing optimized P256 implementation to arm64.
      
      name            old time/op    new time/op    delta
      pkg:crypto/ecdsa goos:linux goarch:arm64
      SignP256           539µs ±13%      43µs ± 2%  -91.95%  (p=0.000 n=20+20)
      SignP384          13.2ms ± 1%    13.2ms ± 1%     ~     (p=0.739 n=10+10)
      VerifyP256        1.57ms ± 0%    0.12ms ± 0%  -92.40%  (p=0.000 n=18+20)
      KeyGeneration      391µs ± 0%      25µs ± 0%  -93.62%  (p=0.000 n=9+9)
      pkg:crypto/elliptic goos:linux goarch:arm64
      BaseMult          1.66ms ± 0%    1.65ms ± 1%     ~     (p=0.079 n=9+10)
      BaseMultP256       389µs ± 0%      22µs ± 1%  -94.28%  (p=0.000 n=19+20)
      ScalarMultP256    1.03ms ± 0%    0.09ms ± 0%  -91.25%  (p=0.000 n=19+20)
      
      name            old alloc/op   new alloc/op   delta
      pkg:crypto/ecdsa goos:linux goarch:arm64
      SignP256          5.47kB ± 0%    3.20kB ± 0%  -41.50%  (p=0.000 n=20+20)
      SignP384          2.32MB ± 0%    2.32MB ± 0%     ~     (p=0.739 n=10+10)
      VerifyP256        7.65kB ± 4%    0.98kB ± 0%  -87.24%  (p=0.000 n=20+20)
      KeyGeneration     1.41kB ± 0%    0.69kB ± 0%  -51.05%  (p=0.000 n=9+10)
      pkg:crypto/elliptic goos:linux goarch:arm64
      BaseMult            224B ± 0%      224B ± 0%     ~     (all equal)
      BaseMultP256      1.12kB ± 0%    0.29kB ± 0%  -74.29%  (p=0.000 n=20+20)
      ScalarMultP256    1.59kB ± 7%    0.26kB ± 0%  -83.91%  (p=0.000 n=20+20)
      
      name            old allocs/op  new allocs/op  delta
      pkg:crypto/ecdsa goos:linux goarch:arm64
      SignP256            67.0 ± 0%      35.0 ± 0%  -47.76%  (p=0.000 n=20+20)
      SignP384           17.5k ± 0%     17.5k ± 0%     ~     (p=0.725 n=10+10)
      VerifyP256          97.2 ± 3%      17.0 ± 0%  -82.52%  (p=0.000 n=20+20)
      KeyGeneration       21.0 ± 0%      13.0 ± 0%  -38.10%  (p=0.000 n=10+10)
      pkg:crypto/elliptic goos:linux goarch:arm64
      BaseMult            5.00 ± 0%      5.00 ± 0%     ~     (all equal)
      BaseMultP256        16.0 ± 0%       6.0 ± 0%  -62.50%  (p=0.000 n=20+20)
      ScalarMultP256      19.9 ± 6%       5.0 ± 0%  -74.87%  (p=0.000 n=20+20)
      
      Fixes #22806
      
      Change-Id: I0f187074f8c3069bf8692d59e2cf95bdc6061fe7
      Reviewed-on: https://go-review.googlesource.com/99755
      Run-TryBot: Vlad Krasnov <vlad@cloudflare.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrendan McMillion <brendan@cloudflare.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0246915f
    • Brad Fitzpatrick's avatar
      net/http/httptrace: add clarification never added to CL 67430 · 87b7b667
      Brad Fitzpatrick authored
      Updates #19761
      
      Change-Id: Iac3bd4c40002f8e348452b50bff54dee3210d447
      Reviewed-on: https://go-review.googlesource.com/121236Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      87b7b667
    • Ian Lance Taylor's avatar
      mime/quotedprintable: accept bytes >= 0x80 · 228b4416
      Ian Lance Taylor authored
      RFC 2045 doesn't permit non-ASCII bytes, but some systems send them
      anyhow. With this change, we accept them. This does make it harder to
      validate quotedprintable data, but on balance this seems like the best
      approach given the existence of systems that generate invalid data.
      
      Fixes #22597
      
      Change-Id: I9f80f90a60b76ada2b5dea658b8dc8aace56cdbd
      Reviewed-on: https://go-review.googlesource.com/121095Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      228b4416
    • Ian Lance Taylor's avatar
      net: limit concurrent threads to limit on file descriptors · b7498450
      Ian Lance Taylor authored
      At least on Darwin, if getaddrinfo can't open a file descriptor it
      returns EAI_NONAME ("no such host") rather than a meaningful error.
      Limit the number of concurrent getaddrinfo calls to the number of file
      descriptors we can open, to make that meaningless error less likely.
      
      We don't apply the same limit to Go lookups, because for that we will
      return a meaningful "too many open files" error.
      
      Fixes #25694
      
      Change-Id: I601857190aeb64f11e22b4a834c1c6a722a0788d
      Reviewed-on: https://go-review.googlesource.com/121176Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      b7498450
    • Meir Fischer's avatar
      net/http/httptrace: expose request headers for http/1.1 · 7c4c87c0
      Meir Fischer authored
      Some headers, which are set or modified by the http library,
      are not written to the standard http.Request.Header and are
      not included as part of http.Response.Request.Header.
      
      Exposing all headers alleviates this problem.
      
      This is not a complete solution to 19761 since it does not have http/2 support.
      
      Updates #19761
      
      Change-Id: Ie8d4f702f4f671666b120b332378644f094e288b
      Reviewed-on: https://go-review.googlesource.com/67430
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7c4c87c0
    • Cherry Zhang's avatar
      cmd/compile: fold offset into address on Wasm · 1d303a00
      Cherry Zhang authored
      On Wasm, the offset was not folded into LoweredAddr, so it was
      not rematerializeable. This led to the address-taken operation
      in some cases generated too early, before the local variable
      becoming live. The liveness code thinks the variable live when
      the address is taken, then backs it up to live at function
      entry, then complains about it, because nothing other than
      arguments should be live on entry.
      
      This CL folds the offset into the address operation, so it is
      rematerializeable and so generated right before use, after the
      variable actually becomes live.
      
      It might be possible to relax the liveness code not to think a
      variable live when its address being taken, but until the address
      actually being used. But it would be quite complicated. As we're
      late in Go 1.11 freeze, it would be better not to do it. Also,
      I think the address operation is rematerializeable now on all
      architectures, so this is probably less necessary.
      
      This may also be a slight optimization, as the address+offset is
      now rematerializeable, which can be generated on the Wasm stack,
      without using any "registers" which are emulated by local
      variables on Wasm. I don't know how to do benchmarks on Wasm. At
      least, cmd/go binary size shrinks 9K.
      
      Fixes #25966.
      
      Change-Id: I01e5869515d6a3942fccdcb857f924a866876e57
      Reviewed-on: https://go-review.googlesource.com/120599
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRichard Musiol <neelance@gmail.com>
      1d303a00
    • Ian Lance Taylor's avatar
      misc/cgo/test: add retry loop around pthread_create in TestSigprocmask · f03ee913
      Ian Lance Taylor authored
      This is the same retry loop we use in _cgo_try_pthread_create in runtime/cgo.
      
      Fixes #25078
      
      Change-Id: I7ef4d4fc7fb89cbfb674c4f93cbdd7a033dd8983
      Reviewed-on: https://go-review.googlesource.com/121096
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      f03ee913
    • Ian Lance Taylor's avatar
      misc/cgo/test: skip Test18146 in short mode · fbfd38c5
      Ian Lance Taylor authored
      Fixes #21219
      
      Change-Id: I1a2ec1afe06586ed33a3a855b77536490cac3a38
      Reviewed-on: https://go-review.googlesource.com/121115
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      fbfd38c5
    • LE Manh Cuong's avatar
      cmd/link: document limitation of -X · 6dd789fd
      LE Manh Cuong authored
      Fixes #26042
      
      Change-Id: Ica16f14a65c03659a19926852cca5e554c99baf1
      Reviewed-on: https://go-review.googlesource.com/120935Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      6dd789fd
  2. 26 Jun, 2018 10 commits
  3. 25 Jun, 2018 10 commits
  4. 24 Jun, 2018 1 commit
  5. 23 Jun, 2018 1 commit
  6. 22 Jun, 2018 8 commits
    • Andrew Bonventre's avatar
      api: promote next to go1.11 · 899e0e35
      Andrew Bonventre authored
      Change-Id: Ib8fa0a12363993033201ff707c315f4030811f89
      Reviewed-on: https://go-review.googlesource.com/120595
      Run-TryBot: Andrew Bonventre <andybons@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      899e0e35
    • Heschi Kreinick's avatar
      cmd/link: support DWARF compression on Darwin · 726a2d04
      Heschi Kreinick authored
      We want to compress DWARF even on macOS, but the native toolchain isn't
      going to understand it. Add a flag that can be used to disable
      compression, then add Darwin to the whitelist used during internal
      linking.
      
      Unlike GNU ld, the Darwin linker doesn't have a handy linker flag to do
      compression. But since we're already doing surgery to put the DWARF in
      the output executable in the first place, compressing it at the same
      time isn't unduly difficult. This does have the slightly odd effect of
      compressing some Apple proprietary debug sections, which absolutely
      nothing will understand. Leaving them uncompressed didn't make much
      sense, though, since I doubt they're useful without (say) __debug_info.
      
      Updates #11799
      
      Change-Id: Ie00b0215c630a798c59d009a641e2d13f0e7ea01
      Reviewed-on: https://go-review.googlesource.com/120155
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      726a2d04
    • Brad Fitzpatrick's avatar
      syscall, internal/poll: fix build on js/wasm · 3dced519
      Brad Fitzpatrick authored
      Fixes #26014
      
      Change-Id: I9d92414a9181c5d189e3e266666950656bf00406
      Reviewed-on: https://go-review.googlesource.com/120576
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarAndrew Bonventre <andybons@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3dced519
    • Brad Fitzpatrick's avatar
      cmd/dist: skip non-std tests on js/wasm · 7d50abf0
      Brad Fitzpatrick authored
      After the std tests, most of the rest of the tests aren't applicable
      to js/wasm. (anything with -cpu=>1, cgo, etc)
      
      Skip them all for now. We can incrementally re-enable them over time
      as the js/wasm port is fleshed out. But let's get the builder column
      black again so we can enable trybots and keep it black.
      
      Updates #26014
      Updates #26015
      Updates #18892
      
      Change-Id: I8992ed3888f598fa42273ce8646a32d62ce45b1d
      Reviewed-on: https://go-review.googlesource.com/120575
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAndrew Bonventre <andybons@golang.org>
      7d50abf0
    • Matthew Dempsky's avatar
      cmd/compile: fix compile failure for lazily resolved shadowed types · f422bea4
      Matthew Dempsky authored
      If expanding an inline function body required lazily expanding a
      package-scoped type whose identifier was shadowed within the function
      body, the lazy expansion would instead overwrite the local symbol
      definition instead of the package-scoped symbol. This was due to
      importsym using s.Def instead of s.PkgDef.
      
      Unfortunately, this is yet another consequence of the current awkward
      scope handling code.
      
      Passes toolstash-check.
      
      Fixes #25984.
      
      Change-Id: Ia7033e1749a883e6e979c854d4b12b0b28083dd8
      Reviewed-on: https://go-review.googlesource.com/120456
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      f422bea4
    • Cherry Zhang's avatar
      cmd/compile: convert uint32 to int32 in ARM constant folding rules · 78a57931
      Cherry Zhang authored
      MOVWconst's AuxInt is Int32. SSA check complains if the AuxInt
      does not fit in int32. Convert uint32 to int32 to make it happy.
      
      The generated code is unchanged. MOVW only cares low 32 bits.
      
      Passes "toolstash -cmp" std cmd for ARM.
      
      Fixes #25993.
      
      Change-Id: I2b6532c9c285ea6d89652505fb7c553f85a98864
      Reviewed-on: https://go-review.googlesource.com/120335
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      78a57931
    • Dmitri Shuralyov's avatar
      doc/go1.11: clarify GOOS/GOARCH pair of WebAssembly port · 82d1c2a8
      Dmitri Shuralyov authored
      It's more common to specify GOOS/GOARCH values in that order,
      rather than the inverse. Fix the order.
      
      Updates #18892.
      
      Change-Id: I8551508599e019f6617dc007397b562c9926418d
      Reviewed-on: https://go-review.googlesource.com/120057Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      82d1c2a8
    • Dmitry Vyukov's avatar
      sync: fix deficiency in RWMutex race annotations · f451a318
      Dmitry Vyukov authored
      Remove unnecessary race.Release annotation from Unlock.
      
      For RWMutex we want to establish the following happens-before (HB) edges:
      1. Between Unlock and the subsequent Lock.
      2. Between Unlock and the subsequent RLock.
      3. Between batch of RUnlock's and the subsequent Lock.
      
      1 is provided by Release(&rw.readerSem) in Unlock and Acquire(&rw.readerSem) in Lock.
      2 is provided by Release(&rw.readerSem) in Unlock and Acquire(&rw.readerSem) in RLock.
      3 is provided by ReleaseMerge(&rw.writerSem) in RUnlock in Acquire(&rw.writerSem) in Lock,
      since we want to establish HB between a batch of RUnlock's this uses ReleaseMerge instead of Release.
      
      Release(&rw.writerSem) in Unlock is simply not needed.
      
      FWIW this is also how C++ tsan handles mutexes, not a proof but at least something.
      Making 2 implementations consistent also simplifies any kind of reasoning against both of them.
      
      Since this only affects performance, a reasonable test is not possible.
      Everything should just continue to work but slightly faster.
      
      Credit for discovering this goes to Jamie Liu.
      
      Change-Id: Ice37d29ecb7a5faed3f7781c38dd32c7469b2735
      Reviewed-on: https://go-review.googlesource.com/120495
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      f451a318