-
Notifications
You must be signed in to change notification settings - Fork 194
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
Graal js 22.3.1 broken on armhf big-endian platform #714
Comments
The issue with garbled exception messages was introduced in Version 22.1.0. That's the release that moved the internal string representation to the new TruffleString type. It appears Release 22.0.0 works correctly. We are still working through regression tests to confirm all is well with that release. |
Hi, Thank you for sharing this, We currently do not support Linux armhf arm32, the currently supported platforms for GraalVM are:
|
True, but it worked fine up until the recent releases. I believe the issue affects big endian platforms in general. I imagine that will be a problem for users running on AArch64 which is becoming increasing popular in cloud environments. |
could you please share a small reproducer that we can test with and verify this issue? Thanks |
I believe I'm hitting the same issue when trying to run graaljs in an OpenJ9 JVM. Versions 22.1.0 through 22.3.2 produce unexpected results when manipulating strings.
FWIW, I did a git bisect between |
IBM Semeru has disabled compact strings by default. There was a bug in |
Ah, so it's in fact unrelated to the original report. Thank you for the explanation, I appreciate it. |
I am not aware of the backport. So, probably not. Honestly, while I understand that it is an ugly bug when you hit it, it is quite a corner case. All the distributions that we provide have compact strings enabled and I don't see a reason to disabled them. Who would want their strings to consume more memory? I wonder why the JDK from IBM have them disabled by default. |
We have a Java application running on an embedded Linux armhf platform that uses GraalJS on a stock JDK (Liberica Standard JDK 17.0.6+10 arm 32 for Linux). We had been using the 21.2.0 release without issues, but decided to upgrade to 22.3.1 since we recently upgrade from Java 8 to Java 17.
Following the upgrade we found that our JS scripts/modules are now failing without providing any useful diagnostics. In particular we have been seeing the following error. The same application and JS scripts/modules run perfectly on Windows 10 and Ubuntu 20 machines with 64-bit Intel processors.
While troubleshooting the problem we also found that GraalJS exception messages are garbled and contain what look to be Chinese characters. After a bit of debugging it appears that the problem is due to a byte ordering problem since reversing the order of each byte pair in the debugger results in ASCII text.
The garbled message problem is readily reproduced using the following snippet of code that intentionally triggers a coercion error:
Here is the message produced on the armhf platform:
java.lang.ClassCastException: Cannot convert '牁慲䉹晵敦筲'(language: JavaScript, type: ArrayBuffer) to Java type 'java.lang.String' using Value.asString(): Invalid coercion. You can ensure that the value can be converted using Value.isString().
And the expected error message on Windows 10:
java.lang.ClassCastException: Cannot convert 'ArrayBuffer{}'(language: JavaScript, type: ArrayBuffer) to Java type 'java.lang.String' using Value.asString(): Invalid coercion. You can ensure that the value can be converted using Value.isString().
We are still investigating the source of the NoClassDefFoundError exception, but believe it is likely related to the apparent byte ordering problem that is causing the garbled exception messages.
The text was updated successfully, but these errors were encountered: