-
Notifications
You must be signed in to change notification settings - Fork 396
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
TypeError: object is not a function #403
Comments
Yes, this looks like the same issue as #345. |
Hey @anodynos, can you paste the generated javascript perchance? |
Wow, I really appreciate your putting together a test for this! Could you put the generated JS in a gist? |
lol, jinx @unscriptable :) |
You're welcome @briancavalier, glad to help. Note: you don't need 30 iterations of |
Thanks for gisting the JS :) I got the test running locally and, sure enough, it errors in exactly the same spot:
o.O
Yeah, it's a bit unnerving to know the possibility of "randomly invalid compiler output" exists. But I also sympathize ... getting an optimizing compiler right in all cases is probably pretty challenging. |
Update: The magic number of the completely irrelevant parse invocations is |
I understand that, but I can't rationalize is why it fails at the n-th iteration, and not the n-1. Surely the (erroneous) compilation takes place only once, not at every loop. I think this needs to be escalated to the nodejs/V8 guys... |
The
seems to work well with this code, although I'm sure I had problems even with that on last night. |
@anodynos Ok, yeah, if you can try to verify that, it will help because I'm about to file a v8 bug :) See: https://github.com/briancavalier/when-v8-invalid-optimization |
I'm not sure either, but it may have to do with v8 detecting hot paths after some number of executions. For example, iteration 393 may mean that |
Well, with an earlier configuration of that code (and a bit more complex, with classes and binding contexts) I was consistently getting it at 192 :-/ Regarding Its so arbitrary, its scary... The V8 needs to hammer this... |
Bug report filed: https://code.google.com/p/v8/issues/detail?id=3692 Star it up :) |
+1 starred |
If I change Promise.prototype._beget = function() {
return begetFrom(this._handler, this.constructor);
};
function begetFrom(parent, Promise) {
var child = new Pending(parent.receiver, parent.join().context);
return new Promise(Handler, child);
} It's running on my machine right now, and passed 3500 iterations. Can you try that same change and let me know? UPDATE: Yep, it successfully completed 7000 iterations (using the magic number 7, as above) and exited. |
Maybe we need to leave it running a whole night ? |
It certainly can't hurt :) I can do that tonight. This comment on the bug report has me a little worried. It seems to indicate that there is no support for any version of v8 in any currently released version of node. That makes it sound as if there simply is no recourse for any bug found in v8 that might affect an in-production system. I must be misreading it ... Perhaps the node team supports those versions? |
It's evident that the nodejs people should get the bug report - if might certainly affect many production systems out there... |
I reproduced the error @ 393 (on Kubuntu 14x64, using magic numba 15) with: Especially with
and it stops. With @3.3 the test wont run at all:
and it stops - didn't bother to see why. This is such a deal breaker, it breaks my urequire code that was about to be released :-( |
Cool, thanks @briancavalier for your immediate response and remarkable commitment :-) |
Awesome :) Yep, it's looking good. |
I got to ~130K iterations on Windows 7x64 & Kubuntu with 3.6.2 |
woot. I just killed my overnight run at ~160k. I think it's time for a release :) |
@anodynos Thanks for your above-and-beyond help on this! Without it, I'm sure we would have been battling this issue for much, much longer. |
Thanks @briancavalier, I'm very glad I helped and we got to nail it :-) Lets make sure we escalate the nasty V8 bug to the nodejs team & community, cause no one knows where it'll hit next. People might loose their sleep & counteless hours cause of this, blaming themselves or their team or some other product etc.... |
@anodynos Yep, I agree. It's on my todo list for today to file the issue with the node team. The larger issue of the apparent rift between node and v8 is also concerning. I'm not really sure what can be done there. I believe v8 API changes are at least one reason node is still using much older versions of v8. In contrast, Chrome has kept up. Maybe there is a node/v8 cultural divide as well. I know some work is being done to help isolate node from v8 APIs, which hopefully will help going forward (node 0.12?). |
* fake module description * return promise when returning early * update when@3.6.2 to non breaking V8 optimization bug cujojs/when#403
* replace 'is_file_in' with 'umatch' * automatic `bundle.main` if there's only one module
@anodynos Took me a little longer than I hoped, but I just filed a bug with node as well: nodejs/node-v0.x-archive#8730 |
Nice @briancavalier - its good news its fixed in 0.11.x... |
Starting with 3.6.0, but possibly even before that, there is a
TypeError: object is not a function
error thrown at seemingly random situations, as also discussed in #345.The following coffee code manages to reproduce it: it fails with
when@3.6.0
running on node v0.10.33/coffeescript 1.8, on both Ubuntu 14x64 & Windows 7x64 after exactly 393 overall iterations :-/The error is very strangely random-y: although this code fails predictably (at overall iteration noted as
registering catch # 393
), almost any change affects the error and might not even throw at all or throw longer after - even aconsole.log
change, or the useless loops and promises formation etc might affect the outcome...I highly sympathize whoever is going to debug this unpredictable ghost busting monster ;-(
The last lines of the outcome are
The text was updated successfully, but these errors were encountered: