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

Incompatibility between GraalVM 21.0.5+9.1 and Truffle/Polyglot version 24.0.2 #9992

Open
mikehearn opened this issue Oct 30, 2024 · 3 comments
Assignees
Labels

Comments

@mikehearn
Copy link
Contributor

mikehearn commented Oct 30, 2024

⚠️ NOTICE: Incompatibility between Truffle and GraalVM ⚠️

There is a regression between GraalVM build 21.0.4+8.1 and GraalVM build 21.0.5+9.1 that causes JVM crashes (aborts) when used with Truffle/Polyglot versions 24.0.x due to a mistake during back porting. The error message you get is:

ERROR: com.oracle.truffle.runtime.hotspot.libgraal.TruffleFromLibGraalEntryPoints.onFailure(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;ZZIJ)V: Expected 7 parameters, got 6

Because this is a very low level crash that happens in very restricted/sensitive code:

  • There is no exception thrown, the JVM just immediately terminates with exit code 99.
  • There is no crash log generated or written to disk.

This may surface in tests that use Gradle as the following error:

Failure while communicating with forked test JVM; process has terminated unexpectedly with exit value 99

This bug cannot be fixed as the incompatible versions are now in the wild, but I'm filing it in the hope that people can find it if they encounter the relevant error message.

The fix is to upgrade the Truffle language dependencies, e.g. to org.graalvm.polyglot:{js,polyglot}:24.1.1 or higher.

@oubidar-Abderrahim
Copy link
Member

Hi, I tested using a simple hello world polyglot example and was able to run it without errors. Can you share a reproducer to this issue?

@oubidar-Abderrahim oubidar-Abderrahim self-assigned this Nov 1, 2024
@chumer
Copy link
Member

chumer commented Nov 1, 2024

Here is my analysis:

  1. What is the problem?
    The problem is that we the new compiler version 23.1.5 (or GraalVM JDK 21.0.5) was calling a method in the Truffle runtime with the same name but different signature.
    That method did not exist in 23.1.4 and 24.0.x. Since the method had the same name, the method did not show up as not found but it just pushed invalid values on the stack.
    The invalid value on the stack causes the crash.

  2. When does the problem occur?
    The Problem is limited to using GraalVM for JDK 21.0.5 with polyglot 24.0.x. The problem would also occur with 23.1.4 polyglot, but the version check triggers here to prevent a crash.
    It is not a problem for any version on master or 24.1. The problem occurs when a compilation fails. Unfortunately this can also happen in regular compilations due to expected temporary bailouts of the compiler.
    So the scope of the error is unfortunately not reduced.

  3. What is the recommended workaround?
    The recommended workaround ist to upgrade to polyglot from 24.0.x to 24.1.x. 24.0.x is no longer supported anyway.

@chumer
Copy link
Member

chumer commented Nov 1, 2024

We will implement a fix for the problem by changing the signature back to the old version. So GraalVM for JDK 21.0.6 will again work with 24.0.x.

@oubidar-Abderrahim oubidar-Abderrahim removed their assignment Nov 4, 2024
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

4 participants