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

JDK-8296907: VMError: add optional callstacks, siginfo for secondary errors #11118

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 6 additions & 38 deletions test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java
Original file line number Diff line number Diff line change
@@ -106,57 +106,25 @@ public static void main(String[] args) throws Exception {
// which is an end marker written in the last step and proves that hs-err file was
// completely written.

<<<<<<< HEAD
ArrayList<Pattern> patternlist = new ArrayList<>();
patternlist.add(Pattern.compile("Will crash now \\(TestCrashInErrorHandler=14\\)..."));
patternlist.add(Pattern.compile("\\[error occurred during error reporting \\(test secondary crash 1\\).*\\]"));
if (with_callstacks) {
patternlist.add(Pattern.compile("\\[siginfo: si_signo: 11 \\(SIGSEGV\\).*\\]"));
patternlist.add(Pattern.compile("\\[stack: Native frames:.*"));
patternlist.add(Pattern.compile(".*VMError::controlled_crash.*"));
patternlist.add(Pattern.compile("\\[siginfo:.*\\(SIGSEGV\\).*\\]"));
patternlist.add(Pattern.compile("\\[stack: Native frames:.*"));
patternlist.add(Pattern.compile(".*VMError::controlled_crash.*"));
}
// and again, to see that repeated error reporting steps work
patternlist.add(Pattern.compile("Will crash now \\(TestCrashInErrorHandler=14\\)..."));
patternlist.add(Pattern.compile("\\[error occurred during error reporting \\(test secondary crash 2\\).*\\]"));
if (with_callstacks) {
patternlist.add(Pattern.compile("\\[siginfo: si_signo: 11 \\(SIGSEGV\\).*\\]"));
patternlist.add(Pattern.compile("\\[stack: Native frames:.*"));
patternlist.add(Pattern.compile(".*VMError::controlled_crash.*"));
patternlist.add(Pattern.compile("\\[siginfo:.*\\(SIGSEGV\\).*\\]"));
patternlist.add(Pattern.compile("\\[stack: Native frames:.*"));
patternlist.add(Pattern.compile(".*VMError::controlled_crash.*"));
}
Pattern[] pattern = patternlist.toArray(new Pattern[] {});
int currentPattern = 0;

String lastLine = null;
while ((line = br.readLine()) != null) {
if (currentPattern < pattern.length) {
if (pattern[currentPattern].matcher(line).matches()) {
System.out.println("Found: " + line + ".");
currentPattern ++;
}
}
lastLine = line;
}
br.close();

if (currentPattern < pattern.length) {
throw new RuntimeException("hs-err file incomplete (first missing pattern: " + pattern[currentPattern] + ")");
}

if (!lastLine.equals("END.")) {
throw new RuntimeException("hs-err file incomplete (missing END marker.)");
} else {
System.out.println("End marker found.");
}
=======
Pattern [] pattern = new Pattern[] {
Pattern.compile("Will crash now \\(TestCrashInErrorHandler=14\\)..."),
Pattern.compile("\\[error occurred during error reporting \\(test secondary crash 1\\).*\\]"),
Pattern.compile("Will crash now \\(TestCrashInErrorHandler=14\\)..."),
Pattern.compile("\\[error occurred during error reporting \\(test secondary crash 2\\).*\\]"),
};

HsErrFileUtils.checkHsErrFileContent(hs_err_file, pattern, false);
>>>>>>> master

System.out.println("OK.");