{"id":17061113,"url":"https://github.com/lispyclouds/graalvm21-reflection-issue","last_synced_at":"2025-07-14T18:15:48.823Z","repository":{"id":237437920,"uuid":"695820500","full_name":"lispyclouds/graalvm21-reflection-issue","owner":"lispyclouds","description":"A small repro for a reflection issue since GraalVM 21 native image","archived":false,"fork":false,"pushed_at":"2023-09-25T06:39:31.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-23T08:28:14.432Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lispyclouds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-24T10:30:21.000Z","updated_at":"2023-09-24T10:56:46.000Z","dependencies_parsed_at":"2024-06-02T14:06:14.275Z","dependency_job_id":null,"html_url":"https://github.com/lispyclouds/graalvm21-reflection-issue","commit_stats":null,"previous_names":["lispyclouds/graalvm21-reflection-issue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lispyclouds/graalvm21-reflection-issue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lispyclouds%2Fgraalvm21-reflection-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lispyclouds%2Fgraalvm21-reflection-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lispyclouds%2Fgraalvm21-reflection-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lispyclouds%2Fgraalvm21-reflection-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lispyclouds","download_url":"https://codeload.github.com/lispyclouds/graalvm21-reflection-issue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lispyclouds%2Fgraalvm21-reflection-issue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265328425,"owners_count":23747898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T10:46:07.397Z","updated_at":"2025-07-14T18:15:48.773Z","avatar_url":"https://github.com/lispyclouds.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraalVM 20/21 native image reflection issue\n\nThis is a repro for an issue we are facing as a part of the [Babashka](https://babashka.org) project since GraalVM 21 native image. Also seems to happen with GraalVM 20.\n\n## Build steps\n- Download GraalVM or GraalVM CE and set `JAVA_HOME` to the dir.\n- Compile: `$JAVA_HOME/bin/javac ReflectionIssue.java`\n- Compile to native: `$JAVA_HOME/bin/native-image -H:+UnlockExperimentalVMOptions -H:ReflectionConfigurationFiles=reflect-config.json ReflectionIssue`\n\n## The error\n\nRun the resulting binary `./reflectionissue` to get the following issue (this is on linux/amd64):\n\n```\nFatal error: Cannot invoke method that has a @CallerSensitiveAdapter without an explicit caller\n\nPrinting instructions (ip=0x00000000005347be):\n  0x00000000005346be: 0x27 0x00 0x48 0x89 0x4c 0x24 0x08 0x48 0x89 0x44 0x24 0x10 0xe8 0x71 0xe7 0xfe\n  0x00000000005346ce: 0xff 0x90 0x41 0xc7 0x87 0xe8 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0xf0 0x83 0x04\n  0x00000000005346de: 0x24 0x00 0x49 0xc7 0x47 0x08 0x01 0x00 0x00 0x00 0x41 0xc7 0x87 0xe4 0x00 0x00\n  0x00000000005346ee: 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x7c 0x24 0x10 0x48 0x8b 0x74 0x24 0x08 0x49\n  0x00000000005346fe: 0x8b 0xd6 0xe8 0x8b 0xb5 0xf5 0xff 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc\n  0x000000000053470e: 0xcc 0xcc 0x48 0x83 0xec 0x18 0x48 0x8b 0x44 0x24 0x18 0x49 0x8d 0x8e 0xc8 0x78\n  0x000000000053471e: 0x27 0x00 0x48 0x89 0x4c 0x24 0x08 0x48 0x89 0x44 0x24 0x10 0xe8 0x11 0xe7 0xfe\n  0x000000000053472e: 0xff 0x90 0x41 0xc7 0x87 0xe8 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0xf0 0x83 0x04\n  0x000000000053473e: 0x24 0x00 0x49 0xc7 0x47 0x08 0x01 0x00 0x00 0x00 0x41 0xc7 0x87 0xe4 0x00 0x00\n  0x000000000053474e: 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x7c 0x24 0x10 0x48 0x8b 0x74 0x24 0x08 0x49\n  0x000000000053475e: 0x8b 0xd6 0xe8 0x2b 0xb5 0xf5 0xff 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc\n  0x000000000053476e: 0xcc 0xcc 0x48 0x83 0xec 0x18 0x48 0x8b 0x44 0x24 0x18 0x48 0x89 0x7c 0x24 0x08\n  0x000000000053477e: 0x48 0x89 0x44 0x24 0x10 0xe8 0xb8 0xe6 0xfe 0xff 0x90 0x41 0xc7 0x87 0xe8 0x00\n  0x000000000053478e: 0x00 0x00 0x01 0x00 0x00 0x00 0xf0 0x83 0x04 0x24 0x00 0x49 0xc7 0x47 0x08 0x01\n  0x000000000053479e: 0x00 0x00 0x00 0x41 0xc7 0x87 0xe4 0x00 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b\n  0x00000000005347ae: 0x7c 0x24 0x10 0x48 0x8b 0x74 0x24 0x08 0x49 0x8b 0xd6 0xe8 0xd2 0xb4 0xf5 0xff\n\u003e 0x00000000005347be: 0x90 0xcc 0x48 0x83 0xec 0x18 0x48 0x8b 0x44 0x24 0x18 0x49 0x8d 0x8e 0xe0 0x78\n  0x00000000005347ce: 0x27 0x00 0x48 0x89 0x4c 0x24 0x08 0x48 0x89 0x44 0x24 0x10 0xe8 0x61 0xe6 0xfe\n  0x00000000005347de: 0xff 0x90 0x41 0xc7 0x87 0xe8 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0xf0 0x83 0x04\n  0x00000000005347ee: 0x24 0x00 0x49 0xc7 0x47 0x08 0x01 0x00 0x00 0x00 0x41 0xc7 0x87 0xe4 0x00 0x00\n  0x00000000005347fe: 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x7c 0x24 0x10 0x48 0x8b 0x74 0x24 0x08 0x49\n  0x000000000053480e: 0x8b 0xd6 0xe8 0x7b 0xb4 0xf5 0xff 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc\n  0x000000000053481e: 0xcc 0xcc 0x48 0x8d 0x5c 0x24 0xf8 0x49 0x3b 0x5f 0x08 0x0f 0x86 0x01 0xb8 0xf3\n  0x000000000053482e: 0xff 0x48 0x8b 0xe3 0x49 0x3b 0xf6 0x0f 0x84 0x24 0x00 0x00 0x00 0x8b 0x06 0xc1\n  0x000000000053483e: 0xe8 0x05 0x81 0xf8 0x0d 0xa6 0x06 0x00 0x0f 0x85 0x18 0x00 0x00 0x00 0x48 0x8b\n  0x000000000053484e: 0xc6 0x48 0x83 0xc4 0x08 0x41 0x83 0x6f 0x10 0x01 0x0f 0x8e 0xa2 0x23 0x00 0x00\n  0x000000000053485e: 0xc3 0x49 0x8b 0xf6 0xeb 0xe8 0x49 0x8d 0x86 0x68 0x30 0x35 0x00 0x48 0x8b 0xfe\n  0x000000000053486e: 0x48 0x8b 0xf0 0xe8 0xaa 0x60 0xfe 0xff 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc\n  0x000000000053487e: 0xcc 0xcc 0x48 0x8d 0x5c 0x24 0x98 0x49 0x3b 0x5f 0x08 0x0f 0x86 0xa1 0xb7 0xf3\n  0x000000000053488e: 0xff 0x48 0x8b 0xe3 0x48 0x89 0x7c 0x24 0x38 0x48 0x89 0x74 0x24 0x30 0x48 0x89\n  0x000000000053489e: 0x54 0x24 0x28 0x8b 0x46 0x08 0x85 0xc0 0x0f 0x84 0xb9 0x09 0x00 0x00 0x41 0x8b\n  0x00000000005348ae: 0x44 0xc6 0x04 0x8b 0x4f 0x04 0x49 0x8d 0x1c 0xce 0x85 0xc0 0x0f 0x84 0xe9 0x05\n\nTop of stack (sp=0x00007ffc797bdfc0):\n  0x00007ffc797bdfa0: 0x00007f9b4ca9ec60 0x00000000008758b7 0x0000000100000000 0x00000000005347be\n\u003e 0x00007ffc797bdfc0: 0x00007f9b4c4c9190 0x00007f9b4c4f6cc8 0x00000000004ef469 0x00000000004ef469\n  0x00007ffc797bdfe0: 0x0000000900000010 0x00000000007023a7 0x00007f9b4c280000 0x00007f9b4c4c9190\n  0x00007ffc797be000: 0x00007f9b4c5db950 0x00007f9b4c280000 0x000000094c714180 0x000000000040610d\n  0x00007ffc797be020: 0x0000000000000003 0x0000000000a4ed95 0x00007f9b4c760808 0x00007f9b4c4c9190\n  0x00007ffc797be040: 0x000000004c6ab5f8 0x000000000040f6e5 0x0000000001234ae0 0x00000000004334ed\n  0x00007ffc797be060: 0xffffffffffffffff 0x0000000000000000 0x0000000000000000 0x0000000000000000\n  0x00007ffc797be080: 0x0000000001234ae0 0x00007ffc797be1e8 0x0000000100000000 0x00007ffc797be160\n  0x00007ffc797be0a0: 0x0000000001232de0 0x00007fa34c538000 0x0000000000000000 0x0000000000000001\n  0x00007ffc797be0c0: 0x00007ffc797be1e8 0x00007fa34c31cb8a 0x00007ffc797be110 0x00007ffc797be1e8\n  0x00007ffc797be0e0: 0x0000000100400040 0x0000000000433440 0x00007ffc797be1e8 0x223926e85e7556d6\n  0x00007ffc797be100: 0x0000000000000001 0x0000000000000000 0x00007fa34c538000 0x0000000001232de0\n  0x00007ffc797be120: 0x223926e85d1556d6 0x22874c7c0a3756d6 0x00007fa300000000 0x0000000000000000\n  0x00007ffc797be140: 0x0000000000000000 0x0000000000000001 0x00007ffc797be1e0 0xffbf1421f832d000\n  0x00007ffc797be160: 0x00007ffc797be1c0 0x00007fa34c31cc4b 0x00007ffc797be1f8 0x0000000001232de0\n  0x00007ffc797be180: 0x00007ffc797be1f8 0x0000000000433440 0x0000000000000000 0x0000000000000000\n  0x00007ffc797be1a0: 0x0000000000405000 0x00007ffc797be1e0 0x0000000000000000 0x0000000000000000\n\nVM thread locals for the failing thread 0x0000000002f23300:\n  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)\n    0x0000000002f23300: 0x00007f9b4c5c1008\n  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)\n  16 (4 bytes): Safepoint.safepointRequested = (int) 2147466737 (0x7fffbdf1)\n  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)\n  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)\n    0x0000000002f23318: 0x00007f9b4ca80000 0x00007f9b4cb00000\n    0x0000000002f23328: 0x00007f9b4ca9f9a8 0x0000000000000000\n  56 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)\n  64 (8 bytes): PlatformThreads.currentVThreadId = (long) 1 (0x0000000000000001)\n  72 (4 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x00007f9b4c710600)\n  80 (8 bytes): ActionOnExitSafepointSupport.returnIP = (Word) 0 (0x0000000000000000)\n  88 (8 bytes): ActionOnExitSafepointSupport.returnSP = (Word) 0 (0x0000000000000000)\n  96 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)\n    0x0000000002f23360: 0x0000000000000000\n  104 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 0 (0x0000000000000000)\n  112 (8 bytes): VMThreads.IsolateTL = (Word) 140304974348288 (0x00007f9b4c280000)\n  120 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 140339334555456 (0x00007fa34c2f2740)\n  128 (8 bytes): VMThreads.OSThreadIdTL = (Word) 24990 (0x000000000000619e)\n  136 (8 bytes): VMThreads.StackBase = (Word) 140722346651648 (0x00007ffc797bf000)\n  144 (8 bytes): VMThreads.StackEnd = (Word) 140722338267136 (0x00007ffc78fc0000)\n  152 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)\n    0x0000000002f23398: 0x0000000000000000\n  160 (8 bytes): VMThreads.nextTL = (Word) 0 (0x0000000000000000)\n  168 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 49427168 (0x0000000002f232e0)\n  176 (4 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x00007f9b4ca80ed0)\n  180 (4 bytes): ExceptionUnwind.currentException = (Object) null\n  184 (4 bytes): IsolatedCompileClient.currentClient = (Object) null\n  188 (4 bytes): IsolatedCompileContext.currentContext = (Object) null\n  192 (4 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x00007f9b4ca80928)\n  196 (4 bytes): JNIThreadLocalPendingException.pendingException = (Object) null\n  200 (4 bytes): JNIThreadLocalReferencedObjects.referencedObjectsListHead = (Object) null\n  204 (4 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null\n  208 (4 bytes): NoAllocationVerifier.openVerifiers = (Object) null\n  212 (4 bytes): ThreadingSupportImpl.activeTimer = (Object) null\n  216 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)\n  220 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)\n  224 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)\n  228 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)\n  232 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)\n  236 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)\n\nJava frame anchors for the failing thread 0x0000000002f23300:\n  No anchors\n\nStacktrace for the failing thread 0x0000000002f23300 (A=AOT compiled, J=JIT compiled, D=deoptimized, i=inlined):\n  i  SP 0x00007ffc797bdfc0 IP 0x00000000005347be size=32    com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:148)\n  i  SP 0x00007ffc797bdfc0 IP 0x00000000005347be size=32    com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:141)\n  A  SP 0x00007ffc797bdfc0 IP 0x00000000005347be size=32    com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:90)\n  A  SP 0x00007ffc797bdfe0 IP 0x00000000004ef469 size=64    com.oracle.svm.core.reflect.SubstrateMethodAccessor.invoke(SubstrateMethodAccessor.java:112)\n  i  SP 0x00007ffc797be020 IP 0x000000000040610d size=48    java.lang.reflect.Method.invoke(Method.java:580)\n  A  SP 0x00007ffc797be020 IP 0x000000000040610d size=48    ReflectionIssue.main(ReflectionIssue.java:5)\n  i  SP 0x00007ffc797be050 IP 0x000000000040f6e5 size=16    java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)\n  i  SP 0x00007ffc797be050 IP 0x000000000040f6e5 size=16    com.oracle.svm.core.JavaMainWrapper.invokeMain(JavaMainWrapper.java:181)\n  A  SP 0x00007ffc797be050 IP 0x000000000040f6e5 size=16    com.oracle.svm.core.JavaMainWrapper.runCore0(JavaMainWrapper.java:237)\n  i  SP 0x00007ffc797be060 IP 0x00000000004334ed size=112   com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:204)\n  i  SP 0x00007ffc797be060 IP 0x00000000004334ed size=112   com.oracle.svm.core.JavaMainWrapper.doRun(JavaMainWrapper.java:293)\n  i  SP 0x00007ffc797be060 IP 0x00000000004334ed size=112   com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:279)\n  A  SP 0x00007ffc797be060 IP 0x00000000004334ed size=112   com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(IsolateEnterStub.java:0)\n\nThreads:\n  0x00007f9b44000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) \"Reference Handler\" - 0x00007f9b4c710588, daemon, stack(0x00007f9b4ba81000,0x00007f9b4c280000)\n  0x0000000002f23300 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) \"main\" - 0x00007f9b4c710600, stack(0x00007ffc78fc0000,0x00007ffc797bf000)\n\nNo VMOperation in progress\n\nThe 30 most recent VM operation status changes:\n\nVM mutexes:\n  mutex \"RealLog.backTracePrinterMutex\" is unlocked.\n  mutex \"freeList\" is unlocked.\n  mutex \"mainVMOperationControlWorkQueue\" is unlocked.\n  mutex \"referencePendingList\" is unlocked.\n  mutex \"thread\" is unlocked.\n\nGeneral information:\n  VM version: 21+35, linux/amd64\n  Current timestamp: 1695552866769\n  VM uptime: 0.008s\n  AOT compiled code: 0x0000000000406000 - 0x0000000000afa67f\n  CPU features used for AOT compiled code: CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA\n\nCommand line:\n\nHeap settings and statistics:\n  Supports isolates: true\n  Heap base: 0x00007f9b4c280000\n  Object reference size: 4\n  Aligned chunk size: 524288\n  Large array threshold: 131072\n  Incremental collections: 0\n  Complete collections: 0\n\nHeap usage:\n  Eden: 0.00M (0.00M in 0 aligned chunks, 0.00M in 0 unaligned chunks)\n  Old: 0.00M (0.00M in 0 aligned chunks, 0.00M in 0 unaligned chunks)\n\nNative image heap boundaries:\n  ReadOnly Primitives: 0x00007f9b4c300830 - 0x00007f9b4c4af5e0\n  ReadOnly References: 0x00007f9b4c4af5e0 - 0x00007f9b4c5c0e28\n  ReadOnly Relocatables: 0x00007f9b4c5c1000 - 0x00007f9b4c62d130\n  Writable Primitives: 0x00007f9b4c62e000 - 0x00007f9b4c6de548\n  Writable References: 0x00007f9b4c6de548 - 0x00007f9b4c817558\n  Writable Huge: 0x0000000000000000 - 0x0000000000000000\n  ReadOnly Huge: 0x00007f9b4c880038 - 0x00007f9b4ca22c50\n\nHeap chunks: E=eden, S=survivor, O=old, F=free; A=aligned chunk, U=unaligned chunk; T=to space\n\nFatal error: Cannot invoke method that has a @CallerSensitiveAdapter without an explicit caller\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flispyclouds%2Fgraalvm21-reflection-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flispyclouds%2Fgraalvm21-reflection-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flispyclouds%2Fgraalvm21-reflection-issue/lists"}