[jdk20] Integrated: 8294744: AArch64: applications/kitchensink/Kitchensink.java crashed: assert(oopDesc::is_oop(obj)) failed: not an oop

Patricio Chilano Mateo pchilanomate at openjdk.org
Tue Jan 10 17:20:00 UTC 2023


On Thu, 5 Jan 2023 20:24:25 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

This pull request has now been integrated.

Changeset: 151450ea
Author:    Patricio Chilano Mateo <pchilanomate at openjdk.org>
URL:       https://git.openjdk.org/jdk20/commit/151450ea9b78243130eb89a1c8ea9ad7ac13fb4a
Stats:     10 lines in 2 files changed: 7 ins; 0 del; 3 mod

8294744: AArch64: applications/kitchensink/Kitchensink.java crashed: assert(oopDesc::is_oop(obj)) failed: not an oop

Co-authored-by: Fei Yang <fyang at openjdk.org>
Reviewed-by: aph, fyang, dcubed

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

PR: https://git.openjdk.org/jdk20/pull/85


More information about the hotspot-dev mailing list