-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Timers broken in 0.10.34 #8897
Comments
BTW, don't guys test your software before releasing it to public? |
do you have a minimal code to produce this exception? |
@micnic Good question. I am currently at work, but will try to help you with that later this day. |
Thanks @apendua for reporting the issue, I'm investigating. Please let us know when you find the code that reproduces it. |
@misterdjules Currently working on this one. |
Just wanted to add that I started seeing this one in production as well on upgrade to 0.10.34; haven't yet been able to find a simple reproduction but will keep looking. |
The following code demonstrates the same error for me:
Output:
|
And under 0.10.33, this same code appears to work fine:
|
As a side note, with the new list traversal, the following lines at timers.js:457 look like they might be a problem if they ever triggered:
It doesn't look to me like |
The source of the bug appears to be that when you call itemToDelete._onTimeout(), any node in the list can be mutated, so holding open a list iteration and continuing it after this call is unsafe. With the current list implementation, it seems like to be safe, you would need to do something like scan the full list, and build a local list of all of the items that look like they're ready to fire, and only then iterate over that list and call each item's This issue appears to have been introduced in 934bfe2. |
@ploer Thanks for the minimal reproduction. Yes, the block of code that early-outs in the loop seems problematic, we may need to open a separate issue for that. |
I'm working on a fix, I'll keep you posted. Thank you again! |
I appreciate you taking the time to report this issue, but blatantly snide remarks like this aren't welcome. If you'd taken the time to look at the commit where this code was changed (934bfe2) you'd see there was one additional test added. Not including all the other additional timers tests that are already there. |
@trevnorris I totally agree with you. I am sorry guys, didn't mean to insult you! I should have waited until emotions go away before submitting this issue report. I really appreciate how fast you responded. |
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes nodejs#8897.
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes nodejs#8897.
@misterdjules, thanks for the quick fix! Reading through the change, I am wondering if there is still a slight change from the behavior in 0.10.33. In 0.10.33, I believe that if timer event With this change, it appears to me that if I have no idea if this difference matters, it seems likely to be a rare edge case where the only impact is that a timeout callback fires unnecessarily, and I would expect any reasonable caller to tolerate that. But I thought I'd point it out for your consideration. |
@ploer Indeed, that seems like a very good observation, thank you again! I'm working on fixing that too. |
@misterdjules, looks good to me. |
@apendua No worries. And again thanks for taking the time to report the issue. :) |
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes nodejs#8897.
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes nodejs#8897.
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes nodejs#8897.
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes nodejs#8897. Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Thank you all, fixed in fd2cb7c. |
@misterdjules Thanks. I'll need to make sure this gets into #8886 . |
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes nodejs#8897. Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes nodejs#8897. Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes: nodejs/node-v0.x-archive#8897 PR-URL: nodejs/node-v0.x-archive#8905 Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Conflicts: lib/timers.js
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes: nodejs/node-v0.x-archive#8897 Conflicts: lib/timers.js Fixes: nodejs/node-convergence-archive#23 Ref: #268 PR-URL: #2540 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes: nodejs/node-v0.x-archive#8897 Conflicts: lib/timers.js Fixes: nodejs/node-convergence-archive#23 Ref: #268 PR-URL: #2540 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Commit 934bfe2 had introduced a regression where node would crash trying to access a null unref timer if a given unref timer's callback would remove other unref timers set to fire in the future. More generally, it makes the unrefTimeout function more solid by not mutating the unrefList while traversing it. Fixes: nodejs/node-v0.x-archive#8897 Conflicts: lib/timers.js Fixes: nodejs/node-convergence-archive#23 Ref: nodejs#268 PR-URL: nodejs#2540 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
After updating to 0.10.34 my app keeps throwing this error:
well, I looked into your source code here:
https://github.com/joyent/node/blob/v0.10.34-release/lib/timers.js#L430
and it seems that something is going wrong there, right?
Well I think you forgot to make
unrefList
aTimer
object here:https://github.com/joyent/node/blob/v0.10.34-release/lib/timers.js#L508
it's just a guess based on the fact that
_idlePrev
is only initialized in theTimer
constructor.The text was updated successfully, but these errors were encountered: