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 load JavaScript file over 130KB #5

Open
piglovesyou opened this issue Feb 25, 2017 · 6 comments
Open

Cannot load JavaScript file over 130KB #5

piglovesyou opened this issue Feb 25, 2017 · 6 comments

Comments

@piglovesyou
Copy link

make tests finishes without error. But when I put meaningless lines in test/js/variables.js to make its size larger, the test was failed with the following log.

[pig@localhost erlang_v8]$ ls -lh test/js/variables.js; make tests
-rw-r--r-- 1 pig pig 130K Feb 25 11:32 test/js/variables.js
make[1]: Entering directory '/home/pig/git/erlang_v8/deps/jsx'
make[1]: Leaving directory '/home/pig/git/erlang_v8/deps/jsx'
make[1]: Entering directory '/home/pig/git/erlang_v8/deps/ct_helper'
make[1]: Leaving directory '/home/pig/git/erlang_v8/deps/ct_helper'
 GEN    test-dir
make -C /home/pig/git/erlang_v8/c_src
make[1]: Entering directory '/home/pig/git/erlang_v8/c_src'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/pig/git/erlang_v8/c_src'
 GEN    ct


Common Test v1.13 starting (cwd is /home/pig/git/erlang_v8)



CWD set to: "/home/pig/git/erlang_v8/logs/ct_run.ct_erlang_v8@localhost.2017-02-25_11.35.48"

TEST INFO: 1 test(s), 14 case(s) in 1 suite(s)

Testing git.erlang_v8.port_SUITE: Starting test, 14 test cases

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
port_SUITE:init_from_file failed on line 220
Reason: {badmatch,{error,vm_unresponsive}}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Testing git.erlang_v8.port_SUITE: *** FAILED test case 9 of 14 ***
Testing git.erlang_v8.port_SUITE: TEST COMPLETE, 13 ok, 1 failed of 14 test cases

Updating /home/pig/git/erlang_v8/logs/index.html ... done
Updating /home/pig/git/erlang_v8/logs/all_runs.html ... done

make: *** [erlang.mk:6145: ct] Error 1

Is there any way to control the limitation?

@strange
Copy link
Owner

strange commented Mar 1, 2017

Looks like the port process is still processing data when the request to create a context arrives. Can you please attach your variables.js?

Thank you.

@piglovesyou
Copy link
Author

@strange
Copy link
Owner

strange commented Mar 2, 2017

Thank you!

@strange
Copy link
Owner

strange commented Mar 2, 2017

Ok, the limit is 128kb as defined by MAX_ARG_STRLEN in binfmts.h. It's not a bug in erlang_v8 but rather a limitation in the kernel. It's not feasible to work around that limit.

The quick-fix is to generate an error for files larger than 128kb (you can, however, add multiple 128kb files until you reach another limit). Something that would solve this is to just send paths to the C-process and read the files from there. I've been considering this for different reasons for a while.

Can you work around this in the meantime (split file into several smaller files)?

@piglovesyou
Copy link
Author

piglovesyou commented Mar 4, 2017

@strange Thank you for your support. Because I compile JavaScript from Node modules, it's hard to determine size of each scripts. I'd wanted to try React.js server side rendering in Phoenix app with erlang_v8, but I think I need to consider how to do that again.

Or if we could pass a file path instead of its content to V8 process and let it read, perhaps.. not sure.

@strange
Copy link
Owner

strange commented Mar 4, 2017 via email

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

No branches or pull requests

2 participants