gluonhq / substrate

Create native Java(FX) apps for desktop, mobile and embedded
GNU General Public License v2.0
372 stars 51 forks source link

Missing CAP cache value for: NativeCodeInfo:PosixDirectives:StructInfo:struct___darwin_mcontext64:StructFieldInfo: #1218

Closed cbm64chris closed 1 year ago

cbm64chris commented 1 year ago

Running the plugin mvn gluonfx:compile with a target of ios-sim yields the following error:

Missing CAP cache value for: NativeCodeInfo:PosixDirectives:StructInfo:struct___darwin_mcontext64:StructFieldInfo:__ss___r10
com.oracle.svm.core.util.UserError$UserException: Missing CAP cache value for: NativeCodeInfo:PosixDirectives:StructInfo:struct___darwin_mcontext64:StructFieldInfo:__ss___r10

I encountered this running a personal project but have been able to reproduce with the gluon-samples/HelloFX.

I can see in @jperedadnr you may have had the missing CAP cache entries for NativeCodeInfo:PosixDirectives:StructInfo:struct___darwin_mcontext64:StructFieldInfo in your fork, but I can't tell if they were ever merged or removed.

I have validated the same goal works for ios and host as expected.

Please let me know if I can help in anyway. Thx Chris

Expected Behavior

The goal should compile for x86_64-apple-ios.

Current Behavior

Process
=======
compile

Command Line
============
/Library/Java/JavaVirtualMachines/graalvm-svm-java17-darwin-gluon-22.1.0.1-Final/Contents/Home/bin/native-image -Djdk.internal.lambda.eagerlyInitialize=false --no-server -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout -H:DeadlockWatchdogInterval=0 -H:+RemoveSaturatedTypeFlows -H:+ExitAfterRelocatableImageWrite --features=org.graalvm.home.HomeFinderFeature -H:TempDirectory=/Users/chrislluff/code/club-parent/club-mobile-app/target/gluonfx/x86_64-ios/gvm/tmp -H:EnableURLProtocols=http,https -H:+PrintAnalysisCallTree -H:Log=registerResource: -H:ReflectionConfigurationFiles=/Users/chrislluff/code/club-parent/club-mobile-app/target/gluonfx/x86_64-ios/gvm/reflectionconfig-x86_64-ios.json -H:JNIConfigurationFiles=/Users/chrislluff/code/club-parent/club-mobile-app/target/gluonfx/x86_64-ios/gvm/jniconfig-x86_64-ios.json -H:ResourceConfigurationFiles=/Users/chrislluff/code/club-parent/club-mobile-app/target/gluonfx/x86_64-ios/gvm/resourceconfig-x86_64-ios.json -H:PageSize=16384 -Dsvm.targetName=iOS -Dsvm.targetArch=x86_64 -H:+UseCAPCache -H:CAPCacheDir=/Users/chrislluff/code/club-parent/club-mobile-app/target/gluonfx/x86_64-ios/gvm/capcache -H:IncludeResourceBundles=com/sun/javafx/scene/control/skin/resources/controls,com/sun/javafx/scene/control/skin/resources/controls-nt,com.sun.javafx.tk.quantum.QuantumMessagesBundle,com.sun.media.jfxmedia.MediaErrors,com.sun.webkit.graphics.Images,com.sun.webkit.LocalizedStrings,javafx.scene.web.HTMLEditorSkin,com.sun.org.apache.xerces.internal.impl.msg.XMLMessages -Dsvm.platform=org.graalvm.nativeimage.Platform$IOS_AMD64 -cp /Users/chrislluff/.m2/repository/com/gluonhq/substrate/0.0.58/substrate-0.0.58.jar:/Users/chrislluff/code/club-parent/club-mobile-app/target/gluonfx/x86_64-ios/gvm/tmp/classpathJar.jar com.lufflogic.club.mobile.ClubMobile

Output
======
Warning: Ignoring server-mode native-image argument --no-server.
========================================================================================================================
GraalVM Native Image: Generating 'com.lufflogic.club.mobile.clubmobile' (shared library)...
========================================================================================================================

