Peter Palaga created CXF-9172:
---------------------------------
Summary: GraalVM detects a started Thread in the image heap after
fixing CXF-9171
Key: CXF-9172
URL: https://issues.apache.org/jira/browse/CXF-9172
Project: CXF
Issue Type: Bug
Reporter: Peter Palaga
GraalVM detects a started Thread in the image heap after fixing CXF-9171 and it
is thus not possible to compile any CXF application to native image.
Reproducible with current CXF main and Quarkus CXF
https://github.com/quarkiverse/quarkus-cxf/actions/runs/19022891715/job/54321107099
:
{code}
2025-11-03T04:24:01.8639594Z Error: Unsupported features in 2 methods
2025-11-03T04:24:01.8646630Z Detailed message:
2025-11-03T04:24:01.8648139Z Error: Detected a started Thread in the image
heap. Thread name: DelayedCachedOutputStreamCleaner. Threads running in the
image generator are no longer running at image runtime. If these objects should
not be stored in the image heap, you can use
2025-11-03T04:24:01.8650493Z
2025-11-03T04:24:01.8650981Z
'--trace-object-instantiation=java.util.TimerThread'
2025-11-03T04:24:01.8651402Z
2025-11-03T04:24:01.8652208Z to find classes that instantiate these objects.
Once you found such a class, you can mark it explicitly for run time
initialization with
2025-11-03T04:24:01.8653004Z
2025-11-03T04:24:01.8653181Z '--initialize-at-run-time=<culprit>'
2025-11-03T04:24:01.8653490Z
2025-11-03T04:24:01.8653664Z to prevent the instantiation of the object.
2025-11-03T04:24:01.8655766Z The object was probably created by a class
initializer and is reachable from a static field. You can request class
initialization at image runtime by using the option
--initialize-at-run-time=<class-name>. Or you can write your own initialization
methods and call them explicitly from your main entry point.
2025-11-03T04:24:01.8657649Z Trace: Object was reached by
2025-11-03T04:24:01.8658116Z reading field java.util.Timer.thread of constant
2025-11-03T04:24:01.8658661Z java.util.Timer@218c3bf0:
java.util.Timer@218c3bf0
2025-11-03T04:24:01.8659306Z scanning root java.util.Timer@218c3bf0:
java.util.Timer@218c3bf0 embedded in
2025-11-03T04:24:01.8660544Z
org.apache.cxf.io.DelayedCachedOutputStreamCleaner$SingleTimerDelayedCleaner.register(DelayedCachedOutputStreamCleaner.java:111)
2025-11-03T04:24:01.8662506Z parsing method
org.apache.cxf.io.DelayedCachedOutputStreamCleaner$SingleTimerDelayedCleaner.register(DelayedCachedOutputStreamCleaner.java:95)
reachable via the parsing context
2025-11-03T04:24:01.8663900Z at root method.(Unknown Source)
2025-11-03T04:24:01.8664182Z
2025-11-03T04:24:01.8666196Z Error: Detected an active instance of Cleanable or
jdk.internal.ref.Cleaner in the image heap. This usually means that a resource
such as a Timer, native memory, a file descriptor or another resource is
reachable which is not available at image runtime. If these objects should not
be stored in the image heap, you can use
2025-11-03T04:24:01.8667965Z
2025-11-03T04:24:01.8668388Z
'--trace-object-instantiation=jdk.internal.ref.CleanerImpl$PhantomCleanableRef'
2025-11-03T04:24:01.8668971Z
2025-11-03T04:24:01.8669593Z to find classes that instantiate these objects.
Once you found such a class, you can mark it explicitly for run time
initialization with
2025-11-03T04:24:01.8670364Z
2025-11-03T04:24:01.8670534Z '--initialize-at-run-time=<culprit>'
2025-11-03T04:24:01.8670838Z
2025-11-03T04:24:01.8671011Z to prevent the instantiation of the object.
2025-11-03T04:24:01.8672890Z The object was probably created by a class
initializer and is reachable from a static field. You can request class
initialization at image runtime by using the option
--initialize-at-run-time=<class-name>. Or you can write your own initialization
methods and call them explicitly from your main entry point.
2025-11-03T04:24:01.8677817Z Trace: Object was reached by
2025-11-03T04:24:01.8678302Z reading field java.util.Timer.cleanup of
constant
2025-11-03T04:24:01.8678888Z java.util.Timer@218c3bf0:
java.util.Timer@218c3bf0
2025-11-03T04:24:01.8679590Z scanning root java.util.Timer@218c3bf0:
java.util.Timer@218c3bf0 embedded in
2025-11-03T04:24:01.8680826Z
org.apache.cxf.io.DelayedCachedOutputStreamCleaner$SingleTimerDelayedCleaner.register(DelayedCachedOutputStreamCleaner.java:111)
2025-11-03T04:24:01.8682783Z parsing method
org.apache.cxf.io.DelayedCachedOutputStreamCleaner$SingleTimerDelayedCleaner.register(DelayedCachedOutputStreamCleaner.java:95)
reachable via the parsing context
2025-11-03T04:24:01.8693713Z at root method.(Unknown Source)
2025-11-03T04:24:01.8694012Z
2025-11-03T04:24:01.8694029Z
2025-11-03T04:24:01.8694341Z com.oracle.svm.core.util.UserError$UserException:
Unsupported features in 2 methods
2025-11-03T04:24:01.8694995Z Detailed message:
2025-11-03T04:24:01.8695840Z Error: Detected a started Thread in the image
heap. Thread name: DelayedCachedOutputStreamCleaner. Threads running in the
image generator are no longer running at image runtime. If these objects should
not be stored in the image heap, you can use
2025-11-03T04:24:01.8696748Z
2025-11-03T04:24:01.8696907Z
'--trace-object-instantiation=java.util.TimerThread'
2025-11-03T04:24:01.8697209Z
2025-11-03T04:24:01.8697573Z to find classes that instantiate these objects.
Once you found such a class, you can mark it explicitly for run time
initialization with
2025-11-03T04:24:01.8698013Z
2025-11-03T04:24:01.8698112Z '--initialize-at-run-time=<culprit>'
2025-11-03T04:24:01.8698286Z
2025-11-03T04:24:01.8698392Z to prevent the instantiation of the object.
2025-11-03T04:24:01.8699428Z The object was probably created by a class
initializer and is reachable from a static field. You can request class
initialization at image runtime by using the option
--initialize-at-run-time=<class-name>. Or you can write your own initialization
methods and call them explicitly from your main entry point.
2025-11-03T04:24:01.8700444Z Trace: Object was reached by
2025-11-03T04:24:01.8700695Z reading field java.util.Timer.thread of constant
2025-11-03T04:24:01.8701015Z java.util.Timer@218c3bf0:
java.util.Timer@218c3bf0
2025-11-03T04:24:01.8701421Z scanning root java.util.Timer@218c3bf0:
java.util.Timer@218c3bf0 embedded in
2025-11-03T04:24:01.8702114Z
org.apache.cxf.io.DelayedCachedOutputStreamCleaner$SingleTimerDelayedCleaner.register(DelayedCachedOutputStreamCleaner.java:111)
2025-11-03T04:24:01.8703280Z parsing method
org.apache.cxf.io.DelayedCachedOutputStreamCleaner$SingleTimerDelayedCleaner.register(DelayedCachedOutputStreamCleaner.java:95)
reachable via the parsing context
2025-11-03T04:24:01.8704033Z at root method.(Unknown Source)
2025-11-03T04:24:01.8704190Z
2025-11-03T04:24:01.8705552Z Error: Detected an active instance of Cleanable or
jdk.internal.ref.Cleaner in the image heap. This usually means that a resource
such as a Timer, native memory, a file descriptor or another resource is
reachable which is not available at image runtime. If these objects should not
be stored in the image heap, you can use
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)