-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segfault if clearTimeout(interval) #9561
Comments
I did a quick bisect to see if it's a regression. I didn't find a culprit but it seems to go back to July at least. EDIT: Worth noting that the crash seems to be caused by a |
Are you sure about that? The unsigned integer should be the property name, which it appears to be? |
Ok, I think |
Not enough care was given in the recent interval refactor and several related bugs also exist. The following do not work correctly inside an Interval callback:
Edit: Some of these may have existed before the refactor, so it is probably not entirely to blame. |
@Fishrock123 can you link to the PR of the interval refactor please |
@thealphanerd sorry, was short on time earlier. |
This is in part due to the fault of clarity in the timers codebase that |
Hmmm, actually fixing this correctly is proving a bit of a challenge, there are some odd cases with |
Still on this, will try to fix tomorrow or next week. |
Previously not all codepaths set `timer._idleTimeout = -1` for canceled or closed timers, and not all codepaths checked it either. Unenroll uses this to say that a timer is indeed closed and it is the closest thing there is to an authoritative source for this. Refs: nodejs#9606 Fixes: nodejs#9561 PR-URL: nodejs#9685 Reviewed-By: Rich Trott <rtrott@gmail.com>
Previously not all codepaths set `timer._idleTimeout = -1` for canceled or closed timers, and not all codepaths checked it either. Unenroll uses this to say that a timer is indeed closed and it is the closest thing there is to an authoritative source for this. Refs: #9606 Fixes: #9561 PR-URL: #9685 Reviewed-By: Rich Trott <rtrott@gmail.com>
If it can help, also crashes on Node 4.4.2 with a more verbose message : |
Previously not all codepaths set `timer._idleTimeout = -1` for canceled or closed timers, and not all codepaths checked it either. Unenroll uses this to say that a timer is indeed closed and it is the closest thing there is to an authoritative source for this. Refs: nodejs#9606 Fixes: nodejs#9561 PR-URL: nodejs#9685 Reviewed-By: Rich Trott <rtrott@gmail.com> Conflicts: lib/timers.js
Previously not all codepaths set `timer._idleTimeout = -1` for canceled or closed timers, and not all codepaths checked it either. Unenroll uses this to say that a timer is indeed closed and it is the closest thing there is to an authoritative source for this. Refs: #9606 Fixes: #9561 PR-URL: #9685 Reviewed-By: Rich Trott <rtrott@gmail.com> Conflicts: lib/timers.js
Previously not all codepaths set `timer._idleTimeout = -1` for canceled or closed timers, and not all codepaths checked it either. Unenroll uses this to say that a timer is indeed closed and it is the closest thing there is to an authoritative source for this. Refs: #9606 Fixes: #9561 PR-URL: #9685 Reviewed-By: Rich Trott <rtrott@gmail.com>
Previously not all codepaths set `timer._idleTimeout = -1` for canceled or closed timers, and not all codepaths checked it either. Unenroll uses this to say that a timer is indeed closed and it is the closest thing there is to an authoritative source for this. Refs: #9606 Fixes: #9561 PR-URL: #9685 Reviewed-By: Rich Trott <rtrott@gmail.com>
Previously not all codepaths set `timer._idleTimeout = -1` for canceled or closed timers, and not all codepaths checked it either. Unenroll uses this to say that a timer is indeed closed and it is the closest thing there is to an authoritative source for this. Refs: #9606 Fixes: #9561 PR-URL: #9685 Reviewed-By: Rich Trott <rtrott@gmail.com> Conflicts: lib/timers.js
If using
clearTimeout
to clear an unreffedTimeout
object returned bysetInterval(...).unref()
you'll get a segfault the next time the interval would normally have fired.The following example program will segfault after 4 seconds:
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.The text was updated successfully, but these errors were encountered: