RFR: JDK-8326496: [test] checkHsErrFileContent support printing hserr in error case [v3]

Christoph Langer clanger at openjdk.org
Wed Feb 28 06:43:43 UTC 2024


On Fri, 23 Feb 2024 12:37:06 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> checkHsErrFileContent checks hs error files for existance and non-existance of some user provided patterns. However it should also have an option to print the hs_err file in case of a failing check, this would make error analysis easier.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   adjust doc of verbose param

Hi David,

we sometimes see error output like this:

[2024-02-09T01:23:06.112705412Z] Gathering output for process 47059
Will crash now (TestCrashInErrorHandler=14)...
^^^ Matches Will crash now \(TestCrashInErrorHandler=14\)... at line 2^^^
[error occurred during error reporting (test secondary crash 1), id 0xb, SIGSEGV (0xb) at pc=0x000074d8362e1664]
^^^ Matches \[error occurred during error reporting \(test secondary crash 1\).*\] at line 4^^^
[siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000400]
^^^ Matches \[siginfo:.*\(SIGSEGV\).*\] at line 5^^^
[stack: Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
^^^ Matches \[stack: Native frames:.* at line 6^^^
V  [libjvm.so+0x1d01664]  VMError::controlled_crash(int)+0x194
^^^ Matches .*VMError::controlled_crash.* at line 7^^^
Will crash now (TestCrashInErrorHandler=14)...
^^^ Matches Will crash now \(TestCrashInErrorHandler=14\)... at line 9^^^
[error occurred during error reporting (test secondary crash 2), id 0xb, SIGSEGV (0xb) at pc=0x000074d8362e1664]
^^^ Matches \[error occurred during error reporting \(test secondary crash 2\).*\] at line 11^^^
----------System.err:(12/723)*----------
java.lang.RuntimeException: hs-err file incomplete (first missing pattern: \[siginfo:.*\(SIGSEGV\).*\])
	at HsErrFileUtils.checkHsErrFileContent(HsErrFileUtils.java:135)
	at HsErrFileUtils.checkHsErrFileContent(HsErrFileUtils.java:71)
	at SecondaryErrorTest.main(SecondaryErrorTest.java:125)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1570)

So in that case (pattern missing) I'd really like to have the full hs_err file to see what happened.

But I agree that for things like Forbidden pattern found, as you mentioned above, one would not need to print the whole hs_err file. Maybe the change could be checked/modified to only print the hs_err content if something is missing?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17978#issuecomment-1968330357


More information about the hotspot-runtime-dev mailing list