Skip to content
Permalink
Branch: master
Commits on Dec 6, 2019
  1. sync: deflake TestWaitGroupMisuse3

    ianlancetaylor committed Dec 5, 2019
    If one of the helper goroutine panics, the main goroutine call to Wait
    may hang forever waiting for something to call Done. Put that call in
    a goroutine like the others.
    
    Fixes #35774
    
    Change-Id: I8d2b58d8f473644a49a95338f70111d4e6ed4e12
    Reviewed-on: https://go-review.googlesource.com/c/go/+/210218
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
  2. runtime: add Gosched to TestSelectStackAdjust loop

    ianlancetaylor committed Dec 5, 2019
    Give the runtime more of a chance to do other work in a tight loop.
    
    Fixes #34693
    
    Change-Id: I8df6173d2c93ecaccecf4520a6913b495787df78
    Reviewed-on: https://go-review.googlesource.com/c/go/+/210217
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
Commits on Dec 5, 2019
  1. cmd/link: when changing to Segrelrodata, reset datsize

    ianlancetaylor committed Nov 26, 2019
    Otherwise we leave a gap at the start of Segrelrodata equal to the
    size of the read-only non-relro data, which causes -buildmode=pie
    executables to be noticeably larger than -buildmode=exe executables.
    
    Change-Id: I98956ef29d5b7a57ad8e633c823ac09d9ca36a45
    Reviewed-on: https://go-review.googlesource.com/c/go/+/208897
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Cherry Zhang <cherryyz@google.com>
Commits on Dec 3, 2019
  1. runtime: treat call from runtime as transient in TestDebugCall

    ianlancetaylor committed Nov 18, 2019
    Fixes #32985
    
    Change-Id: I5d504715dcc92d4f4f560ea2e843d9275f938685
    Reviewed-on: https://go-review.googlesource.com/c/go/+/207620
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
    Reviewed-by: Austin Clements <austin@google.com>
Commits on Dec 2, 2019
  1. runtime: use current P's race context in timer code

    ianlancetaylor committed Dec 2, 2019
    We were using the race context of the P that held the timer,
    but since we unlock the P's timers while executing a timer
    that could lead to a race on the race context itself.
    
    Updates #6239
    Updates #27707
    Fixes #35906
    
    Change-Id: I5f9d5f52d8e28dffb88c3327301071b16ed1a913
    Reviewed-on: https://go-review.googlesource.com/c/go/+/209580
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Keith Randall <khr@golang.org>
    Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commits on Nov 19, 2019
  1. doc/go1.14: mention new, more efficient, timers

    ianlancetaylor committed Nov 19, 2019
    Change-Id: I71fc3016106db733b888f3daccc00b493abe39b2
    Reviewed-on: https://go-review.googlesource.com/c/go/+/207840
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  2. time: give TestTicker more time on darwin-arm64

    ianlancetaylor committed Nov 19, 2019
    The darwin-arm64-correlium builder was failing the test consistently
    at the old values. Give the ticks more time to let the test pass.
    
    Updates #35692
    
    Change-Id: Ibc636cd4db2595c82f4e8c6c822c3df4c2b7e0a1
    Reviewed-on: https://go-review.googlesource.com/c/go/+/207839
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
  3. runtime, time: remove old timer code

    ianlancetaylor committed Apr 12, 2019
    Updates #6239
    Updates #27707
    
    Change-Id: I65e6471829c9de4677d3ac78ef6cd7aa0a1fc4cb
    Reviewed-on: https://go-review.googlesource.com/c/go/+/171884
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: Michael Knyszek <mknyszek@google.com>
    Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
  4. runtime: release timersLock while running timer

    ianlancetaylor committed Nov 15, 2019
    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: Michael Knyszek <mknyszek@google.com>
  5. time: deflake TestTicker

    ianlancetaylor committed Nov 18, 2019
    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: Brad Fitzpatrick <bradfitz@golang.org>
Commits on Nov 16, 2019
  1. net: add more timing slop for TestDialParallel on Windows

    ianlancetaylor committed Nov 16, 2019
    Fixes #35616
    
    Change-Id: I51b2490100cfe0e902da09eee8d027e0ec86ed53
    Reviewed-on: https://go-review.googlesource.com/c/go/+/207466
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Commits on Nov 15, 2019
  1. time: only fail TestAfterStop if it fails five times in a row

    ianlancetaylor committed Nov 15, 2019
    The test is inherently slightly flaky, so repeat to reduce flakiness.
    
    Fixes #35537
    
    Change-Id: Id918d48d33c7d5e19c4f24df104adc7fbf3720f2
    Reviewed-on: https://go-review.googlesource.com/c/go/+/207457
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
Commits on Nov 14, 2019
  1. os/signal: don't ignore SIGINT in TestAtomicStop child process

    ianlancetaylor committed Nov 14, 2019
    Fixes #35085
    
    Change-Id: Ice611e1223392f687061a43fd4c2298ea22774fb
    Reviewed-on: https://go-review.googlesource.com/c/go/+/207081
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
Commits on Nov 13, 2019
  1. os/exec: skip poll descriptors when checking for open descriptors

    ianlancetaylor committed Nov 13, 2019
    It turns out that there is a path that initializes netpoll and opens
    file descriptors before running the os/exec init function: on some
    systems, the uses of NewFile when setting os.Stdin and friends can
    initialize netpoll which can open file descriptors. This in itself
    is not a problem, but when we check whether the new files are open
    using os.NewFile, a side-effect is to put them into non-blocking mode.
    This can then break future uses of netpoll.
    
    Updates #35469
    Fixes #35566
    
    Change-Id: I1b2e2c943695d1c2d29496b050abbce9ee710a00
    Reviewed-on: https://go-review.googlesource.com/c/go/+/207078
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
  2. runtime: acquire timersLocks around moveTimers

    ianlancetaylor committed Nov 13, 2019
    In the discussion of CL 171828 we decided that it was not necessary to
    acquire timersLock around the call to moveTimers, because the world is
    stopped. However, that is not correct, as sysmon runs even when the world
    is stopped, and it calls timeSleepUntil which looks through the timers.
    timeSleepUntil acquires timersLock, but that doesn't help if moveTimers
    is running at the same time.
    
    Updates #6239
    Updates #27707
    Updates #35462
    
    Change-Id: I346c5bde594c4aff9955ae430b37c2b6fc71567f
    Reviewed-on: https://go-review.googlesource.com/c/go/+/206938
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Michael Knyszek <mknyszek@google.com>
  3. os/exec: don't run TestExtraFiles if extra files were open for the test

    ianlancetaylor committed Nov 13, 2019
    Our attempts to close existing open files are flaky. They will fail if,
    for example, file descriptor 3 is open when the test binary starts.
    Instead, report any such cases, and skip TestExtraFiles.
    
    Updates #35469
    
    Change-Id: I7caec083f3f4a31579bf28fc9c82ae89b1bde49a
    Reviewed-on: https://go-review.googlesource.com/c/go/+/206939
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
Commits on Nov 12, 2019
  1. runtime: use pipe rather than note in TestSignalM

    ianlancetaylor committed Nov 8, 2019
    At least on Darwin notewakeup is not async-signal-safe.
    
    Fixes #35276
    
    Change-Id: I1d7523715e8e77dbd7f21d9b1ed131e52d46cc41
    Reviewed-on: https://go-review.googlesource.com/c/go/+/206078
    Reviewed-by: Austin Clements <austin@google.com>
Commits on Nov 9, 2019
  1. os/signal: use a larger channel buffer for all signals in TestSignal

    ianlancetaylor committed Nov 8, 2019
    Now that the runtime can send preemption signals, it is possible that
    a channel that asks for all signals can see both SIGURG and SIGHUP
    before reading either, in which case one of the signals will be dropped.
    We have to use a larger buffer so that the test see the signal it expects.
    
    Fixes #35466
    
    Change-Id: I36271eae0661c421780c72292a5bcbd443ada987
    Reviewed-on: https://go-review.googlesource.com/c/go/+/206257
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
Commits on Nov 8, 2019
  1. runtime: add pipe/pipe2 on Solaris

    ianlancetaylor committed Nov 8, 2019
    This adds pipe/pipe2 on Solaris as they exist on other Unix systems.
    They were not added previously because Solaris does not need them
    for netpollBreak. They are added now in preparation for using pipes
    in TestSignalM.
    
    Updates #35276
    
    Change-Id: I53dfdf077430153155f0a79715af98b0972a841c
    Reviewed-on: https://go-review.googlesource.com/c/go/+/206077
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  2. runtime: if InjectDebugCall sees "not at safe point", keep trying

    ianlancetaylor authored and bradfitz committed Nov 6, 2019
    Fixes #35376
    
    Change-Id: Ib95ad336425e73cc4d412dafed0ba5e0a8130bd2
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205718
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
  3. runtime: sleep a bit when waiting for running debug call goroutine

    ianlancetaylor committed Nov 5, 2019
    Without this CL, one of the TestDebugCall tests would fail 1% to 2% of
    the time on the android-amd64-emu gomote. With this CL, I ran the
    tests for 1000 iterations with no failures.
    
    Fixes #32985
    
    Change-Id: I541268a2a0c10d0cd7604f0b2dbd15c1d18e5730
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205248
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
  4. Revert "math/cmplx: handle special cases"

    ianlancetaylor authored and bradfitz committed Nov 8, 2019
    This reverts CL 169501.
    
    Reason for revert: The new tests fail at least on s390x and MIPS. This is likely a minor bug in the compiler or runtime. But this point in the release cycle is not the time to debug these details, which are unlikely to be new. Let's try again for 1.15.
    
    Updates #29320
    Fixes #35443
    
    Change-Id: I2218b2083f8974b57d528e3742524393fc72b355
    Reviewed-on: https://go-review.googlesource.com/c/go/+/206037
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Bryan C. Mills <bcmills@google.com>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Commits on Nov 7, 2019
  1. runtime: set GODEBUG=asyncpreemptoff=1 in TestCrashDumpsAllThreads

    ianlancetaylor committed Nov 6, 2019
    Fixes #35356
    
    Change-Id: I67b9e57b88d00ed98cbc3aa0aeb26b5f2d75a3f7
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205720
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: Cherry Zhang <cherryyz@google.com>
  2. net: skip TestDialCancel if Dial fails with "connection refused"

    ianlancetaylor committed Nov 6, 2019
    Fixes #15191
    
    Change-Id: I86214ede619400acd44f21138b5ddf6cef4649a3
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205698
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Commits on Nov 6, 2019
  1. runtime: mark testSetPanicOnFault as go:nocheckptr

    ianlancetaylor committed Nov 6, 2019
    The test deliberately constructs an invalid pointer, so don't check it.
    
    Fixes #35379
    
    Change-Id: Ifeff3484740786b0470de3a4d2d4103d91e06f5d
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205717
    Reviewed-by: Matthew Dempsky <mdempsky@google.com>
  2. runtime: don't hold scheduler lock when calling timeSleepUntil

    ianlancetaylor committed Nov 6, 2019
    Otherwise, we can get into a deadlock: sysmon takes the scheduler lock
    and calls timeSleepUntil which takes each P's timer lock. Simultaneously,
    some P calls runtimer (holding the P's own timer lock) which wakes up
    the scavenger, calling goready, calling wakep, calling startm, getting
    the scheduler lock. Now the sysmon thread is holding the scheduler lock
    and trying to get a P's timer lock, while some other thread running on
    that P is holding the P's timer lock and trying to get the scheduler lock.
    
    So change sysmon to call timeSleepUntil without holding the scheduler
    lock, and change timeSleepUntil to use allpLock, which is only held for
    limited periods of time and should never compete with timer locks.
    
    This hopefully
    
    Fixes #35375
    
    At least it should fix the linux-arm64-packet builder problems,
    which occurred more reliably as that system has GOMAXPROCS == 96,
    giving a lot more scope for this deadlock.
    
    Change-Id: I7a7917daf7a4882e0b27ca416e4f6300cfaaa774
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205558
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Cherry Zhang <cherryyz@google.com>
    Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commits on Nov 5, 2019
  1. runtime/cgo: add -Wno-nullability-completeness on Darwin

    ianlancetaylor committed Nov 5, 2019
    Fixes #35247
    
    Change-Id: I4f2e243c89e9f745b82bcd181add87fad1443171
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205457
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
  2. runtime: keep adjusted timers in timerMoving status until moved

    ianlancetaylor committed Nov 5, 2019
    Before this CL adjustTimers left timers being moved in an inconsistent
    state: status timerWaiting but not on a P. Simplify the code by
    leaving the timers in timerMoving status until they are actually moved.
    Other functions (deltimer, modtimer) will wait until the move is complete
    before changing anything on the timer. This does leave timers in timerMoving
    state for longer, but still not all that long.
    
    Fixes #35367
    
    Change-Id: I31851002fb4053bd6914139125b4c82a68bf6fb2
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205418
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Michael Knyszek <mknyszek@google.com>
  3. runtime: disable preemption during test calls to futexsleep

    ianlancetaylor committed Nov 5, 2019
    Fixes #35347
    
    Change-Id: If7380f29e97a5abe86cdd5e2853323de7997ccfc
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205378
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Cherry Zhang <cherryyz@google.com>
  4. cmd/compile: update TestFormats for CL 196959

    ianlancetaylor committed Nov 5, 2019
    CL 196959 uses %v to print *EscLocation values. This happens at least at
        Fatalf("path inconsistency: %v != %v", edge.src, src)
    in (*Escape).explainPath.
    
    Change-Id: I1c761406af6a1025403dfefa5ec40aee75e72944
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205377
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
  5. runtime/pprof: update example comment to check error on Close

    ianlancetaylor committed Oct 19, 2019
    Programs should always check the error return of Close for a file opened
    for writing. Update the example code in the comment to mention this.
    
    Change-Id: I2ff6866ff1fe23b47c54268ac8e182210cc876c5
    Reviewed-on: https://go-review.googlesource.com/c/go/+/202137
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  6. runtime: don't return from netpollGenericInit until init is complete

    ianlancetaylor committed Nov 1, 2019
    As a side-effect ensure that netpollinited only reports true when
    netpoll initialization is complete.
    
    Fixes #35282
    Updates #35353
    
    Change-Id: I21f08a04fcf229e0de5e6b5ad89c990426ae9b89
    Reviewed-on: https://go-review.googlesource.com/c/go/+/204937
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Commits on Nov 4, 2019
  1. runtime: wake netpoller when dropping P, don't sleep too long in sysmon

    ianlancetaylor committed Nov 1, 2019
    When dropping a P, if it has any timers, and if some thread is
    sleeping in the netpoller, wake the netpoller to run the P's timers.
    This mitigates races between the netpoller deciding how long to sleep
    and a new timer being added.
    
    In sysmon, if all P's are idle, check the timers to decide how long to sleep.
    This avoids oversleeping if no thread is using the netpoller.
    This can happen in particular if some threads use runtime.LockOSThread,
    as those threads do not block in the netpoller.
    
    Also, print the number of timers per P for GODEBUG=scheddetail=1.
    
    Before this CL, TestLockedDeadlock2 would fail about 1% of the time.
    With this CL, I ran it 150,000 times with no failures.
    
    Updates #6239
    Updates #27707
    Fixes #35274
    Fixes #35288
    
    Change-Id: I7e5193e6c885e567f0b1ee023664aa3e2902fcd1
    Reviewed-on: https://go-review.googlesource.com/c/go/+/204800
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Michael Knyszek <mknyszek@google.com>
  2. misc/cgo/testcarchive: add missing exit(0) in main7.c

    ianlancetaylor committed Nov 3, 2019
    Fixes #35327
    
    Change-Id: I3726bfad24851a0bef8891014f7c5a7c48352307
    Reviewed-on: https://go-review.googlesource.com/c/go/+/205077
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Commits on Nov 2, 2019
  1. runtime: clear preemptStop in dropm

    ianlancetaylor committed Nov 2, 2019
    Updates #10958
    Updates #24543
    Fixes #35294
    
    Change-Id: I60f024d08451565df6d9751dab9832b50cbf637a
    Reviewed-on: https://go-review.googlesource.com/c/go/+/204957
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Cherry Zhang <cherryyz@google.com>
Older
You can’t perform that action at this time.