[jdk20] RFR: 8294744: applications/kitchensink/Kitchensink.java crashed: assert(oopDesc::is_oop(obj)) failed: not an oop
Patricio Chilano Mateo
pchilanomate at openjdk.org
Thu Jan 5 20:56:37 UTC 2023
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
-------------
Commit messages:
- v1
Changes: https://git.openjdk.org/jdk20/pull/85/files
Webrev: https://webrevs.openjdk.org/?repo=jdk20&pr=85&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8294744
Stats: 5 lines in 1 file changed: 3 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk20/pull/85.diff
Fetch: git fetch https://git.openjdk.org/jdk20 pull/85/head:pull/85
PR: https://git.openjdk.org/jdk20/pull/85
More information about the hotspot-dev
mailing list