// This will detect most SA failures, including during the attach.
output.shouldNotMatch("sun.jvm.hotspot.debugger.DebuggerException:.*$");
// This will detect unexpected exceptions, like NPEs and asserts, that are caught
// by sun.jvm.hotspot.CommandProcessor.
output.shouldNotMatch("^Error: .*$");
In addition I fixed some places in SA that generate the "Error" message, but don't always ensure that it starts on a new line, which it frequently does not:
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java
@@ -62,7 +62,7 @@
}
}
} catch (Exception e) {
- System.out.println("Error occurred during stack walking:");
+ System.err.println("\nError: exception occurred during stack walking:");
e.printStackTrace();
}
}
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/StackTrace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/StackTrace.java
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/StackTrace.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/StackTrace.java
@@ -114,7 +114,7 @@
vf.printLockInfo(tty, count++);
}
} catch (Exception e) {
- tty.println("Error occurred during stack walking:");
+ tty.println("\nError: Exception occurred during stack walking:");
e.printStackTrace();
}
tty.println();
With these changes in place, I started to see a lot more failures being detected by the test. One is
- duplicates
-
JDK-8278558 sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java failed with "exitValue = 134"
- Closed
- relates to
-
JDK-8248675 [aarch64] serviceability/sa/TestJhsdbJstackMixed.java fails with "Exception: sun.jvm.hotspot.debugger.UnmappedAddressException: e0a646adbd850"
- Open
-
JDK-8274421 HeapDumpTestWithActiveProcess.java times out or fails with "Expected to get exit value of [0]"
- Open
-
JDK-8247533 SA stack walking sometimes fails with sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
- Resolved
-
JDK-8244383 jhsdb/HeapDumpTestWithActiveProcess.java fails with "AssertionFailure: illegal bci"
- Resolved