Skip to content

2.12.12: Regression in HashSet/HasMap with graal native-image #12084

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

Open
dieu opened this issue Jul 16, 2020 · 5 comments
Open

2.12.12: Regression in HashSet/HasMap with graal native-image #12084

dieu opened this issue Jul 16, 2020 · 5 comments
Labels
Milestone

Comments

@dieu
Copy link

dieu commented Jul 16, 2020

reproduction steps

Using the latest 2.12.12 release with graal native-image is throws error in runtime.

problem

The problem with the usage of MethodHandler in https://github.com/scala/scala/blob/2.12.x/src/library/scala/collection/immutable/VM.java#L24

parameters to used: --no-server --allow-incomplete-classpath --no-fallback --report-unsupported-elements-at-runtime --initialize-at-build-time=scala

Exception in thread "main" com.oracle.svm.core.jdk.UnsupportedFeatureError: Invoke with MethodHandle argument could not be reduced to at most a single call or single field access. The method handle must be a compile time constant, e.g., be loaded from a `static final` field. Method that contains the method handle invocation: java.lang.invoke.LambdaForm$MH/1405562130.invoke_MT(Object, Object)
	at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:86)
	at scala.collection.immutable.VM.releaseFence(VM.java:25)
	at scala.collection.immutable.HashSet$HashSetBuilder.result(HashSet.scala:1283)
	at scala.collection.immutable.Set$SetBuilderImpl.result(Set.scala:344)
	at scala.collection.immutable.Set$SetBuilderImpl.result(Set.scala:329)
	at scala.collection.generic.GenericCompanion.apply(GenericCompanion.scala:57)
@dieu dieu changed the title 2.12.12: Regression in 2.12.12: Regression in HashSet/HasMap with graal native-image Jul 16, 2020
@dieu
Copy link
Author

dieu commented Jul 17, 2020

similar substitution for scala.collection.immutable.VM as here: plokhotnyuk/jsoniter-scala@e089f06 -- works as well as a workaround for 2.12.12

@dwijnand
Copy link
Member

Hi. What version of GraalVM and for what Java 8 or Java 11?

@dieu
Copy link
Author

dieu commented Jul 17, 2020 via email

@SethTisue SethTisue added this to the 2.12.13 milestone Jul 17, 2020
@SethTisue SethTisue modified the milestones: 2.12.13, Backlog Oct 19, 2020
@SethTisue
Copy link
Member

as with #12116, this may progress on the Graal side: #12116 (comment)

@SethTisue
Copy link
Member

and workarounds and knowhow are accumulating at https://github.com/scalameta/sbt-native-image

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

No branches or pull requests

3 participants