Closed Eng-Fouad closed 2 months ago
hs_err_pid39660.log:
I tried the same app on Ubuntu and it works just fine, so this issue relates to Windows only I believe.
Workaround for this issue on Windows:
quarkus.console.enabled=false
It looks like this native method fails to execute:
org.fusesource.jansi.internal.CLibrary.init();
@gnodet @stalep is there anything that can be done about this?
hi @geoand, this looks like a jansi issue on jdk22. I think it would be better to reach out to the jansi project. Afaik @gnodet has worked on jansi so he could possibly be able to help.
🙏🏼
Also, just as an fyi, jansi should never be loaded on a non-windows OS. It's only used to convert ansi to windows specific terminal codes and back.
This line:
Class.forName(CLibrary.class.getName()); // calling static block which calls the private native method CLibrary.init()
works fine if we run quarkus in prod mode:
java -jar .\build\quarkus-app\quarkus-run.jar
However, it crashes when running in dev mode:
.\gradlew quarkusDev
@Eng-Fouad Is this reproducible with the Adoptium release as well?
Could you try that out and if it's still reproducible try to reproduce again with a debugimage so that we can get more info out of the traces?
If this is only happening on the Oracle release then you should probably open an issue with them as well.
@Eng-Fouad Is this reproducible with the Adoptium release as well?
Yes, it is reproducible with Adoptium release:
build.gradle.kts:
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(22))
vendor = JvmVendorSpec.ADOPTIUM
//vendor = JvmVendorSpec.ORACLE
}
}
Output:
> Task :quarkusDev
Listening for transport dt_socket at address: 5005
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff9d0049c68, pid=37380, tid=19968
#
# JRE version: OpenJDK Runtime Environment Temurin-22+36 (22.0+36) (build 22+36)
# Java VM: OpenJDK 64-Bit Server VM Temurin-22+36 (22+36, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V [jvm.dll+0x459c68]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\fouad\IdeaProjects\quarkus-3.9.0.RC2-with-JDK22\hs_err_pid37380.log
[0.939s][warning][os] Loading hsdis library failed
#
# If you would like to submit a bug report, please visit:
# https://github.com/adoptium/adoptium-support/issues
#
Could you try that out and if it's still reproducible try to reproduce again with a debugimage so that we can get more info out of the traces?
How to reproduce with a debugimage?
Hi @Eng-Fouad
How to reproduce with a debugimage?
You'll need to download the debug symbols that correspond to the build you are using (for Temurin 22+36, you can get them here) and then unzip the corresponding symbols (.pdb
files) into \bin
and \bin\server
in your JDK folder.
This way you should see method names instead of just offsets (i.e. "[jvm.dll+0x459c68]") in the native frames reported in the hs_err.
@fthevenet @zakkak
Output:
> Task :quarkusDev FAILED
Listening for transport dt_socket at address: 5005
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff9db689c68, pid=1424, tid=42416
#
# JRE version: OpenJDK Runtime Environment Temurin-22+36 (22.0+36) (build 22+36)
# Java VM: OpenJDK 64-Bit Server VM Temurin-22+36 (22+36, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V [jvm.dll+0x459c68] jni_SetStaticIntField+0xd8
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\fouad\IdeaProjects\quarkus-3.9.0.RC2-with-JDK22\hs_err_pid1424.log
[1.186s][warning][os] Loading hsdis library failed
#
# If you would like to submit a bug report, please visit:
# https://github.com/adoptium/adoptium-support/issues
#
hs_err_pid1424.log:
Edit: @zakkak wrapped the log in <details><\details>
since it was too long.
FWIW, the problematic frames looks very much like those reported in this issue reported with jansi: https://github.com/fusesource/jansi-native/issues/17, although it involves both a different JVM and different OS.
EDIT: Also maybe this one: https://github.com/fusesource/jansi/issues/66 ?
I think I found the cause for this issue. According to this page:
In JDK 22, System.console() has been changed to return a Console with enhanced editing features that improve the experience of programs that use the Console API. In addition, System.console() now returns a Console object when the standard streams are redirected or connected to a virtual terminal. Prior to JDK 22, System.console() instead returned null for these cases. This change may impact code that checks the return from System.console() to test if the JVM is connected to a terminal. If required, the -Djdk.console=java.base flag will restore the old behavior where the console is only returned when it is connected to a terminal. Starting JDK 22, one could also use the new Console.isTerminal() method to test if the console is connected to a terminal.
I can confirm that setting -Djdk.console=java.base
prevents the JVM crash:
tasks.quarkusDev {
doFirst {
System.setProperty("jdk.console", "java.base")
}
}
Maybe modifying this condition:
to :
if (console != null && console.isTerminal())
would resolve this issue.
However, isTerminal()
is a new method in JDK22. Alternatively, access the private static method istty()
via reflection.
cc @geoand @gsmet
Interesting information!
I don't much of anything about terminals, so maybe @stuartwdouglas can weigh in here.
As I mentioned in another reply is that the jansi library will only be called on windows. Ideally this will be fixed in jansi, but adding this check should also work.
On Thu, Mar 28, 2024, 16:59 Georgios Andrianakis @.***> wrote:
Interesting information!
I don't much of anything about terminals, so maybe @stuartwdouglas https://github.com/stuartwdouglas can weigh in here.
— Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/39575#issuecomment-2025565239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAME5BMGTM2YXZM2KNSHX3Y2QV45AVCNFSM6AAAAABE6ROKDSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRVGU3DKMRTHE . You are receiving this because you were mentioned.Message ID: @.***>
🙏🏼
@stalep Submitted a PR to aesh-readline. Hopefully it will fix this issue.
It seems the fix won't be included in the release 3.11 as well :)
Describe the bug
Simple Quarkus app crashes on Windows using JDK22:
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
Reproducer: https://github.com/Eng-Fouad/quarkus-3.9.0.RC2-with-JDK22
Output of
uname -a
orver
Windows 11
Output of
java -version
22
Quarkus version or git rev
3.9.0.CR2
Build tool (ie. output of
mvnw --version
orgradlew --version
)gradle-8.7-rc-3
Additional information
No response