-
Notifications
You must be signed in to change notification settings - Fork 2.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
Enable --exact-reachability-metadata
with Mandrel >= 23.1 (GraalVM for JDK 21)
#41995
Labels
Comments
zakkak
changed the title
Enable
Enable Jul 22, 2024
ThrowMissingRegistrationErrors
with Mandrel >= 23.1 (GraalVM for JDK 21)--exact-reachability-metadata
with Mandrel >= 23.1 (GraalVM for JDK 21)
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 23, 2024
Instead of registering all constructors we only need to register the nullary constructor. Furthermore, we need to register the `provider()` method for reflective lookup to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. The said constructor and method are accessed in ServiceLoader#loadProvider and ServiceLoader#findStaticProviderMethod. Relates to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 23, 2024
Picocli invokes getDeclaredFields on the declaring classes of annotated fields so we need to register all fields instead of just the annotated ones to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995
This was referenced Jul 23, 2024
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Jul 23, 2024
Picocli invokes getDeclaredFields on the declaring classes of annotated fields so we need to register all fields instead of just the annotated ones to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995 (cherry picked from commit 8857958)
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 23, 2024
Instead of registering all constructors we only need to register the nullary constructor. Furthermore, we need to register the `provider()` method for reflective lookup to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. The said constructor and method are accessed in ServiceLoader#loadProvider and ServiceLoader#findStaticProviderMethod. Relates to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 24, 2024
When instantiating a SecureRandom the constructor reflectively looks for the NativePRNG constructor and invokes it. Although the lookup succeeds without the explicit registration, it's better to explicitly request it. This also prevents getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 24, 2024
When instantiating a SecureRandom the constructor reflectively looks for the NativePRNG constructor and invokes it. Although the lookup succeeds without the explicit registration, it's better to explicitly request it. This also prevents getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 24, 2024
`SmallryeConfigBuilder` tries to access properties files from various sources, despite them not being available at run-time nor supported in native-mode, see quarkusio#41994 This patch also avoids getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Related to quarkusio#41994 and quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 24, 2024
`SmallryeConfigBuilder` tries to access properties files from various sources, despite them not being available at run-time nor supported in native-mode, see quarkusio#41994 This patch also avoids getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Related to quarkusio#41994 and quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 25, 2024
`SmallryeConfigBuilder` tries to access properties files from various sources, despite them not being available at run-time nor supported in native-mode, see quarkusio#41994 This patch also avoids getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Related to quarkusio#41994 and quarkusio#41995
barreiro
pushed a commit
to barreiro/quarkus
that referenced
this issue
Jul 25, 2024
Picocli invokes getDeclaredFields on the declaring classes of annotated fields so we need to register all fields instead of just the annotated ones to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 26, 2024
`SmallryeConfigBuilder` tries to access properties files from various sources, despite them not being available at run-time nor supported in native-mode, see quarkusio#41994 This patch also avoids getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Related to quarkusio#41994 and quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 30, 2024
Doesn't seem to fix any functionality issues but prevents `MissingRegistrationErrors` from being thrown when `ThrowMissingRegistrationErrors` is enabled. Related to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 31, 2024
Doesn't seem to fix any functionality issues but prevents `MissingRegistrationErrors` from being thrown when `ThrowMissingRegistrationErrors` is enabled. Related to quarkusio#41995
holly-cummins
pushed a commit
to holly-cummins/quarkus
that referenced
this issue
Jul 31, 2024
Picocli invokes getDeclaredFields on the declaring classes of annotated fields so we need to register all fields instead of just the annotated ones to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995
holly-cummins
pushed a commit
to holly-cummins/quarkus
that referenced
this issue
Jul 31, 2024
Instead of registering all constructors we only need to register the nullary constructor. Furthermore, we need to register the `provider()` method for reflective lookup to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. The said constructor and method are accessed in ServiceLoader#loadProvider and ServiceLoader#findStaticProviderMethod. Relates to quarkusio#41995
holly-cummins
pushed a commit
to holly-cummins/quarkus
that referenced
this issue
Jul 31, 2024
When instantiating a SecureRandom the constructor reflectively looks for the NativePRNG constructor and invokes it. Although the lookup succeeds without the explicit registration, it's better to explicitly request it. This also prevents getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Jul 31, 2024
Doesn't seem to fix any functionality issues but prevents `MissingRegistrationErrors` from being thrown when `ThrowMissingRegistrationErrors` is enabled. Related to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Aug 1, 2024
Doesn't seem to fix any functionality issues but prevents `MissingRegistrationErrors` from being thrown when `ThrowMissingRegistrationErrors` is enabled. Related to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Aug 1, 2024
Doesn't seem to fix any functionality issues but prevents `MissingRegistrationErrors` from being thrown when `ThrowMissingRegistrationErrors` is enabled. Related to quarkusio#41995
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Aug 1, 2024
When instantiating a SecureRandom the constructor reflectively looks for the NativePRNG constructor and invokes it. Although the lookup succeeds without the explicit registration, it's better to explicitly request it. This also prevents getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995 (cherry picked from commit 0e8f9cd)
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Aug 2, 2024
Doesn't seem to fix any functionality issues but prevents `MissingRegistrationErrors` from being thrown when `ThrowMissingRegistrationErrors` is enabled. Related to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Aug 2, 2024
Doesn't seem to fix any functionality issues but prevents `MissingRegistrationErrors` from being thrown when `ThrowMissingRegistrationErrors` is enabled. Related to quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Sep 4, 2024
danielsoro
pushed a commit
to danielsoro/quarkus
that referenced
this issue
Sep 20, 2024
Picocli invokes getDeclaredFields on the declaring classes of annotated fields so we need to register all fields instead of just the annotated ones to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995
danielsoro
pushed a commit
to danielsoro/quarkus
that referenced
this issue
Sep 20, 2024
Instead of registering all constructors we only need to register the nullary constructor. Furthermore, we need to register the `provider()` method for reflective lookup to avoid `MissingReflectionRegistrationError`s at run-time when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. The said constructor and method are accessed in ServiceLoader#loadProvider and ServiceLoader#findStaticProviderMethod. Relates to quarkusio#41995
danielsoro
pushed a commit
to danielsoro/quarkus
that referenced
this issue
Sep 20, 2024
When instantiating a SecureRandom the constructor reflectively looks for the NativePRNG constructor and invokes it. Although the lookup succeeds without the explicit registration, it's better to explicitly request it. This also prevents getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Relates to quarkusio#41995
This was referenced Nov 21, 2024
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Dec 2, 2024
`SmallryeConfigBuilder` tries to access properties files from various sources, despite them not being available at run-time nor supported in native-mode, see quarkusio#41994 This patch also avoids getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Related to quarkusio#41994 and quarkusio#41995
zakkak
added a commit
to zakkak/quarkus
that referenced
this issue
Dec 2, 2024
`SmallryeConfigBuilder` tries to access properties files from various sources, despite them not being available at run-time nor supported in native-mode, see quarkusio#41994 This patch also avoids getting a `MissingRegistrationError` when using `-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`. Related to quarkusio#41994 and quarkusio#41995
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Background
Starting with Mandrel 23.0 (GraalVM for JDK 17) an option
-H:+ThrowMissingRegistrationErrors
was introduced to throw an exceptionSee oracle/graal#6139
Starting with Mandrel 23.1 (GraalVM for JDK 21) the option was extended to also cover other elements, e.g., classes, resources, etc.
See https://github.com/oracle/graal/blob/release/graal-vm/23.1/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/doc-files/MissingRegistrationHelp.txt and oracle/graal#6448
Starting with Mandrel 24.1 (GraalVM for JDK 23) the option will be available as a public flag (meaning it's no longer experimental) with the intention to ultimately become the default.
See https://github.com/oracle/graal/blob/release/graal-vm/24.1/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/doc-files/ExactReachabilityMetadataHelp.txt, oracle/graal#5173 (comment) and oracle/graal#9036
Pros
Enabling the flag by default seems like a good idea since it will notify the users about elements that the code tries to access reflectively but have not been registered, which right now is leading in unexpected behavior without the users even knowing in some cases (for an example see #37626).
Cons/Difficulties
The so far identified cons and difficulties of having this option enabled by default are:
Implementation ideas
WIP PR #36378
The text was updated successfully, but these errors were encountered: