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

Remove test case from no-awt native integration test #30360

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

zakkak
Copy link
Contributor

@zakkak zakkak commented Jan 13, 2023

In Java 20-based builds of GraalVM / Mandrel invoking Font.getFamily() results in sun.font.SunFontManager become reachable and initialized at build time, which when initialized results in the following build error:

Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image runtime.  To see how this object got instantiated use --trace-object-instantiation=java.lang.Thread. 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.
Detailed message:
Trace: Object was reached by
  reading field java.util.concurrent.locks.AbstractQueuedSynchronizer$Node.waiter of constant
    java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode@7cd99b6e: java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode@7cd99b6e
  reading field java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.lastWaiter of constant
    java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@32b2749: java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@32b2749
  reading field java.lang.ref.ReferenceQueue.notEmpty of constant
    java.lang.ref.ReferenceQueue@4b839317: java.lang.ref.ReferenceQueue@4b839317
  scanning root java.lang.ref.ReferenceQueue@4b839317: java.lang.ref.ReferenceQueue@4b839317 embedded in
    sun.java2d.Disposer.addObjectRecord(Disposer.java:250)
  parsing method sun.java2d.Disposer.addObjectRecord(Disposer.java:250) reachable via the parsing context
    at sun.font.Type1Font.<init>(Type1Font.java:176)
    at sun.font.SunFontManager.registerFontFile(SunFontManager.java:960)
    at sun.font.SunFontManager.registerFontFile(SunFontManager.java:3226)
    at sun.font.SunFontManager.initCompositeFonts(SunFontManager.java:3137)
    at sun.font.SunFontManager$2.run(SunFontManager.java:445)
    at sun.font.SunFontManager$2.run(SunFontManager.java:309)
    at com.oracle.svm.core.jdk.Target_java_security_AccessController.executePrivileged(SecuritySubstitutions.java:171)
    at java.util.logging.Logger.findResourceBundle(Logger.java:2215)
    at java.util.logging.Logger.setupResourceInfo(Logger.java:2297)
    at java.util.logging.Logger.<init>(Logger.java:566)
    at java.util.logging.Logger.<init>(Logger.java:557)
    at org.jboss.logmanager.Logger.<init>(Logger.java:85)
    at org.jboss.logmanager.LoggerNode.createLogger(LoggerNode.java:200)
    at org.jboss.logmanager.LogContext.getLogger(LogContext.java:161)
    at org.jboss.logmanager.Logger.getLogger(Logger.java:55)
    at io.quarkus.vertx.core.runtime.VertxLogDelegate.<init>(VertxLogDelegate.java:14)
    at io.quarkus.vertx.core.runtime.VertxLogDelegateFactory.createDelegate(VertxLogDelegateFactory.java:14)

Note that the aim of no-awt is to test the error reports generated by quarkus when we try to use awt without the quarkus-awt extension so removing the "Font" case doesn't reduce coverage or cover up an existing issue.

In Java 20-based builds of GraalVM / Mandrel invoking Font.getFamily()
results in `sun.font.SunFontManager` become reachable and initialized at
build time, which when initialized results in the following build error:

```
Error: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image runtime.  To see how this object got instantiated use --trace-object-instantiation=java.lang.Thread. 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.
Detailed message:
Trace: Object was reached by
  reading field java.util.concurrent.locks.AbstractQueuedSynchronizer$Node.waiter of constant
    java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode@7cd99b6e: java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode@7cd99b6e
  reading field java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.lastWaiter of constant
    java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@32b2749: java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@32b2749
  reading field java.lang.ref.ReferenceQueue.notEmpty of constant
    java.lang.ref.ReferenceQueue@4b839317: java.lang.ref.ReferenceQueue@4b839317
  scanning root java.lang.ref.ReferenceQueue@4b839317: java.lang.ref.ReferenceQueue@4b839317 embedded in
    sun.java2d.Disposer.addObjectRecord(Disposer.java:250)
  parsing method sun.java2d.Disposer.addObjectRecord(Disposer.java:250) reachable via the parsing context
    at sun.font.Type1Font.<init>(Type1Font.java:176)
    at sun.font.SunFontManager.registerFontFile(SunFontManager.java:960)
    at sun.font.SunFontManager.registerFontFile(SunFontManager.java:3226)
    at sun.font.SunFontManager.initCompositeFonts(SunFontManager.java:3137)
    at sun.font.SunFontManager$2.run(SunFontManager.java:445)
    at sun.font.SunFontManager$2.run(SunFontManager.java:309)
    at com.oracle.svm.core.jdk.Target_java_security_AccessController.executePrivileged(SecuritySubstitutions.java:171)
    at java.util.logging.Logger.findResourceBundle(Logger.java:2215)
    at java.util.logging.Logger.setupResourceInfo(Logger.java:2297)
    at java.util.logging.Logger.<init>(Logger.java:566)
    at java.util.logging.Logger.<init>(Logger.java:557)
    at org.jboss.logmanager.Logger.<init>(Logger.java:85)
    at org.jboss.logmanager.LoggerNode.createLogger(LoggerNode.java:200)
    at org.jboss.logmanager.LogContext.getLogger(LogContext.java:161)
    at org.jboss.logmanager.Logger.getLogger(Logger.java:55)
    at io.quarkus.vertx.core.runtime.VertxLogDelegate.<init>(VertxLogDelegate.java:14)
    at io.quarkus.vertx.core.runtime.VertxLogDelegateFactory.createDelegate(VertxLogDelegateFactory.java:14)
```

Note that the aim of `no-awt` is to test the error reports generated by
quarkus when we try to use awt without the quarkus-awt extension so
removing the "Font" case doesn't reduce coverage or cover up an existing
issue.
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 13, 2023

/cc @Karm (awt), @galderz (awt)

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 13, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Copy link
Member

@Karm Karm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thank you. Makes sense.

@Karm Karm merged commit fb3f75f into quarkusio:main Jan 13, 2023
@quarkus-bot quarkus-bot bot added this to the 2.17 - main milestone Jan 13, 2023
@zakkak zakkak deleted the 2023-01-13-quarkus-jdk-20-awt-fix branch January 13, 2023 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants