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
Nodejs: web server sample stuck in a epoll_wait loop #512
Comments
try running with |
Thanks for getting back. I tried running with strace and got this error:
Fetching prlimit64 for RLIMIT_STACK is throwing an error. Any ideas about what to do next? |
The crash looks like a bug in the abort signal (sig=6) handling. @mikbras is looking into it. The specific parameter NodeJs runtime queried using SYS_prlimit64 is not supported by the Mystikos implementation yet. With the latest Node package (changing the Docker file to use "FROM node:alpine"), the SYS_prlimit64 query is not treated by NodeJs runtime as a fatal error, and I can see the STRACE progress further, but failed differently. |
Thanks for looking into this. I have raised a PR to fix SYS_prlimit64 for RLIMIT_STACK. After making this change I have run into another issue. Here is the STRACE around the failure -
At this point mmap with fixed address is failing and the application hangs. |
The bug in Abort Signal handling flow was fixed by PR #530 |
The SYS_mmap() error is due to current Mystikos mmap() implementation limitation. It does not support requesting specific address. With the modified mmap() implementation and several other changes, in my fork, the sample test can move forward further, but eventually failed with NodeJS traceback: tty.js:87
throw new ERR_TTY_INIT_FAILED(ctx);
^
SystemError [ERR_TTY_INIT_FAILED]: TTY initialization failed: uv_tty_init returned ENOTSUP (operation not supported on socket)
at new WriteStream (tty.js:87:11)
at createWritableStdioStream (internal/process/stdio.js:164:16)
at process.getStdout [as stdout] (internal/process/stdio.js:33:14)
at Console.get (internal/console/constructor.js:153:38)
at Console.(anonymous function) (internal/console/constructor.js:276:46)
at Console.log (internal/console/constructor.js:287:61)
at Object.<anonymous> (/app/app.js:1:9)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32) |
I tried running Nodejs 11 with your modified mmap implementation and it still shows a failure (segmentation fault). I then tried running it with Nodejs 9 instead. In this case the program is hanging. This is happening because poll() is failing for /dev/random. I made the following fix and the server is now able to start and process requests:
If this looks fine I can add it to the existing RLIMIT PR #526. |
@rads-1996 , I think it's better to have a separate PR for /dev/random poll support. BTW, the segment fault you encountered is due to the unsupported statx syscall triggering |
No worries, I will try the fix wih Nodejs 11 again. I will submit a separate PR for /dev/random poll support as you suggested. |
mmap fix to support mapping request with a preferred address is merged - PR #545 |
@rads-1996 , can you review the suggested changes in PR #526? |
@bodzhang I have updated the PR based on your suggestion. Kindly review. |
PR #526 merged |
Thanks! I have opened PR #586 for the /dev/random poll issue. |
@rads-1996 , The epoll_wait loop issue was addressed by PR #615, and your PR #586 was also merged. Can you add a nodejs_webserver regression test under /solutions? You might want to take a look at /samples/pytorch/Makefile for a reliable mechanism to wait for the webserver to initialize. |
Thank you for the issue resolution. I will submit a PR along with the test case. |
Hello,
I am trying to build a confidential app using Nodejs and Mystikos. I am not able to run even a simple Nodejs app.
This is my Nodejs file:
and this is my Dockerfile:
These are the instructions I am using to run it with Mystikos:
I see this error message:
Segmentation fault (core dumped)
Would appreciate any pointers on how to debug this further.
The text was updated successfully, but these errors were encountered: