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

More graceful stack overflow handling #81

Merged
merged 4 commits into from
Jul 18, 2018
Merged

Conversation

kleinj
Copy link
Member

@kleinj kleinj commented Jun 7, 2018

As pointed out in #77, if a stack overflow occurs in one of the computations threads (e.g., SCC analysis in a "deep" model, very heavily nested formulas/expressions, ...), the GUI does not notice that the computation thread is gone as the error handling there only catches Exceptions and not Errors. Errors are generally serious and should not be caught, but for a StackOverflowError we can gracefully recover by just ending the computation thread, the same as for other exceptions.

This PR addresses:

  • Making the stack size configurable (via -javastack x command-line parameter)
  • Gracefully handling stack overflows in the GUI (logging short stack trace to the log, short message with hint about -javastack in the pop-up) and command-line (short stack trace in the log & hint).
  • If the stack overflow arises in the GUI during a model checking computation, it is recorded as the error in the result object, like other errors.

Have not tested on Linux / Windows yet, but don't expect trouble...

For the GUI, I think I covered the most likely situations (steady-state computation, verification, experiments) in testing. The test case for #77 is good for triggering the overflow in the explicit engine, either for steady-state computation or using a S=?[ ... ] property.

Similar to -javamaxmem, make stack size configurable, either via
-javastack argument or by setting the PRISM_JAVASTACKSIZE environment
variable
If we catch a StackOverflowError, we now print a (limited) stack trace
and additionally provide a hint regarding the use of the -javastack
argument.
@davexparker davexparker merged commit 530c981 into master Jul 18, 2018
@davexparker davexparker deleted the stack-overflow-handling branch July 18, 2018 15:54
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

Successfully merging this pull request may close these issues.

None yet

2 participants