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

Pause failing on long-running programms. #495

Open
LeifAndersen opened this issue Jul 30, 2021 · 4 comments
Open

Pause failing on long-running programms. #495

LeifAndersen opened this issue Jul 30, 2021 · 4 comments

Comments

@LeifAndersen
Copy link
Member

I would expect the following program to run for roughly 3 seconds, then print out Pausing..., followed shortly by PAUSED!. But instead it prints out Pausing..., but never actually pauses:

const prog = `
for(let i = 0; i < 100000000000; i++) {
  if(i%10000000 === 0) {
    console.log(i);
  }
}
`;

window.stopify = require('@stopify/stopify');
let runner = stopify.stopifyLocally(prog);
runner.g = {console};
runner.run(() => {
    console.log("DONE!");
});
setTimeout(() => {
    console.log("Pausing...");
    runner.pauseImmediate(() => {console.log("PAUSED");});
}, 3000);

If it helps, the following error seems to occur:

lazyRuntime.ts:15 Uncaught Capture {stack: Array(0), f: ƒ}
@LeifAndersen
Copy link
Member Author

Also if it helps, I created a sample repo with the problem: https://github.com/LeifAndersen/stoptest

@LeifAndersen
Copy link
Member Author

I should note this only happens with pauseImediate, and not pause specifically.

@arjunguha
Copy link
Member

Well, definitely a bug. Can you look into it? It is unlikely that I can get to it until September.

@LeifAndersen
Copy link
Member Author

Sure, I'll take a look into it. I suspect its probably related to the call stack being empty.

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