-
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
Impossibile to build Undertow based native image due to unsafe.staticFieldBase() on static volatile int fails with UnsupportedFeatureError #3020
Comments
sorry my mistake, the issue persists with 21.0.0 as well! |
Firstly thanks so much for serialization support in 21.0.0 @ziyilin I'm also seeing this issues problem with the jboss river code below. It's doing some heavy reflection. I'd be happy to experiment with
btw @ujibang I found this interesting read http://java-performance.info/updating-final-and-static-final-fields/ |
I think on SerializableClass is easier. You can substitute |
Thanks. I've started with this ... to avoid the problem. And it seems to progress.
Uses static initializers (cinit) to do this Where unsafe is a com.sun.misc.Unsafe static field in So maybe @ujibang this will need more thought and advice. Btw I also notice ... which make me think there is some hope :) Maybe @baranowb from Redhat can comment? :)
|
Ps @ziyilin I'm guessing serialization-config.json looks like ... but I haven't seen one anywhere?
|
Native-image-agent monitors |
Ok - that's clever. Thank you. |
Yes! you can disable the XNIO from using the Jboss ThreadExecutor
However EnhancedQueueExecutor is using unsafe in its static initializer. So we have to find a way to delete/replace that or alias unsafe field
|
Ok basically just removed these calls. See PR below
|
f97bdb5 adds the missing substitutions. |
Describe the issue
the native image of a project that uses undertow, fails at runtime with following error:
The problem comes from
EnhancedQueueExecutor
class of jboss-threads that usesSteps to reproduce the issue
Please include both build steps as well as run steps
git clone --depth 1 https://github.com/SoftInstigate/graalvm-undertow-issue.git
cd graalvm-undertow-issue
mvn clean package -Pnative
./target/graalvm-undertow-issue-native
Describe GraalVM and your environment:
More details
native-image succeeds. the error is at runtime with reported exception.
Workaroud
Downgrading xnio library to version 3.5.9.Final removes transitive dependency to joss-threads:2.3.0.Beta2 that introduces failing
EnhancedQueueExecutor
classThe text was updated successfully, but these errors were encountered: