RFR: 8377395: serviceability/sa/TestJhsdbJstackMixedCore.java fails due to NPE because "because "this.cfa" is null"

Evgeny Astigeevich eastigeevich at openjdk.org
Tue Feb 24 16:09:58 UTC 2026


On Wed, 11 Feb 2026 12:02:20 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

>> We've introduced new test TestJhsdbJstackMixedCore.java in [JDK-8374482](https://bugs.openjdk.org/browse/JDK-8374482) to check mixed jstack could unwind signal trampoline on Linux AMD64. However it did not work with following error in some case. We saw it on Oracle Linux 8.10 intermittently.
>> 
>> 
>> java.lang.NullPointerException: Cannot invoke "sun.jvm.hotspot.debugger.Address.addOffsetTo(long)" because "this.cfa" is null
>> at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.amd64.LinuxAMD64CFrame.getNextRSP(LinuxAMD64CFrame.java:143)
>> at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.amd64.LinuxAMD64CFrame.sender(LinuxAMD64CFrame.java:189)
>> at jdk.hotspot.agent/sun.jvm.hotspot.tools.PStack.run(PStack.java:195)
>> at jdk.hotspot.agent/sun.jvm.hotspot.tools.PStack.run(PStack.java:65)
>> at jdk.hotspot.agent/sun.jvm.hotspot.tools.PStack.run(PStack.java:60)
>> at jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack.run(JStack.java:67)
>> at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:278)
>> at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:241)
>> at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:134)
>> at jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack.runWithArgs(JStack.java:90)
>> at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJSTACK(SALauncher.java:306)
>> at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507)
>> 
>> 
>> It was caused by incorrect calculation for virtual address alignment. It exists before JDK-8374482. We aligned `base address + virtual address` in ELF, but it should be aligned virtual address only.
>> 
>> This fix works fine with the coredump which we saw the error in above, and also it passed CI on Oracle Linux 8.10.
>> 
>> Thanks a lot @plummercj for your help!
>
> Thanks both!

@YaSuenag 
My fastdebug build has this issue on Amazon Linux 2:

 stderr: [java.lang.NullPointerException: Cannot invoke "sun.jvm.hotspot.debugger.Address.addOffsetTo(long)" because "this.cfa" is null
        at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.amd64.LinuxAMD64CFrame.getNextRSP(LinuxAMD64CFrame.java:143)
        at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.amd64.LinuxAMD64CFrame.sender(LinuxAMD64CFrame.java:189)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.PStack.run(PStack.java:195)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.PStack.run(PStack.java:65)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.PStack.run(PStack.java:60)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack.run(JStack.java:67)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:278)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:241)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:134)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack.runWithArgs(JStack.java:90)
        at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJSTACK(SALauncher.java:306)
        at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507)
]
 exitValue = 0

java.lang.RuntimeException: 'Java_jdk_test_lib_apps_LingeredApp_crash' missing from stdout/stderr
        at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:253)
        at TestJhsdbJstackMixedCore.runJstackMixed(TestJhsdbJstackMixedCore.java:68)
        at TestJhsdbJstackMixedCore.main(TestJhsdbJstackMixedCore.java:94)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
        at java.base/java.lang.Thread.run(Thread.java:1527)

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

PR Comment: https://git.openjdk.org/jdk/pull/29662#issuecomment-3953164069


More information about the serviceability-dev mailing list