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

Illegal instruction / runtime-promise #77

Closed
tamdrea opened this issue Oct 18, 2017 · 2 comments
Closed

Illegal instruction / runtime-promise #77

tamdrea opened this issue Oct 18, 2017 · 2 comments
Labels

Comments

@tamdrea
Copy link

tamdrea commented Oct 18, 2017

If you change the Fibonacci example to:

// Run fibonacci evaluation in sequence.
run(20)

Sometime you receive:

Fatal error in ../deps/v8/src/runtime/runtime-promise.cc, line 59
Check failed: args[0]->IsJSPromise().
Illegal instruction

Sometimes a segmentation fault:

  Nth     Fibonacci       # of workers    latency in MS
    -----------------------------------------------------------

run n: 20
Segmentation fault

This happen running with debian 9.2

@helloshuangzi
Copy link
Contributor

Tamdrea, this example is used to demo how napajs support recursive execution, which will involve a lots of stack operation. I've tested it with a even larger input in my client, it worked well. I was wondering whether it is because of some configuration in your environment (memory limit? any VM used?), something like mentioned in this article https://kb.iu.edu/d/aqsj

Checking shell limits
As noted in the last example above, some segfault problems are not due to bugs in your program, but are caused instead by system memory limits being set too low. Usually it is the limit on stack size that causes this kind of problem. To check memory limits, use the ulimit command in bash or ksh, or the limit command in csh or tcsh. Try setting the stacksize higher, and then re-run your program to see if the segfault goes away.

@helloshuangzi
Copy link
Contributor

@tamdrea With a naive implementation of this example, it will run into segment fault due to super large memory consumption when you evaluate a larger fibonacci number. It's limited by the hardware condition.
At this same time, for a reasonable small input, we just figure out the exmaple works well by node <= v8.4.0 on linux, and it will fail with random callstacks by node >=v8.5.0 . We are working on it, and let's track it by #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants