RFR: JDK-8296906: VMError::controlled_crash crashes with wrong code and address

Thomas Stuefe stuefe at openjdk.org
Mon Nov 14 06:44:23 UTC 2022


On Mon, 14 Nov 2022 02:49:01 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Did we not notice or was that exactly what was expected? When JDK-8065895 added that code it was known to generate SEGV _because_ it was outside the allowable range (otherwise there would have been no guarantee). Maybe the SI_KERNEL behaviour has changed since then? It doesn't seem an issue to change it to a low address (other than that doesn't work on AIX) but it seems odd to now consider it a bug - seems more like you now consider it too limited because the true address is not given in the sig info?

My intent is to have a regression test that clearly shows the expected crash address and si_code in the hs-err file. Especially since we now have more developers changing error reporting. Regression tests give you the safety to try new approaches without having to manually check for problems.

> test/hotspot/jtreg/runtime/ErrorHandling/HsErrFileUtils.java line 15:
> 
>> 13: 
>> 14:         // extract hs-err file
>> 15:         String hs_err_file = output.firstMatch("# *(\\S*hs_err_pid\\d+\\.log)", 1);
> 
> I'm not sure this is going to be useful in the way you are trying to use it. This will show the original path to the hs_err file at the time it is created. But jtreg can move things around in the final test result output and place the hs_err file somewhere else.

We use this pattern in a number of places, e.g. in BadNativeStackInErrorHandlingTest and SafeFetchInErrorHandlingTest.java. Seems to work ok so far.

> test/hotspot/jtreg/runtime/ErrorHandling/TestSigInfoInHsErrFile.java line 130:
> 
>> 128:       patterns.add(Pattern.compile("siginfo: si_signo: \\d+ \\(SIGSEGV\\), si_code: \\d+ \\(SEGV_MAPERR\\), si_addr: 0x0*400"));
>> 129:     } else {
>> 130:       patterns.add(Pattern.compile("siginfo: si_signo: \\d+ \\(SIGSEGV\\).*"));
> 
> Why not use the AIX 5K address here?

Oversight. I have no way to test AIX anymore since we handed porting over to IBM.

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

PR: https://git.openjdk.org/jdk/pull/11122


More information about the hotspot-dev mailing list