You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue could be reproduced with graalvm-jdk-21.0.1+12.1 on MacOS M1 system (Darwin mbp-de-xxx.home 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64).
It seems to be a regression because using a JDK 17, code compiles fine (and all other GraalVM distributions at least since 19.x)
Creating a shared library, it looks like we cannot anymore capture a CCharPointer inside a lambda.
When compiling we get the error from native image:
========================================================================================================================
GraalVM Native Image: Generating 'graalvm-lambda-issue' (shared library)...
========================================================================================================================
[1/8] Initializing... (7,8s @ 0,11GB)
Java version: 21.0.1+12, vendor version: Oracle GraalVM 21.0.1+12.1
Graal compiler: optimization level: 2, target machine: armv8-a, PGO: off
C compiler: cc (apple, arm64, 15.0.0)
Garbage collector: Serial GC (max heap size: 80% of RAM)
1 user-specific feature(s):
- com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
Build resources:
- 12,09GB of memory (75,6% of 16,00GB system memory, determined at start)
- 8 thread(s) (100,0% of 8 available processor(s), determined at start)
[2/8] Performing analysis... [] (0,8s @ 0,18GB)
834 reachable types (45,1% of 1 850 total)
393 reachable fields (23,8% of 1 653 total)
2 080 reachable methods (32,4% of 6 420 total)
259 types, 0 fields, and 110 methods registered for reflection
Error: Expected Object but got Word forcall argumentin org.example.MyLib.hello(MyLib.java:19). One possible cause forthis error is when word values are passed into lambdas as parameters or from variablesin an enclosing scope, which is not supported, but can be solved by instead using explicit classes (including anonymous classes).
------------------------------------------------------------------------------------------------------------------------
0,2s (2,1% of total time) in 13 GCs | Peak RSS: 0,53GB | CPU load: 1,46
========================================================================================================================
Error: Expected Object but got Word for call argument in LibPrimary.mul(LibPrimary.kt). One possible cause for this error is when word values are passed into lambdas as parameters or from variables in an enclosing scope, which is not supported, but can be solved by instead using explicit classes (including anonymous classes).
but my EntryPoint write by kotlin, and i failed to package my simple project to native-image library, i have try GraalVM JDK 19, without lambadas desc, then i change to the JDK21, got the same error.
Hi,
This issue could be reproduced with
graalvm-jdk-21.0.1+12.1
on MacOS M1 system (Darwin mbp-de-xxx.home 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64
).It seems to be a regression because using a JDK 17, code compiles fine (and all other GraalVM distributions at least since 19.x)
Creating a shared library, it looks like we cannot anymore capture a CCharPointer inside a lambda.
When compiling we get the error from native image:
A simple test case could be found in this repository: https://github.com/geofjamg/graalvm-lambda-issue
To get the error just run:
The text was updated successfully, but these errors were encountered: