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

while(true) still blocks execution when using NodeVM #6

Closed
paulrutter opened this issue Mar 18, 2015 · 2 comments
Closed

while(true) still blocks execution when using NodeVM #6

paulrutter opened this issue Mar 18, 2015 · 2 comments

Comments

@paulrutter
Copy link

When using NodeVM in combination with vm.call(methodname, params), a "while(true)" statement still blocks execution. Am i doing something wrong or is this a bug?

My code:

    // sandbox properties
    var options = {
      console: 'inherit',
      sandbox: {
        "var1": var1,
        "var2": var2
      },
      require: true,
      requireExternal: false,
      requireNative: [],
      timeout: 100 // see my other issue, since this is not working
    };
    var vm = new NodeVM(options);
    var script= vm.run("module.exports = { onLoad: function(){ while(true);}}");

    vm.call(script.onLoad); // this blocks execution
@astanciu
Copy link

Same issue... Timeout doesn't appear to be working with while(true)

@patriksimek
Copy link
Owner

Unfortunately NodeVM can't be run with timeout so while can block the process. This is a limitation of a Node.js itself and there is nothing I can do about it.

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

3 participants