-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
cannot build a vertx native image with 19.3.0 #1902
Comments
Hi @pmlopes! We had a similar issue in Quarkus, maybe you'll find something useful in quarkusio/quarkus#5353. |
@gwenneg thanks for the tip. As you noted it's a workaround for the new limitations, we (vertx) would prefer not to had those to our codebase and just run with what Graal offers. IMHO I thing if the issue affects vertx and Quarkus it probably affects others too and maybe should be addressed upstream. |
It is technically possible to allow What is the address in your case? One option would be to implement a check whether a "reasonable" address is stored in the heap. |
The issue seems to come from the My issue isn't the inet addresses per se but the fact that I cannot delay that class to be initialized at runtime at all. If you look further at the class, it really shows it should be because it caches not only the localhost values (probably harmless) but also all the inet devices and that is not good to keep in the heap as my laptop on the docking station and running docker has a ton of virtual devices ;-) |
Have you tried with |
Yes, but no matter what the configuration is it always gets initialized at compile time. I think I wrote a note on it before. |
OK, the problem comes from the fact that the class initialization tracking agent is not working for the JDK classes. I will address this separately ASAP. In the meanwhile, this is the magic sauce: |
It works if I add these which is great. I'm getting these warnings. Not sure if they are important.
|
@sstubbs that is a warning from netty when the code that is supposed to parse the system dns config fails. It could be related as that code is usually called on a static constructor i think. |
I see ok thanks. It seems to be running so I will continue to test it and see what happens. |
can you share how you managed to do that? i'm using 19.3.0 on MacOS , even after adding these i'm still getting :
|
I put breakpoints in |
You mean by debugging the native image generation when it's running as a server and using --debug-attach ? |
yes, doesn't have to run as a server. |
I've tried once more to build my vertx app with native-image, but this time I used the version 20.0.0 and using the properties that @vjovanov have suggested. But still no luck.
|
@jkremser, may I ask you to give us any statement about this issue? |
I'm also running into this with GraalVM Native 20.1.0 and vertx 9.3.1 (latest release so far). I already have the magic sauce mentioned by @vjovanov in my configuration but the error persists. If you have ideas about how to work around it, please let me know and I'll be happy to give them a try. |
+1 Same problem here... Graal Version:
Vert.x Version: 3.8.4 |
We are reworking class initialization tracking to work in 100% of the cases (CC @gradinac). However, here I believe the simplest solution would be not to initiaIize all of netty at build time. Then, all should work out of the box. |
+1 |
Hello everyone! We've changed the way @cvgaviao Could you see if this can help you resolve your issue? Let me know if you hit any issues |
Hi there! I've run the image build for a basic Vert.x (3.9.1) app using GraalVM CE 20.3.0-dev-20200912_0211 (graalvm-ce-java11-linux-amd64-dev) with
So, I then added Went back to the 20.2.0 version with the same settings, and it works without a snag! |
@t3rmian Thank you for verifying this! :) |
With 19.2.0.1 (and earlier releases) it was possible to build vertx native images without the need for substitutions. With 19.3.0 this isn't possible anymore.
The root cause seems to be related to
DNS
related code whereInet?Address
objects are allocated in the heap.After tracking down where these allocations came from I managed to point to the classes:
Adding these classes to the
initialize at runtime
parameter will not work because:Is always initialized at compile time, regardless of what the configuration I use.
A full reproducer can be found here:
https://github.com/vertx-howtos/graal-native-image-howto/tree/issues/graal-19-3/steps/step-9
I'm out of ideas on how to solve this.
The text was updated successfully, but these errors were encountered: