1. 15 Jul, 2017 16 commits
  2. 14 Jul, 2017 8 commits
  3. 13 Jul, 2017 4 commits
  4. 12 Jul, 2017 4 commits
  5. 11 Jul, 2017 3 commits
  6. 10 Jul, 2017 1 commit
  7. 09 Jul, 2017 1 commit
    • Michael Pratt's avatar
      cmd/link: skip R_ADDR relocs in .rela.plt for internal PIE · 123fd464
      Michael Pratt authored
      ld.addpltsym adds an R_X86_64_JMP_SLOT dynamic relocation to .rela.plt
      and uses Addaddrplus to reference the GOT in Elf64_Rela.r_offset.
      
      Addaddrplus results in an R_ADDR relocation, which here we transform
      into an R_X86_64_64 dynamic relocation. This is wrong for several
      reasons:
      
      1. .rela.plt is not a writable, relro section. It is mapped read-only,
         causing the dynamic linker to segfault when it tried to handle the
         relocation. This was the immediate cause of internal PIE cgo
         crashes.
      
      2. Relocations targetting other reloc sections are, as far as I can
         tell, undefined behavior in the ELF spec and are unlikely to be a
         good idea.
      
      3. Even if the relocation did work, it isn't what we want. The
         relocation, if successfully handled, would have put an absolute
         address as the JMP_SLOT offset, but it should be the offset from the
         beginning of the binary, just like any other relocation. What we want
         is a statically resolved R_ADDR relocation, just as is used below for
         the R_X86_64_64 relocation.
      
      Skipping the .rela.plt allows reloc() to handle these R_ADDR
      relocations.
      
      With this CL, internal PIE cgo binaries work.
      
      Updates #18968
      
      Change-Id: Ie74e6fe249e88150baa0e340b1cb128cf7f28673
      Reviewed-on: https://go-review.googlesource.com/47837Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      123fd464
  8. 08 Jul, 2017 1 commit
    • Josh Bleecher Snyder's avatar
      test: deflake chan/select3.go · a1e7fb4e
      Josh Bleecher Snyder authored
      On a slow or distracted machine, 0.1s is sometimes
      not long enough for a non-blocking function call to complete.
      This causes rare test flakes.
      They can be easily reproduced by reducing the wait time to (say) 100ns.
      
      For non-blocking functions, increase the window from 100ms to 10s.
      Using different windows for block and non-blocking functions,
      allows us to reduce the time for blocking functions.
      The risk here is false negatives, but that risk is low;
      this test is run repeatedly on many fast machines,
      for which 10ms is ample time.
      This reduces the time required to run the test by a factor of 10,
      from ~1s to ~100ms.
      
      Fixes #20299
      
      Change-Id: Ice9a641a66c6c101d738a2ebe1bcb144ae3c9916
      Reviewed-on: https://go-review.googlesource.com/47812
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a1e7fb4e
  9. 07 Jul, 2017 2 commits
    • Austin Clements's avatar
      runtime: use next timer to decide whether to relax · 093adeef
      Austin Clements authored
      Currently, sysmon waits 60 ms during idle before relaxing. This is
      primarily to avoid reducing the precision of short-duration timers. Of
      course, if there are no short-duration timers, this wastes 60 ms
      running the timer at high resolution.
      
      Improve this by instead inspecting the time until the next timer fires
      and relaxing the timer resolution immediately if the next timer won't
      fire for a while.
      
      Updates #20937.
      
      Change-Id: If4ad0a565b65a9b3e8c4cdc2eff1486968c79f24
      Reviewed-on: https://go-review.googlesource.com/47833
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      093adeef
    • Austin Clements's avatar
      runtime: delay before osRelaxing · 7a8f39fa
      Austin Clements authored
      Currently, sysmon relaxes the Windows timer resolution as soon as the
      Go process becomes idle. However, if it's going idle because of a
      short sleep (< 15.6 ms), this can turn that short sleep into a long
      sleep (15.6 ms).
      
      To address this, wait for 60 ms of idleness before relaxing the timer
      resolution. It would be better to check the time until the next wakeup
      and relax immediately if it makes sense, but there's currently no
      interaction between sysmon and the timer subsystem, so adding this
      simple delay is a much simpler and safer change for late in the
      release cycle.
      
      Fixes #20937.
      
      Change-Id: I817db24c3bdfa06dba04b7bc197cfd554363c379
      Reviewed-on: https://go-review.googlesource.com/47832
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      7a8f39fa