RFR: 8339488: Extended NPE message doesn't handle CONSTANT_Dynamic [v2]

Oli Gillespie ogillespie at openjdk.org
Fri Sep 6 15:02:25 UTC 2024


> 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

Oli Gillespie has updated the pull request incrementally with one additional commit since the last revision:

  Remove unused import

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20889/files
  - new: https://git.openjdk.org/jdk/pull/20889/files/1cf82008..9382a708

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20889&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20889&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/20889.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20889/head:pull/20889

PR: https://git.openjdk.org/jdk/pull/20889


More information about the hotspot-runtime-dev mailing list