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

Add parameter to endExecution() to indicate a sudden exit #45

Open
msridhar opened this issue May 15, 2015 · 1 comment
Open

Add parameter to endExecution() to indicate a sudden exit #45

msridhar opened this issue May 15, 2015 · 1 comment
Assignees

Comments

@msridhar
Copy link
Contributor

If a node program calls process.exit(), the underlying process exits immediately, without cleaning up the call stack, etc. In direct.js, we add an exit listener that at least ensures that endExecution() is invoked even if process.exit is called. But, this does not take care of all issues for the analysis client, as, e.g., it may be written expecting all functionEnter callbacks to have a corresponding functionExit callback. I can't think of anything we can really do here. We could monkey-patch process.exit to just throw some exception, but that can be caught by the application code. Just logging an issue in case there's an idea for how to hide the process.exit ugliness from analyses.

@msridhar msridhar changed the title robustness to process.exit for node programs Add parameter to endExecution() to indicate a sudden failure May 18, 2015
@msridhar msridhar changed the title Add parameter to endExecution() to indicate a sudden failure Add parameter to endExecution() to indicate a sudden exit May 18, 2015
@msridhar
Copy link
Contributor Author

After discussion with @ksen007, we decided that to handle this case, we should add another parameter to the endExecution callback indicating when the program has exited suddenly, e.g., due to process.exit. When this parameter is set, the analysis can then know that invariants may be violated (e.g., function enters may not be matched by function exits), and can handle the situation accordingly.

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