[1/7] Initializing...                                                                                    (0.0s @ 0.20GB)
Error: Missing CAP cache value for: NativeCodeInfo:PosixDirectives:StructInfo:struct___darwin_mcontext64:StructFieldInfo:__ss___r10
com.oracle.svm.core.util.UserError$UserException: Missing CAP cache value for: NativeCodeInfo:PosixDirectives:StructInfo:struct___darwin_mcontext64:StructFieldInfo:__ss___r10
    at com.oracle.svm.core.util.UserError.abort(UserError.java:72)
    at com.oracle.svm.hosted.c.info.InfoTreeVisitor.processChildren(InfoTreeVisitor.java:66)
    at com.oracle.svm.hosted.c.query.QueryResultParser.visitStructInfo(QueryResultParser.java:135)
    at com.oracle.svm.hosted.c.info.StructInfo.accept(StructInfo.java:62)
    at com.oracle.svm.hosted.c.info.InfoTreeVisitor.processChildren(InfoTreeVisitor.java:64)
    at com.oracle.svm.hosted.c.info.InfoTreeVisitor.visitNativeCodeInfo(InfoTreeVisitor.java:72)
    at com.oracle.svm.hosted.c.info.NativeCodeInfo.accept(NativeCodeInfo.java:57)
    at com.oracle.svm.hosted.c.query.QueryResultParser.parse(QueryResultParser.java:79)
    at com.oracle.svm.hosted.c.CAnnotationProcessorCache.get(CAnnotationProcessorCache.java:166)
    at com.oracle.svm.hosted.c.CAnnotationProcessor.process(CAnnotationProcessor.java:94)
    at com.oracle.svm.hosted.c.NativeLibraries.finish(NativeLibraries.java:554)
    at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1622)
    at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:1065)
    at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:888)
    at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:555)
    at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:515)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:615)
------------------------------------------------------------------------------------------------------------------------
                         0.1s (4.8% of total time) in 9 GCs | Peak RSS: 0.58GB | CPU load: 7.68
========================================================================================================================
Failed generating 'com.lufflogic.club.mobile.clubmobile' after 1.8s.
Error: Image build request failed with exit status 1

Result
======
result: 1

Steps to Reproduce

Checkout out HelloFX project, modify the ios profile with the target of ios-sim. Change the compiler release version to 17.

mvn -Pios gluonfx:compile

Your Environment

macOS 13.3.1 (22E261) 2.4 GHz 8-Core Intel Core i9 32 GB 2667 MHz DDR4 OpenJDK Runtime Environment Zulu17.42+19-CA (build 17.0.7+7-LTS)

cbm64chris commented 1 year ago

Just to add, I recreated this on aarch64 M1 macOS. Falling back to 1.0.16 of the gluonfx maven plugin allows the ios-sim target to work.

meghanEmbrace commented 1 year ago

I have also run into this issue. Falling back to 1.0.16 works for the default application but as soon as I add my project dependency I run into issue #1154 (OS: duplicate symbol in prefs).

meghanEmbrace commented 1 year ago

I noticed from https://github.com/gluonhq/substrate/pull/1196 that the following values had been removed. Adding them back allowed me to complete the build but it did then fail on the packaging step.

NativeCodeInfo:PosixDirectives:StructInfo:struct_darwin_mcontext64:StructFieldInfo:ssr10:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r10:PropertyInfo:offset=96 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r11:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r11:PropertyInfo:offset=104 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r12:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r12:PropertyInfo:offset=112 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r13:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r13:PropertyInfo:offset=120 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r14:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r14:PropertyInfo:offset=128 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r15:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r15:PropertyInfo:offset=136 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r8:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r8:PropertyInfo:offset=80 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r9:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__r9:PropertyInfo:offset=88 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rax:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rax:PropertyInfo:offset=16 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rbp:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rbp:PropertyInfo:offset=64 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rbx:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rbx:PropertyInfo:offset=24 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rcx:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rcx:PropertyInfo:offset=32 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rdi:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rdi:PropertyInfo:offset=48 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rdx:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rdx:PropertyInfo:offset=40 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rflags:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rflags:PropertyInfo:offset=152 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rip:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rip:PropertyInfo:offset=144 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rsi:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rsi:PropertyInfo:offset=56 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:ss__rsp:PropertyInfo:size=8 NativeCodeInfo:PosixDirectives:StructInfo:structdarwin_mcontext64:StructFieldInfo:__ss___rsp:PropertyInfo:offset=72

meghanEmbrace commented 1 year ago

I also assume this is related to https://github.com/gluonhq/substrate/issues/1098