@@ -749,6 +749,12 @@ protected SketchException findException(String message, ObjectReference or, Thre
749749 // This shouldn't happen, but if it does, print the exception in case
750750 // it's something that needs to be debugged separately.
751751 e .printStackTrace (sketchErr );
752+ } catch (Exception e ) {
753+ // stack overflows seem to trip in frame.location() above
754+ // ignore this case so that the actual error gets reported to the user
755+ if ("StackOverflowError" .equals (message ) == false ) {
756+ e .printStackTrace (sketchErr );
757+ }
752758 }
753759 // before giving up, try to extract from the throwable object itself
754760 // since sometimes exceptions are re-thrown from a different context
@@ -780,7 +786,11 @@ protected SketchException findException(String message, ObjectReference or, Thre
780786 or .invokeMethod (thread , method , new ArrayList <Value >(), ObjectReference .INVOKE_SINGLE_THREADED );
781787
782788 } catch (Exception e ) {
783- e .printStackTrace (sketchErr );
789+ // stack overflows will make the exception handling above trip again
790+ // ignore this case so that the actual error gets reported to the user
791+ if ("StackOverflowError" .equals (message ) == false ) {
792+ e .printStackTrace (sketchErr );
793+ }
784794 }
785795 // Give up, nothing found inside the pile of stack frames
786796 SketchException rex = new SketchException (message );
0 commit comments