[jdk21u-dev] RFR: 8310228: Improve error reporting for uncaught native exceptions on Windows

Rigner duke at openjdk.org
Sat Apr 20 14:59:33 UTC 2024


On Fri, 19 Apr 2024 10:08:17 GMT, Goetz Lindenmaier <goetz at openjdk.org> wrote:

> A bugfix useful for windows.

Hey, sorry if it's not the right place for this, but I felt like I could add some more information to this bug.

I've been having this issue locally when trying to migrate some native code to Java 21+. I can even reproduce it on Java 22 / 23 when native code is throwing an `Access Violation (C0000005)`.

Did we have confirmation that the issue was properly fixed for all cases with that commit ?

Here's my WinDbg output on Java 23 (same for 21/22):

ModLoad: 00007ff8`5fcf0000 00007ff8`5fd5a000   C:\Windows\system32\mswsock.dll
ModLoad: 00007ff8`5f9b0000 00007ff8`5f9eb000   C:\Windows\SYSTEM32\iphlpapi.dll
ModLoad: 00007ff8`5ff50000 00007ff8`5ff68000   C:\Windows\SYSTEM32\CRYPTSP.dll
ModLoad: 00007ff8`5f5d0000 00007ff8`5f604000   C:\Windows\system32\rsaenh.dll
ModLoad: 00007ff8`309c0000 00007ff8`309de000   C:\Program Files\Java\jdk-23\bin\java.dll
ModLoad: 00007ff8`61980000 00007ff8`61aab000   C:\Windows\System32\ole32.dll
ModLoad: 00007ff8`61d70000 00007ff8`620c3000   C:\Windows\System32\combase.dll
(f61c.10030): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
000001f4`0d33094e 8b06            mov     eax,dword ptr [rsi] ds:00000000`00000000=????????
0:004> g
ModLoad: 00007ff8`5e630000 00007ff8`5edce000   C:\Windows\SYSTEM32\windows.storage.dll
ModLoad: 00007ff8`5ff10000 00007ff8`5ff3e000   C:\Windows\SYSTEM32\Wldp.dll
ModLoad: 00007ff8`610c0000 00007ff8`6118d000   C:\Windows\System32\OLEAUT32.dll
ModLoad: 00007ff8`61510000 00007ff8`615bd000   C:\Windows\System32\SHCORE.dll
ModLoad: 00007ff8`625e0000 00007ff8`62635000   C:\Windows\System32\shlwapi.dll
ModLoad: 00007ff8`604f0000 00007ff8`60515000   C:\Windows\SYSTEM32\profapi.dll
ModLoad: 00007fff`f4350000 00007fff`f4427000   C:\Program Files\Java\jdk-23\bin\jsvml.dll
(f61c.10030): Stack overflow - code c00000fd (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
jvm!verify+0x89e57:
00007fff`845598b7 e8b4b30d00      call    jvm!AsyncGetCallTrace+0xcf5e0 (00007fff`84634c70)


That native code is working fine for Java 8 / 17 btw.

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

PR Comment: https://git.openjdk.org/jdk21u-dev/pull/510#issuecomment-2067697968


More information about the jdk-updates-dev mailing list