1. 12 Jun, 2018 17 commits
  2. 11 Jun, 2018 14 commits
    • Michael Fraenkel's avatar
      cmd/doc: continue to search when package import fails · d0d47bb9
      Michael Fraenkel authored
      Keep searching for a package that is both findable and importable. The
      current code would always guarantee that a package was findable but
      exited if it was not importable.
      
      Fixes #25478
      
      Change-Id: I237b7dfafb930cae02538c4a2e4d5ce0c1058478
      Reviewed-on: https://go-review.googlesource.com/114295Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
      Reviewed-by: 's avatarRob Pike <r@golang.org>
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d0d47bb9
    • Iskander Sharipov's avatar
      runtime: remove TODO notes suggesting jump tables · f864d89e
      Iskander Sharipov authored
      For memmove/memclr using jump tables only reduces overall
      function performance for both amd64 and 386.
      
      Benchmarks for 32-bit memclr:
      
      	name            old time/op    new time/op    delta
      	Memclr/5-8        8.01ns ± 0%    8.94ns ± 2%  +11.59%  (p=0.000 n=9+9)
      	Memclr/16-8       9.05ns ± 0%    9.49ns ± 0%   +4.81%  (p=0.000 n=8+8)
      	Memclr/64-8       9.15ns ± 0%    9.49ns ± 0%   +3.76%  (p=0.000 n=9+10)
      	Memclr/256-8      16.6ns ± 0%    16.6ns ± 0%     ~     (p=1.140 n=10+9)
      	Memclr/4096-8      179ns ± 0%     166ns ± 0%   -7.26%  (p=0.000 n=9+8)
      	Memclr/65536-8    3.36µs ± 1%    3.31µs ± 1%   -1.48%  (p=0.000 n=10+9)
      	Memclr/1M-8       59.5µs ± 3%    60.5µs ± 2%   +1.67%  (p=0.009 n=10+10)
      	Memclr/4M-8        239µs ± 3%     245µs ± 0%   +2.49%  (p=0.004 n=10+8)
      	Memclr/8M-8        618µs ± 2%     614µs ± 1%     ~     (p=0.315 n=10+8)
      	Memclr/16M-8      1.49ms ± 2%    1.47ms ± 1%   -1.11%  (p=0.029 n=10+10)
      	Memclr/64M-8      7.06ms ± 1%    7.05ms ± 0%     ~     (p=0.573 n=10+8)
      	[Geo mean]        3.36µs         3.39µs        +1.14%
      
      For less predictable data, like loop iteration dependant sizes,
      branch table still shows 2-5% worse results.
      It also makes code slightly more complicated.
      
      This CL removes TODO note that directly suggest trying this
      optimization out. That encourages people to spend their time
      in a quite hopeless endeavour.
      
      The code used to implement branch table used a 32/64-entry table
      with pointers to TEXT blocks that implemented every associated
      label work. Most last entries point to "loop" code that is
      a fallthrough for all other sizes that do not map into specialized
      routines. The only inefficiency is extra MOVL/MOVQ required
      to fetch table pointer itself as MOVL $sym<>(SB)(AX*4) is not valid
      in Go asm (it works in other assemblers):
      
      	TEXT ·memclrNew(SB), NOSPLIT, $0-8
              	MOVL    ptr+0(FP), DI
              	MOVL    n+4(FP), BX
              	// Handle 0 separately.
              	TESTL   BX, BX
              	JEQ     _0
              	LEAL    -1(BX), CX // n-1
              	BSRL    CX, CX
      		// AX or X0 zeroed inside every text block.
             		MOVL    $memclrTable<>(SB), AX
              	JMP     (AX)(CX*4)
      	_0:
              	RET
      
      Change-Id: I4f706931b8127f85a8439b95834d5c2485a5d1bf
      Reviewed-on: https://go-review.googlesource.com/115678
      Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      f864d89e
    • David du Colombier's avatar
      cmd/nm: fix TestGoExec on Plan 9 · 92f8acd1
      David du Colombier authored
      CL 115975 changed TestGoExec to check symbol types.
      However, this test is failing on Plan 9, because
      there is no read-only data segment symbol on Plan 9.
      
      This change fixes TestGoExec to replace the check
      of read-only data segment symbol (R) by data segment
      symbol (D) on Plan 9.
      
      Fixes #25820.
      
      Change-Id: I7164cd9056fa1dfcd1dc1b0f87653290c14c85fa
      Reviewed-on: https://go-review.googlesource.com/118035
      Run-TryBot: David du Colombier <0intro@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      92f8acd1
    • Paul Jolly's avatar
      cmd/go: set DepOnly on package when calling go list -deps · 131d7e0d
      Paul Jolly authored
      Currently .DepOnly is set when go list -test is invoked to help
      distinguish those packages that matched the command line spec from those
      which are dependencies (of test packages). This is also useful when
      calling go list -deps for the same reason.
      
      Change-Id: Ifc0e68dad0fd01355928793ef803691dee5f4f29
      Reviewed-on: https://go-review.googlesource.com/112755
      Run-TryBot: Paul Jolly <paul@myitcv.org.uk>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
      Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      131d7e0d
    • Russ Cox's avatar
      cmd/vet: add support for vet-specific export data · b111f3cc
      Russ Cox authored
      An upcoming change to cmd/go will enable this functionality, which
      allows vet to write down information about one package for use by
      later invocation of vet that analyze code importing that package.
      
      We've intended to do this for a long time, but the build caching was
      necessary to have a decent way to manage the vet-specific export data.
      
      This is also an experiment in building scalable whole-program analyses.
      In the long term we'd like to allow other analyses to be invoked this way.
      
      Change-Id: I34e4b70445786b2e8707ff6a0c00947bf1491511
      Reviewed-on: https://go-review.googlesource.com/117099
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
      b111f3cc
    • Lynn Boger's avatar
      runtime/race: implement race detector for ppc64le · 9e9ff565
      Lynn Boger authored
      This adds the support to enable the race detector for ppc64le.
      
      Added runtime/race_ppc64le.s to manage the calls from Go to the
      LLVM tsan functions, mostly converting from the Go ABI to the
      PPC64 ABI expected by Clang generated code.
      
      Changed racewalk.go to call racefuncenterfp instead of racefuncenter
      on ppc64le to allow the caller pc to be obtained in the asm code
      before calling the tsan version.
      
      Changed the set up code for racecallbackthunk so it doesn't use
      the autogenerated save and restore of the link register since that
      sequence uses registers inconsistent with the normal ppc64 ABI.
      
      Made various changes to recognize that race is supported for
      ppc64le.
      
      Ensured that tls_g is updated and accessible from race_linux_ppc64le.s
      so that the race ctx can be obtained and passed to tsan functions.
      
      This enables the race tests for ppc64le in cmd/dist/test.go and
      increases the timeout when running the benchmarks with the -race
      option to avoid timing out.
      
      Updates #24354, #23731
      
      Change-Id: Ib97dc7ac313e6313c836dc7d2fb698f9d8fba3ef
      Reviewed-on: https://go-review.googlesource.com/107935
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      9e9ff565
    • Yury Smolsky's avatar
      cmd/compile: fix wording in README · 1de0dcfc
      Yury Smolsky authored
      "Syntax analysis" sounds more familiar and fits the
      item before, which says "lexical analysis".
      If there was specific intention to the original wording,
      I, as a reader, would like to see it instead of this
      confusing wording.
      
      Change-Id: Id32dbf75300a86b21cb9f35e54526184fe5df6cb
      Reviewed-on: https://go-review.googlesource.com/117696Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      1de0dcfc
    • Yury Smolsky's avatar
      cmd/compile: add doc comment to the parseFiles function · e411bd70
      Yury Smolsky authored
      Change-Id: Ifa14557ba834865602c207297ccf0c63e93feb4c
      Reviewed-on: https://go-review.googlesource.com/117695
      Run-TryBot: Yury Smolsky <yury@smolsky.by>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      e411bd70
    • Alberto Donizetti's avatar
      lib/time: update vendored tzdata to release 2018e · bb222cde
      Alberto Donizetti authored
      It has been a long time since the last time the vendored zoneinfo in
      lib/time was updated, and we're well into the freeze. Update it to the
      lastest release from IANA.
      
      Updates #22487
      
      Change-Id: Ib9a8eb409554848285fc88363dbb04ed9d6d9eb0
      Reviewed-on: https://go-review.googlesource.com/117855Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      bb222cde
    • Lynn Boger's avatar
      runtime: restore r2 when restoring state from gobuf in gogo on ppc64x · 30a63ece
      Lynn Boger authored
      When using plugins with goroutines calling cgo, we hit a case where
      an intermittent SIGSEGV occurs when referencing an address that is based
      on r2 (TOC address). When the failure can be generated in gdb, the
      contents of r2 is wrong even though the value in the current stack's
      slot for r2 is correct. So that means it somehow switched to start
      running the code in this function without passing through the beginning
      of the function which had the correct value of r2 and stored it there.
      
      It was noted that in runtime.gogo when the state is restored from
      gobuf, r2 is not restored from its slot on the stack. Adding the
      instruction to restore r2 prevents the SIGSEGV.
      
      This adds a testcase under testplugin which reproduces the problem if
      the program is run multiple times. The team who reported this problem
      has verified it fixes the issue on their larger, more complex
      application.
      
      Fixes #25756
      
      Change-Id: I6028b6f1f8775d5c23f4ebb57ae273330a28eb8f
      Reviewed-on: https://go-review.googlesource.com/117515
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      30a63ece
    • Michael Munday's avatar
      crypto, internal/cpu: fix s390x AES feature detection and update SHA implementations · 7ba0c623
      Michael Munday authored
      Hardware AES support in Go on s390x currently requires ECB, CBC
      and CTR modes be available. It also requires that either the
      GHASH or GCM facilities are available. The existing checks missed
      some of these constraints.
      
      While we're here simplify the cpu package on s390x, moving masking
      code out of assembly and into Go code. Also, update SHA-{1,256,512}
      implementations to use the cpu package since that is now trivial.
      
      Finally I also added a test for internal/cpu on s390x which loads
      /proc/cpuinfo and checks it against the flags set by internal/cpu.
      
      Updates #25822 for changes to vet whitelist.
      
      Change-Id: Iac4183f571643209e027f730989c60a811c928eb
      Reviewed-on: https://go-review.googlesource.com/114397
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      7ba0c623
    • Tobias Klauser's avatar
      net: skip TestSendfileParts on dragonfly and solaris · 40fc4bbf
      Tobias Klauser authored
      Skip it like on freebsd until there is proper a fix for #25809
      
      Updates #25809
      
      Change-Id: Id53c433aee75f2a992ab6a8d58d98fd1f8a6c1c6
      Reviewed-on: https://go-review.googlesource.com/117698
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAlex Brainman <alex.brainman@gmail.com>
      40fc4bbf
    • Alex Brainman's avatar
      net: add TestSendfileParts · 679690f3
      Alex Brainman authored
      Add test for freebsd issue #25809.
      
      This test also fails on my Windows 10 Version 1803.
      My hope is that adding new test will break one of our builders.
      
      Updates #25722
      Updates #25809
      
      Change-Id: Ia103bc708b8fa3b9af57613acc44893f90b3fa18
      Reviewed-on: https://go-review.googlesource.com/117775
      Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      679690f3
    • Thanabodee Charoenpiriyakij's avatar
      syscall: update TOKEN_ALL_ACCESS according to WinNT.h · b74f7321
      Thanabodee Charoenpiriyakij authored
      TOKEN_ALL_ACCESS was changed at some stage by Microsoft.
      
      Updates #25775
      
      Change-Id: I3e18914207a0020b2ebfb99f4e57aa55f9de813b
      Reviewed-on: https://go-review.googlesource.com/117635
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAlex Brainman <alex.brainman@gmail.com>
      b74f7321
  3. 10 Jun, 2018 2 commits
  4. 09 Jun, 2018 2 commits
  5. 08 Jun, 2018 5 commits
    • Ian Lance Taylor's avatar
      cmd/go: add Solaris assembler syntax for gccgo buildid file · 77d5c628
      Ian Lance Taylor authored
      The Solaris assembler uses a different syntax for section directives.
      
      Fixes https://gcc.gnu.org/PR85429.
      
      Change-Id: I1e54dffee3290046dbb68ba4e90ab795c6b72571
      Reviewed-on: https://go-review.googlesource.com/109140
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      77d5c628
    • Iskander Sharipov's avatar
      cmd/link: fix duplicated "unresolved inter-package jump" errors · 289ab304
      Iskander Sharipov authored
      This is extension to https://golang.org/cl/113955 that handled
      duplicated "unresolved relocation" errors.
      
      For platforms with trampoline support, additional error is generated
      per each undefined symbol. This breaks TestUndefinedRelocErrors test
      on these platforms.
      
      Proposed fix:
      
      	1. Changes error text to be identical to normal undefined reloc.
      	   If relocation is undefined, jump to it will be unresolved
      	   as well.
      
      	2. Introduces a map that can be used by all sites that
      	   handle this kind of errors which makes it easier
      	   to report such errors exactly once.
      
      Errors on ppc64 before this change (note first 4 lines):
      
      	main.defined1: unresolved inter-package jump to main.undefined()
      	main.defined1: unresolved inter-package jump to main.undefined()
      	main.defined2: unresolved inter-package jump to main.undefined()
      	main.defined2: unresolved inter-package jump to main.undefined()
      	main.defined1: relocation target main.undefined not defined
      	main.defined2: relocation target main.undefined not defined
      	runtime.main_main·f: function main is undeclared in the main package
      
      After this change:
      
      	main.defined1: relocation target main.undefined not defined
      	main.defined2: relocation target main.undefined not defined
      	runtime.main_main·f: function main is undeclared in the main package
      
      Because of (1), errors output is the same on all platforms now.
      
      Fixes #25753
      
      Change-Id: Ic3084202a6fc5d4a6d2d0a93344f012b37fe58ed
      Reviewed-on: https://go-review.googlesource.com/116676
      Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      289ab304
    • Richard Musiol's avatar
      misc/wasm: set non-empty default for os.Args · 96faeb0b
      Richard Musiol authored
      os.Args is usually never empty and the flag package panics if it is.
      This commit makes os.Args default to ["js"] for js/wasm.
      
      Change-Id: Iba527145686487b052da438fca40159e57e61a81
      Reviewed-on: https://go-review.googlesource.com/117475Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      96faeb0b
    • philhofer's avatar
      runtime: fix pprof livelock on arm · afae876b
      philhofer authored
      On 32-bit architectures without native 64-bit atomic instructions,
      64-bit atomics are emulated using spinlocks. However,
      the sigprof handling code expects to be able to perform
      64-bit atomic operations in signal handlers. Spinning on an
      acquired spinlock in a signal handler leads to a livelock.
      This is issue #20146.
      
      The original fix for #20146 did not include arm in
      the list of architectures that need to work around portability
      issues in the sigprof handler code. The unit test designed to
      catch this issue does not fail on arm builds because arm uses
      striped spinlocks, and thus the livelock takes many minutes
      to reproduce. This is issue #24260. (This patch doesn't completely
      fix #24260 on go1.10.2 due to issue #25785, which is probably
      related to the arm cas kernel helpers. Those have been removed
      at tip.)
      
      With this patch applied, I was able to run the reproducer for
      issue #24260 for more than 90 minutes without reproducing the
      livelock. Without this patch, the livelock took as little as
      8 minutes to reproduce.
      
      Fixes #20146
      Updates #24260
      
      Change-Id: I64bf53a14d53c4932367d919ac55e17c99d87484
      Reviewed-on: https://go-review.googlesource.com/117057
      Run-TryBot: Philip Hofer <phofer@umich.edu>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      afae876b
    • David du Colombier's avatar
      cmd/cover: fix TestCoverHTML on Plan 9 · abeac091
      David du Colombier authored
      CL 116975 added TestCoverHTML. However, this test is failing
      on Plan 9, because the GNU diff tool is called "ape/diff"
      instead of "diff" on Plan 9.
      
      This change replaces the "diff" command by the "ape/diff"
      command on Plan 9.
      
      Fixes #25795.
      
      Change-Id: I15b49868cd09f3f977aa13fffdfc430c882bf757
      Reviewed-on: https://go-review.googlesource.com/117415
      Run-TryBot: David du Colombier <0intro@gmail.com>
      Reviewed-by: 's avatarDaniel Martí <mvdan@mvdan.cc>
      Reviewed-by: 's avatarAlex Brainman <alex.brainman@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      abeac091