1. 19 Nov, 2019 5 commits
    • Ian Lance Taylor's avatar
      runtime: release timersLock while running timer · 2d8c1995
      Ian Lance Taylor authored
      Dan Scales pointed out a theoretical deadlock in the runtime.
      
      The timer code runs timer functions while holding the timers lock for a P.
      The scavenger queues up a timer function that calls wakeScavenger,
      which acquires the scavenger lock.
      
      The scavengeSleep function acquires the scavenger lock,
      then calls resetTimer which can call addInitializedTimer
      which acquires the timers lock for the current P.
      
      So there is a potential deadlock, in that the scavenger lock and
      the timers lock for some P may both be acquired in different order.
      It's not clear to me whether this deadlock can ever actually occur.
      
      Issue 35532 describes another possible deadlock.
      
      The pollSetDeadline function acquires pd.lock for some poll descriptor,
      and in some cases calls resettimer which can in some cases acquire
      the timers lock for the current P.
      
      The timer code runs timer functions while holding the timers lock for a P.
      The timer function for poll descriptors winds up in netpolldeadlineimpl
      which acquires pd.lock.
      
      So again there is a potential deadlock, in that the pd lock for some
      poll descriptor and the timers lock for some P may both be acquired in
      different order. I think this can happen if we change the deadline
      for a network connection exactly as the former deadline expires.
      
      Looking at the code, I don't see any reason why we have to hold
      the timers lock while running a timer function.
      This CL implements that change.
      
      Updates #6239
      Updates #27707
      Fixes #35532
      
      Change-Id: I17792f5a0120e01ea07cf1b2de8434d5c10704dd
      Reviewed-on: https://go-review.googlesource.com/c/go/+/207348
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
      2d8c1995
    • Ian Lance Taylor's avatar
      time: deflake TestTicker · 3efa09f3
      Ian Lance Taylor authored
      Take the opportunity of deflaking to make it take less time to run.
      
      Updates #35537
      
      Change-Id: I91ca8094fbe18fbfcd34dfda98da1592c9c82943
      Reviewed-on: https://go-review.googlesource.com/c/go/+/207403
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3efa09f3
    • Bryan C. Mills's avatar
      cmd/go: fail tests immediately if they attempt to create a tempfile within GOROOT · c726361f
      Bryan C. Mills authored
      This will help to detect regressions of #28387 when running
      'go test cmd/go' in a writable GOROOT.
      
      Updates #28387
      Updates #30316
      
      Change-Id: I551e044111535404688b1a76e63163dfcb41bb5c
      Reviewed-on: https://go-review.googlesource.com/c/go/+/207701
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c726361f
    • David Chase's avatar
      cmd/compile: make a better bogus line for empty infinite loops · 9bba63bb
      David Chase authored
      The old recipe for making an infinite loop not be infinite
      in the debugger could create an instruction (Prog) with a
      line number not tied to any file (index == 0).  This caused
      downstream failures in DWARF processing.
      
      So don't do that.  Also adds a test, also adds a check+panic
      to ensure that the next time this happens the error is less
      mystifying.
      
      Fixes #35652
      
      Change-Id: I04f30bc94fdc4aef20dd9130561303ff84fd945e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/207613
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      9bba63bb
    • Bryan C. Mills's avatar
      cmd/go: convert TestIssue6844 to a script test · 64774172
      Bryan C. Mills authored
      It was attempting to write a test binary to the working directory.
      
      Updates #28387
      Updates #30316
      
      Change-Id: I82eca3a8a3e019dc6dacbe1f02a0583577694b93
      Reviewed-on: https://go-review.googlesource.com/c/go/+/207614
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      64774172
  2. 18 Nov, 2019 14 commits
  3. 16 Nov, 2019 3 commits
  4. 15 Nov, 2019 17 commits
  5. 14 Nov, 2019 1 commit