Skip to content
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

Cannot calculate 1,000,000th Fibonacci number #3

Closed
tarcieri opened this issue Oct 3, 2011 · 5 comments
Closed

Cannot calculate 1,000,000th Fibonacci number #3

tarcieri opened this issue Oct 3, 2011 · 5 comments

Comments

@tarcieri
Copy link

@tarcieri tarcieri commented Oct 3, 2011

This crashes node-fib:

$ time curl localhost:3000/1000000
curl: (52) Empty reply from server

real    1m0.392s
user 0m0.006s
sys 0m0.004s

It appears it ran out of memory:

$ node app.js 
FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory
@rbranson

This comment has been minimized.

Copy link

@rbranson rbranson commented Oct 3, 2011

Looks to be a potential DoS vector.

@glenjamin

This comment has been minimized.

Copy link
Owner

@glenjamin glenjamin commented Oct 3, 2011

I shall alert those intending to use this in production that there may be a security issue :)

@glenjamin

This comment has been minimized.

Copy link
Owner

@glenjamin glenjamin commented Oct 4, 2011

While the new algorithm does support n=1000000, JavaScript's native number type does not.

@glenjamin glenjamin closed this Oct 4, 2011
@Incognito

This comment has been minimized.

Copy link

@Incognito Incognito commented Oct 4, 2011

Woah woah woah, why are you closing this? Just use bignum. http://jsfromhell.com/classes/bignumber

@glenjamin glenjamin reopened this Oct 4, 2011
@glenjamin

This comment has been minimized.

Copy link
Owner

@glenjamin glenjamin commented Oct 4, 2011

I've already spent far more time on this than I intended, pull requests for bignum support are welcome.

Had a cursory glance over that bignum library, it looks horrible!

@glenjamin glenjamin closed this Jan 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.