Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NioSocketImpl was requested to be initialized at run time #45966

Closed
Postremus opened this issue Jan 30, 2025 · 3 comments
Closed

NioSocketImpl was requested to be initialized at run time #45966

Postremus opened this issue Jan 30, 2025 · 3 comments
Labels
area/native-image kind/bug Something isn't working

Comments

@Postremus
Copy link
Member

Postremus commented Jan 30, 2025

Describe the bug

just found that the upgrade PRs to 3.18.0 / 3.18.1 failed to build in one of my projects.
Native. mandrel-java17-23.0.6.0-Final

Expected behavior

should build like in 3.17

Actual behavior

Error: Classes that should be initialized at run time got initialized during image building:

 sun.nio.ch.NioSocketImpl the class was requested to be initialized at run time (from feature io.quarkus.runner.Feature.beforeAnalysis with 'NioSocketImpl.class'). To see why sun.nio.ch.NioSocketImpl got initialized use --trace-class-initialization=sun.nio.ch.NioSocketImpl
------------------------------------------------------------------------------------------------------------------------
To see how the classes got initialized, use --trace-class-initialization=sun.nio.ch.NioSocketImpl
com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
 sun.nio.ch.NioSocketImpl the class was requested to be initialized at run time (from feature io.quarkus.runner.Feature.beforeAnalysis with 'NioSocketImpl.class'). To see why sun.nio.ch.NioSocketImpl got initialized use --trace-class-initialization=sun.nio.ch.NioSocketImpl
                        4.9s (8.3% of total time) in 58 GCs | Peak RSS: 2.13GB | CPU load: 3.78
To see how the classes got initialized, use --trace-class-initialization=sun.nio.ch.NioSocketImpl
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:73)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ProvenSafeClassInitializationSupport.checkDelayedInitialization(ProvenSafeClassInitializationSupport.java:277)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.duringAnalysis(ClassInitializationFeature.java:164)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:770)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:89)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$11(NativeImageGenerator.java:770)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.AbstractAnalysisEngine.runAnalysis(AbstractAnalysisEngine.java:179)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:767)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:582)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:539)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:408)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:612)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:134)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)

How to Reproduce?

pro-crafting/jsonpretty#121

Build using mvn -B install -Pnative

Output of uname -a or ver

ubuntu-latest

Output of java -version

/opt/hostedtoolcache/mandrel-java17-linux/23.0.6-0-Final/x64/mandrel-java17-23.0.6.0-Final/bin/java --version openjdk 17.0.13 2024-10-15 OpenJDK Runtime Environment Temurin-17.0.13+11 (build 17.0.13+11) OpenJDK 64-Bit Server VM Temurin-17.0.13+11 (build 17.0.13+11, mixed mode, sharing)

Quarkus version or git rev

3.18.0, 3.18.1

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Copy link

quarkus-bot bot commented Jan 30, 2025

/cc @Karm (native-image), @galderz (native-image), @zakkak (native-image)

@geoand
Copy link
Contributor

geoand commented Jan 30, 2025

Interestingly enough I was not able to reproduce the problem

@zakkak
Copy link
Contributor

zakkak commented Jan 30, 2025

@geoand what Mandrel version are you using?

@Postremus this is a known issue caused by a23633a in #45448 and is fixed by ec2b9ba in #45611 which will ship with 3.19.

Note however that Mandrel 23.0.6-Final is no longer supported. You should be using Mandrel 23.1.x instead. I am closing this as not planned.

@zakkak zakkak closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants