RFR: 8339488: Extended NPE message doesn't handle CONSTANT_Dynamic
Leonid Mesnik
lmesnik at openjdk.org
Fri Sep 6 14:46:08 UTC 2024
On Fri, 6 Sep 2024 11:22:50 GMT, Oli Gillespie <ogillespie at openjdk.org> wrote:
> Extended NPE messages require walking the bytecode in the method where it was created, and simulating the effect on the stack. `ldc` for dynamic constants is not handled, which can lead to assertion failures in debug builds, or incorrect NPE messages in release builds (possibly worse with the right conditions?).
>
> Simply handle dynamic constants by figuring out their return type so we know how they will affect the stack.
>
> The new test fails without the fix in both release and debug builds. In release, it fails because the NPE message is wrong: `Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.notify()" because "`, and in debug builds it hits this assert:
>
>
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # Internal Error (<redacted>/src/hotspot/share/interpreter/bytecodeUtils.cpp:660), pid=12677, tid=12678
> # assert(false) failed: Unexpected tag
Changes requested by lmesnik (Reviewer).
test/hotspot/jtreg/runtime/condy/CondyExtendedNullPointerTest.java line 28:
> 26: * @bug 8339488
> 27: * @summary Test extended NullPointerException message in method with CONSTANT_Dynamic.
> 28: * @requires vm.flagless
Is there are any reasons to ignore all additional vm flags? Usually the test should accept any flags and be flagless only if there are known reasons for this. Even if it doesn't looks to be useful to run in different modes. Usually to stress comiplers with different bycodes.
You don't need to run test in an additional configurations.
test/hotspot/jtreg/runtime/condy/CondyExtendedNullPointerTest.java line 37:
> 35: import jdk.test.lib.process.ProcessTools;
> 36: import jdk.test.lib.process.OutputAnalyzer;
> 37: import jdk.test.lib.compiler.InMemoryJavaCompiler;
Seems InMemoryJavaCompiler is not used anymore.
-------------
PR Review: https://git.openjdk.org/jdk/pull/20889#pullrequestreview-2286434222
PR Review Comment: https://git.openjdk.org/jdk/pull/20889#discussion_r1747238336
PR Review Comment: https://git.openjdk.org/jdk/pull/20889#discussion_r1747224218
More information about the hotspot-runtime-dev
mailing list