Unexpected number of values in state to merge error when compiling Truffle language to native · Issue #3448 · oracle/graal · GitHub
Skip to content

Unexpected number of values in state to merge error when compiling Truffle language to native #3448

Closed

Description

@borkdude

Describe the issue
I'm trying to compile the "make a lisp" java-truffle example to native.

The repo: https://github.com/kanaka/mal/tree/master/impls/java-truffle

The script:

#!/bin/bash

make all

CP=$(gradle -q --console plain printClasspath)

$GRAALVM_HOME/bin/native-image \
    --no-server \
    --no-fallback \
    --macro:truffle \
    --initialize-at-build-time \
    -classpath $CP \
    truffle.mal.${STEP:-stepE_macros} "$@"

Steps to reproduce the issue
Please include both build steps as well as run steps

  1. Clone the repo
  2. Run the above script

Describe GraalVM and your environment:

  • GraalVM version 21.1.0 (note: to use 21.1.0 you have to update the versions of libraries in gradle.build accordingly)
  • JDK major version: 11
  • OS: macOS Mojave
  • Architecture: amd64

More details

Output:

$ ./native
gradle build

> Configure project :
/private/tmp/mal/impls/java-truffle/build/classes/java/main:/private/tmp/mal/impls/java-truffle/build/resources/main:/Users/borkdude/.m2/repository/org/graalvm/truffle/truffle-api/21.1.0/truffle-api-21.1.0.jar:/Users/borkdude/.gradle/caches/modules-2/files-2.1/org.organicdesign/Paguro/3.2.0/c437a15a2eb0a1f3efbdbf995c7ee8c988201963/Paguro-3.2.0.jar:/Users/borkdude/.m2/repository/org/graalvm/sdk/graal-sdk/21.1.0/graal-sdk-21.1.0.jar

> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

BUILD SUCCESSFUL in 4s
2 actionable tasks: 2 executed
[truffle.mal.stepe_macros:38209]    classlist:     853.39 ms,  0.96 GB
[truffle.mal.stepe_macros:38209]        (cap):     936.44 ms,  0.96 GB
[truffle.mal.stepe_macros:38209]        setup:   2,268.14 ms,  0.96 GB
[truffle.mal.stepe_macros:38209]     (clinit):     468.59 ms,  3.20 GB
[truffle.mal.stepe_macros:38209]   (typeflow):   8,444.53 ms,  3.20 GB
[truffle.mal.stepe_macros:38209]    (objects):  14,876.74 ms,  3.20 GB
[truffle.mal.stepe_macros:38209]   (features):   8,625.51 ms,  3.20 GB
[truffle.mal.stepe_macros:38209]     analysis:  33,304.50 ms,  3.20 GB
[truffle.mal.stepe_macros:38209]     universe:     867.86 ms,  3.20 GB
19216 method(s) included for runtime compilation
Fatal error:com.oracle.svm.core.util.VMError$HostedError: Unexpected number of values in state to merge.
DeoptSourceFrameInfo: locals-13, stack-2, locks-1.
Merge FrameState: locals-13, stack-0, locks-1.

	at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:68)
	at com.oracle.svm.hosted.code.CompilationInfoSupport$DeoptSourceFrameInfo.mergeStateInfo(CompilationInfoSupport.java:101)
	at com.oracle.svm.hosted.code.CompilationInfoSupport.lambda$registerDeoptEntry$2(CompilationInfoSupport.java:164)
	at java.base/java.util.HashMap.compute(HashMap.java:1228)
	at com.oracle.svm.hosted.code.CompilationInfoSupport.registerDeoptEntry(CompilationInfoSupport.java:164)
	at com.oracle.svm.graal.hosted.GraalFeature.registerDeoptEntries(GraalFeature.java:756)
	at com.oracle.svm.graal.hosted.GraalFeature.beforeCompilation(GraalFeature.java:712)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$doRun$8(NativeImageGenerator.java:644)
	at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:71)
	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:644)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$2(NativeImageGenerator.java:495)
	at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Error: Image build request failed with exit status 1

Activity

  1. oubidar-Abderrahim commented on Jun 4, 2021

    @oubidar-Abderrahim
    Member

    Tracked internally at GR-31878

  2. self-assigned this
    on Jun 16, 2021
  3. teshull commented on Jun 16, 2021

    @teshull
    Member

    I was able to recreate the problem and a fix should be merged to master soon for this specific error (not the blacklisted method issues which are addressed in kanaka/mal#572)

  4. teshull commented on Jun 22, 2021

    @teshull
    Member

    Fixed with 506dc2f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions