Graal: Unsupported regular expression /^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9])/u: TRegex: negative lookahead assertions not supported; Joni: unicode mode not supported

Created on 29 Feb 2020  路  8Comments  路  Source: oracle/graal

Describe GraalVM and your environment :

  • GraalVM version or commit id if built from source: 20.0
  • CE or EE: CE
  • JDK version: JDK11
  • OS and OS Version: macOS Catalina 10.15.2
  • Architecture: amd64
  • The output of java -Xinternalversion:
OpenJDK 64-Bit Server VM (11.0.6+9-jvmci-20.0-b02) for bsd-amd64 JRE (11.0.6+9-jvmci-20.0-b02), built on Jan 20 2020 14:32:51 by "graal1" with gcc 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)

See: https://github.com/eslint/eslint/commit/5018378131fd5190bbccca902c0cf4276ee1581a
A February 21, 2019 eslint update causes problems on GraalJS. It's idiosyncratic that it's a particular regex:

https://github.com/eslint/eslint/blob/c615eae0be3c6c167c6f77ec7a73e7adca0ecef0/lib/rules/utils/ast-utils.js#L41

Code snippet or code repository that reproduces the issue

js -e '/^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9])/u'

Steps to reproduce the issue

  1. Run js -e '/^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9])/u' in your terminal on any platform with the latest Graal.

Expected behavior
Support a workaround that does not require forking all of the node ecosystem. My suggestion is an environment variable (e.g. JS_IGNORE_JONI_UNICODE_FLAG_ERROR) with a corresponding --js.ignore-joni-unicode-flag-error).

truffle

Most helpful comment

The issue has been resolved in the TRegex engine itself. Graal.js has not updated this engine yet (still using an older version). This should be resolved by the end of the week. Ultimately, the fix will land in GraalVM 20.1.0.

All 8 comments

@djoooooe can you please have a look into this.

I tried just checking out graal and building a fix myself, but I got stuck bootstrapping Graal with Graal 11 here:

RuntimeError: Error starting javac-daemon: returncode=255
Exception during JVMCI compiler initialization:
Exception in thread "main": jdk.vm.ci.common.JVMCIError
jdk.vm.ci.common.JVMCIError: java.lang.ClassNotFoundException: org.graalvm.word.WordBase
    at jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.createClass(HotSpotJVMCIRuntime.java:503)

A fix for this issue is about to be merged, I will post here as soon as the fix is available.

@djoooooe Fixed? Can this be closed?

The issue has been resolved in the TRegex engine itself. Graal.js has not updated this engine yet (still using an older version). This should be resolved by the end of the week. Ultimately, the fix will land in GraalVM 20.1.0.

That's great, I'd be happy to keep testing my node work with nightlies, but I am having trouble finding them or a compilation guide for macOS.

Was this page helpful?
0 / 5 - 0 ratings