RFR: JDK-8296906: VMError::controlled_crash crashes with wrong code and address
Thomas Stuefe
stuefe at openjdk.org
Thu Nov 17 07:09:21 UTC 2022
On Mon, 14 Nov 2022 02:49:01 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> We have VMError::controlled_crash() in debug builds, whose job is to trigger clearly defined faults to test VM error reporting. VMError::controlled_crash(14) (the numbers don't mean anything and probably should be replaced with clear enums) is to crash with a SIGSEGV + SEGV_MAPERR mapping error at a well-known crash address. But this does not work on Linux, where it generates a SIGSEGV with SI_KERNEL instead. We never noticed since it had not been used in tests so far.
>>
>> The reason for SI_KERNEL was that the crash address we use (0xABC0000000000ABC) was outside the user-space address range on Linux. This patch redefines the crash address to a value that really generates a SIGSEGV + SEGV_MAPERR on all our platforms. That's one line; the rest is a new regression test that checks that signal info is printed correctly in hs-err files.
>
> 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?
Thanks @dholmes-ora, @turbanoff and @MBaesken !
I fixed the last remark from David and will integrate now.
-------------
PR: https://git.openjdk.org/jdk/pull/11122
More information about the hotspot-dev
mailing list