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

Deal with experimental VM options warnings in 23.1/24.0 #184

Closed
jerboaa opened this issue Sep 5, 2023 · 7 comments
Closed

Deal with experimental VM options warnings in 23.1/24.0 #184

jerboaa opened this issue Sep 5, 2023 · 7 comments

Comments

@jerboaa
Copy link
Collaborator

jerboaa commented Sep 5, 2023

With Mandrel 23.1 and/or GraalVM 24.0 almost all -H options get flagged like so:

org.opentest4j.AssertionFailedError: 
build-and-run.log log should not contain error or warning lines that are not whitelisted. See /disk/graal/upstream-sources/mandrel-integration-tests/testsuite/target/archived-logs/org.graalvm.tests.integration.DebugSymbolsTest/debugSymbolsSmokeGDB/build-and-run.log and check these offending lines: 
Warning: The option '-H:+PreserveFramePointer' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:-DeleteLocalSymbols' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:+TrackNodeSourcePosition' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:GenerateDebugInfo=1' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:+OmitInlinedMethodDebugLineInfo' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:+DebugCodeInfoUseSourceMappings' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue. ==> expected: <true> but was: <false>
	at org.graalvm.tests.integration.DebugSymbolsTest.debugSymbolsSmokeGDB(DebugSymbolsTest.java:190)

We need to add hooks in the test suite so as to surround them by -H:+UnlockExperimentalVMOptions and -H:-UnlockExperimentalVMOptions.

@jerboaa
Copy link
Collaborator Author

jerboaa commented Sep 5, 2023

The above are probably a bad example as they're added by Quarkus. But the imageio tests for example have those:

2023-09-05 18:02:44.670 INFO  [o.g.t.i.u.Commands$ProcessRunner] (run) Command: [native-image, -J-Djava.awt.headless=true, -H:IncludeResources=Grace_M._Hopper.jp2,MyFreeMono.ttf,MyFreeSerif.ttf, --no-fallback, -jar, target/imageio.jar, target/imageio]
Warning: The option '-H:IncludeResources=Grace_M._Hopper.jp2,MyFreeMono.ttf,MyFreeSerif.ttf' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
========================================================================================================================
GraalVM Native Image: Generating 'imageio' (executable)...
========================================================================================================================
For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
------------------------------------------------------------------------------------------------------------------------
[1/8] Initializing...                                                                                    (2.6s @ 0.18GB)
 Java version: 21-beta+34-ea, vendor version: Mandrel-24.0.0-dev5444bbd56f05
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: gcc (redhat, x86_64, 12.3.1)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 1 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
 1 experimental option(s) unlocked:
 - '-H:IncludeResources' (origin(s): command line)
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 26.49GB of memory (42.4% of 62.55GB system memory, determined at start)
 - 12 thread(s) (100.0% of 12 available processor(s), determined at start)
[2/8] Performing analysis...  [*****]                                                                   (12.1s @ 0.57GB)
    5,546 reachable types   (76.3% of    7,271 total)
    9,358 reachable fields  (55.2% of   16,949 total)
   28,203 reachable methods (50.9% of   55,385 total)
    1,727 types,    92 fields, and   951 methods registered for reflection
      128 types,   203 fields, and   117 methods registered for JNI access
        4 native libraries: dl, pthread, rt, z
[3/8] Building universe...                                                                               (2.7s @ 0.53GB)
[4/8] Parsing methods...      [*]                                                                        (1.5s @ 0.62GB)
[5/8] Inlining methods...     [***]                                                                      (1.2s @ 0.64GB)
[6/8] Compiling methods...    [****]                                                                    (12.5s @ 0.66GB)
[7/8] Layouting methods...    [**]                                                                       (2.6s @ 0.55GB)
[8/8] Creating image...       [**]                                                                       (2.8s @ 0.67GB)
  13.47MB (47.16%) for code area:    17,206 compilation units
  14.75MB (51.64%) for image heap:  160,042 objects and 55 resources
 350.48kB ( 1.20%) for other data
  28.56MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area:                                Top 10 object types in image heap:
   6.02MB java.base                                            3.90MB byte[] for code metadata
   5.76MB java.desktop                                         2.13MB byte[] for java.lang.String
   1.08MB svm.jar (Native Image)                               1.60MB java.lang.String
 119.52kB java.logging                                         1.42MB byte[] for embedded resources
  65.00kB org.graalvm.nativeimage.base                         1.27MB java.lang.Class
  53.50kB jdk.crypto.ec                                      476.61kB com.oracle.svm.core.hub.DynamicHubCompanion
  50.47kB java.datatransfer                                  368.82kB heap alignment
  50.02kB imageio.jar                                        316.85kB java.lang.String[]
  47.59kB jdk.proxy1                                         299.13kB byte[] for general heap data
  45.84kB jdk.proxy3                                         291.63kB java.lang.Object[]
  72.37kB for 6 more packages                                  2.72MB for 1151 more object types
------------------------------------------------------------------------------------------------------------------------
Recommendations:
 HEAP: Set max heap for improved and more predictable memory usage.
 CPU:  Enable more CPU features with '-march=native' for improved performance.
------------------------------------------------------------------------------------------------------------------------
                        2.5s (6.3% of total time) in 339 GCs | Peak RSS: 1.17GB | CPU load: 9.11
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/imageio (executable)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libawt.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libawt_headless.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libawt_xawt.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libfontmanager.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libjava.so (jdk_library_shim)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libjavajpeg.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libjvm.so (jdk_library_shim)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/liblcms.so (jdk_library)
========================================================================================================================
Finished generating 'imageio' in 38.7s.

@zakkak
Copy link
Collaborator

zakkak commented Sep 6, 2023

The above are probably a bad example as they're added by Quarkus.

For reference the Quarkus PR for handling this is quarkusio/quarkus#35379

@jerboaa
Copy link
Collaborator Author

jerboaa commented Sep 6, 2023

I've filed an issue to consider the include resources options as stable: oracle/graal#7354

@jerboaa
Copy link
Collaborator Author

jerboaa commented Sep 6, 2023

The above are probably a bad example as they're added by Quarkus.

For reference the Quarkus PR for handling this is quarkusio/quarkus#35379

Doesn't seem the full story. See quarkusio/quarkus#35788

@zakkak
Copy link
Collaborator

zakkak commented Sep 7, 2023

Doesn't seem the full story. See quarkusio/quarkus#35788

Good catch. I created a complementary PR for the rest of the options quarkusio/quarkus#35772

@jerboaa
Copy link
Collaborator Author

jerboaa commented Sep 19, 2023

Closing this one as I think all experimental VM options are now either ignored or properly dealt with. See #184 (comment) for all individual issues that got fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants