Skip to content
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

Support IntStream #503

Open
aoli-al opened this issue Nov 1, 2024 · 1 comment
Open

Support IntStream #503

aoli-al opened this issue Nov 1, 2024 · 1 comment

Comments

@aoli-al
Copy link
Contributor

aoli-al commented Nov 1, 2024

I'm using JPF to analyze the following program but failed

        AtomicInteger x = new AtomicInteger();
        IntStream.range(1, 10).parallel().forEach((i) -> x.compareAndSet(i-1, i+1));

Exceptions:

gov.nasa.jpf.vm.NoUncaughtExceptionsProperty
java.lang.UnsatisfiedLinkError: cannot find native java.lang.invoke.MethodHandleNatives.registerNatives
        at java.lang.invoke.MethodHandleNatives.registerNatives(no peer)
        at java.lang.invoke.MethodHandleNatives.<clinit>(MethodHandleNatives.java:101)
        at java.lang.invoke.MemberName.<init>(MemberName.java:578)
        at java.lang.invoke.MemberName.<init>(MemberName.java:572)
        at java.lang.invoke.VarForm.linkFromStatic(VarForm.java:135)
        at java.lang.invoke.VarForm.<init>(VarForm.java:50)
        at java.lang.invoke.VarHandleObjects$Array.<clinit>(VarHandleObjects.java:575)
        at java.lang.invoke.VarHandles.makeArrayElementHandle(VarHandles.java:158)
        at java.lang.invoke.MethodHandles.arrayElementVarHandle(MethodHandles.java:2691)
        at java.util.concurrent.ForkJoinPool.<clinit>(ForkJoinPool.java:3177)
        at java.util.stream.AbstractTask.<clinit>(AbstractTask.java:92)
        at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:282)
        at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:408)
        at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:736)
        at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)
        at java.util.stream.ForEachOps$ForEachOp$OfInt.evaluateParallel(ForEachOps.java:188)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
        at java.util.stream.IntPipeline.forEach(IntPipeline.java:439)
        at java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:596)

Is there an easy fix to support this?

@cyrille-artho
Copy link
Member

This is probably not so easy to fix. We would have to see how to deal with these dependencies on native code among packages java.util.stream, java.util.concurrent, and java.lang.invoke.

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

No branches or pull requests

2 participants