[jdk20] RFR: 8294744: AArch64: applications/kitchensink/Kitchensink.java crashed: assert(oopDesc::is_oop(obj)) failed: not an oop [v3]
Daniel D. Daugherty
dcubed at openjdk.org
Tue Jan 10 15:34:57 UTC 2023
On Mon, 9 Jan 2023 16:02:49 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
>> Please review the following patch. The value we set initially for extended_sp on natives frames doesn't account for the oop that could be pushed to the stack in case the method throws an exception. This can create a situation in Interpreter::_throw_exception_entry where we push an exception oop to the Java expression stack below the actual physical stack pointer. When JFR is present though a JavaThread could receive a suspend signal right after that push. On Linux aarch64, because there is no red zone defined (nor implemented it seems), the pushed oop gets overwritten during the setup and execution of the signal handler. This later leads to a crash when popping the oop back and rethrowing in the caller of the native method. There are more details in the bug comments.
>>
>> To fix it I used the same technique we use for normal Java frames, i.e. add extra space to extended_sp when creating the frame to account for the max space needed.
>>
>>
>>
>> I tested the patch by running Kitchensink.java around 150 times on mach5 with no failures (without the patch 50 runs would already show ~10 failures on average). I also run tiers1-6 for sanity check.
>>
>> Thanks,
>> Patricio
>
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>
> add fix for riscv
Thumbs up. Wonderful analysis in the bug report. You may want to attach
your standalone reproducers to the bug report for future spelunkers.
Thanks for including the testing information.
src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp line 841:
> 839: } else {
> 840: // Make sure there is room for the exception oop pushed in case method throws
> 841: // an exception (see TemplateInterpreterGenerator::generate_throw_exception())
I was going to request that you add a '.' to the end of this sentence,
but it seems that lack of punctuation is the prevalent style in this file.
-------------
Marked as reviewed by dcubed (Reviewer).
PR: https://git.openjdk.org/jdk20/pull/85
More information about the hotspot-dev
mailing list