jamesnetherton opened a new issue, #8344:
URL: https://github.com/apache/camel-quarkus/issues/8344
### Bug description
Seen this native build failure a few times in different tests. Seems to be
triggered from `Charset` but i am not sure from exactly where.
```
Fatal error:
com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: An object of
type 'java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread'
was found in the image heap. This type, however, is marked for initialization
at image run time for the following reason: classes are initialized at run time
by default.
This is not allowed for correctness reasons: All objects that are stored in
the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type
'java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread' are
persisted in the image heap, add
'--initialize-at-build-time=java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread'
to the native-image arguments. Note that initializing new types can store
additional objects to the heap. It is advised to check the static fields of
'java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread' to
see if they are safe for build-time initialization, and that they do not
contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread'
to find classes that instantiate these objects. Once you found such a class,
you can mark it explicitly for run time initialization with
'--initialize-at-run-time=<culprit>'
to prevent the instantiation of the object.
If you are seeing this message after upgrading to a new GraalVM release,
this means that some objects ended up in the image heap without their type
being marked with --initialize-at-build-time.
To fix this, include
'--initialize-at-build-time=java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread'
in your configuration. If the classes do not originate from your code, it is
advised to update all library or framework dependencies to the latest version
before addressing this error.
The following detailed trace displays from which field in the code the
object was reached.
Object was reached by
reading field jdk.internal.misc.ThreadTracker$ThreadRef.thread of constant
jdk.internal.misc.ThreadTracker$ThreadRef@6e67dec4:
ThreadRef[thread=Thread[#23,ForkJoinPool.commonPool-worker-1,5,InnocuousForkJoin...
reading field java.util.concurrent.ConcurrentHashMap$Node.key of constant
java.util.concurrent.ConcurrentHashMap$Node@6273c268:
ThreadRef[thread=Thread[#23,ForkJoinPool.commonPool-worker-1,5,InnocuousForkJoin...
indexing into array
java.util.concurrent.ConcurrentHashMap$Node[]@380e2d10:
[Ljava.util.concurrent.ConcurrentHashMap$Node;@380e2d10 at index 7
reading field java.util.concurrent.ConcurrentHashMap.table of constant
java.util.concurrent.ConcurrentHashMap@42533963:
{ThreadRef[thread=Thread[#23,ForkJoinPool.commonPool-worker-1,5,InnocuousForkJoi...
reading field java.util.concurrent.ConcurrentHashMap$CollectionView.map of
constant
java.util.concurrent.ConcurrentHashMap$KeySetView@2c13fe6e:
[ThreadRef[thread=Thread[#23,ForkJoinPool.commonPool-worker-1,5,InnocuousForkJoi...
reading field jdk.internal.misc.ThreadTracker.threads of constant
jdk.internal.misc.ThreadTracker@5ffaffc2:
jdk.internal.misc.ThreadTracker@5ffaffc2
scanning root jdk.internal.misc.ThreadTracker@5ffaffc2:
jdk.internal.misc.ThreadTracker@5ffaffc2 embedded in
java.nio.charset.Charset.tryBeginLookup(Charset.java:389)
parsing method java.nio.charset.Charset.tryBeginLookup(Charset.java:389)
reachable via the parsing context
at static root method.(Unknown Source)
at
org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.onObjectReachable(ImageHeapScanner.java:618)
at
org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageHeapScanner.onObjectReachable(SVMImageHeapScanner.java:127)
at
org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$markReachable$0(ImageHeapScanner.java:589)
at
org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:166)
at
org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:152)
at
java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1750)
at
java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1742)
at
java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1659)
at
java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
at
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
at
java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
at
java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]