On Thu, 3 Dec 2026 19:00:40 GMT, Chris Plummer <[email protected]> wrote:
> If I understand correctly, you are not actually fixing this test failure, but
> are trying to provide better diagnostics when it does fail. In that case you
> should create a new CR (probably a subtask) and keep JDK-8398883 open.
>
> Also, can you provide example log output if the test fails with your fix in
> place?
@plummercj Hi , thanks for the review. You are right — this change does not fix
the
underlying decode failure in JDK-8398883. It only makes NMethod.toString() and
getName() null-safe, so that the original exception is no longer masked by the
NPE thrown from toString() inside the test's catch block.
I completely agree this should be tracked separately and that JDK-8398883
should remain open. Unfortunately, I don't have permission to create a new
issue in JBS (my account does not have the required role). Could you, or
another reviewer/committer with JBS access, please create a new CR for this
diagnostic improvement — preferably as a subtask of JDK-8398883? I'm happy to
draft the title and description to make that easy:
Title: Make NMethod.toString()/getName() null-safe to improve diagnostics
Description: When getMethod() returns null (e.g. a free/stale nmethod in the
code heap), NMethod.toString()/getName() throw an NPE. In
TestDebugInfoDecode.visit(), the catch block logs "..." + blob, which calls
blob.toString() and throws an NPE, masking the real decode exception. This
change makes those methods null-safe so the genuine failure is visible.
This is a diagnostic improvement only; JDK-8398883 remains open for the
actual fix.
Once the CR exists, I will amend the commit message and force-push so this PR
solves the new issue instead of JDK-8398883.
With the fix in place, the failing test now reports:
Exception while decoding debug info for NMethod for
sun.jvm.hotspot.code.NMethod@0x00000007b9c2f120
<real exception>: <message>
at ...
The NPE from NMethod.toString() is gone and the genuine decode exception is
now visible.
Please let me know how you would like me to proceed. Thanks!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/34189#issuecomment-7399639918