You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
msridhar
changed the title
robustness to process.exit for node programs
Add parameter to endExecution() to indicate a sudden failure
May 18, 2015
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
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.
If a node program calls
process.exit()
, the underlying process exits immediately, without cleaning up the call stack, etc. Indirect.js
, we add anexit
listener that at least ensures thatendExecution()
is invoked even ifprocess.exit
is called. But, this does not take care of all issues for the analysis client, as, e.g., it may be written expecting allfunctionEnter
callbacks to have a correspondingfunctionExit
callback. I can't think of anything we can really do here. We could monkey-patchprocess.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 theprocess.exit
ugliness from analyses.The text was updated successfully, but these errors were encountered: