-
Notifications
You must be signed in to change notification settings - Fork 224
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
Situation where Fiber.current does not return the current fiber #177
Comments
BTW I've got the above behaviour on:
|
Would something like this fix it?
|
@laverdet that's more or less exactly what I'm doing in |
Was tearing out my remaining strands of hair over the Christmas break trying to figure out why our scripts faced so many different crashes, aborts, and exceptions. The slightest timing change caused a different but highly repeatable error. The undefined behaviors exhibited on Raspberry Pi over the latest Arch Linux updates but not on Windows 8.1. Went as far as getting node.js v0.11 to compile and run on ARM v6 and mentally prepared myself to use GDB on node and fibers. While looking through every comment available on the planet about this issue, I perused at the most recent Fibers commits. What was this recent change list from 3 days ago? I upgraded to Fibers 1.0.4 with low expectations. The scripts kept running for thousands of iterations rather than the usual 1 to 35 iterations before crapping out. These strange errors disappeared. Not one, but all. Thanks to both of you I may live another day without touching gdb. |
Here is a repro to demonstrate this issue.
To run this, make a copy of the
'node_modules/fibers'
directory at'node_modules/fibers2'
.It may look contrived, but it's a simple model of a situation where the
fibers
module appears more than once in a module dependency graph and isn't (or can't be) deduped.Since a node process has one current execution context, I would have thought that all instances of the
fibers
module loaded into the process should return the same value ofFiber.current
at a particular point in time. i.e.,Fiber2.current
in the repro above is erroneous to returnundefined
, because the current execution context is in a fiber when the call is made.EDIT: simplified description.
The text was updated successfully, but these errors were encountered: