Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8345296

AArch64: VM crashes with SIGILL when prctl is disallowed

XMLWordPrintable

    • b27

        We have caught this in some prod environments, where prctl is forbidden by the sandboxing mechanism. This fails the JVM, because we have the following code to check for SVE vector length:

        int VM_Version::get_current_sve_vector_length() {
          assert(VM_Version::supports_sve(), "should not call this");
          return prctl(PR_SVE_GET_VL);
        }

        That code returns `-1` when `prctl` is disallowed, which JVM then blindly interprets as vector length:

          if (UseSVE > 0) {
            _initial_sve_vector_length = get_current_sve_vector_length();
          }

        This incorrect vector length would then be fed into AArch64 assembler, eventually leading to emitting illegal instructions, and thus getting a SIGILL when executing that incorrectly generated code. With modern JDKs, this reliably happens on JVM startup.

        Workaround: -XX:UseSVE=0

              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: