-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Description
- Version: v6.9.1
- Platform: Darwin watson-3.local 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64
- Subsystem:
If using clearTimeout
to clear an unreffed Timeout
object returned by setInterval(...).unref()
you'll get a segfault the next time the interval would normally have fired.
The following example program will segfault after 4 seconds:
// keep the event loop busy while we wait for segfault
setTimeout(function () {}, 100000)
console.log('setInterval')
var timer = setInterval(clear, 2000).unref()
function clear () {
console.log('clear - start')
// Use clearTimeout instead of clearInterval
clearTimeout(timer)
console.log('clear - end')
}
The segfault doesn't happen if the Timeout
object isn't unreffed.
Even though the user should just use clearInterval
instead, this at least shouldn't segfault.
sveisvei
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.