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

Zero: VM should know it runs in interpreter-only mode

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b23

      Backports

        Description

        There are many tests in tier1 that fail with Zero, because they supply -XX:+TieredCompilation, and that makes VM code believe it runs in "mixed" mode.

        Can be reproduced trivially by running anything with -XX:+TieredCompilation. Then Zero fails when runtime asks it to produce a native wrapper for MH intrinsics. That code is normally protected by Arguments::is_interpreter_only.

        Method* SystemDictionary::find_method_handle_intrinsic(vmIntrinsics::ID iid,
                                                               Symbol* signature,
                                                               TRAPS) {
            ...
            if (!Arguments::is_interpreter_only()) { // <--- checks here
              // Generate a compiled form of the MH intrinsic.
              AdapterHandlerLibrary::create_native_wrapper(m); // <--- fails through here
            }

        ...

        sharedRuntime_zero.cpp:

        nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
                                                        const methodHandle& method,
                                                        int compile_id,
                                                        BasicType *sig_bt,
                                                        VMRegPair *regs,
                                                        BasicType ret_type,
                                                        address critical_entry) {
          ShouldNotCallThis(); // <--- crashes here
          return NULL;
        }

        $ build/linux-x86_64-zero-fastdebug/images/jdk/bin/java -XX:+TieredCompilation
        OpenJDK 64-Bit Zero VM warning: -XX:+TieredCompilation not supported in this VM
        # To suppress the following error report, specify this argument
        # after -XX: or in .hotspotrc: SuppressErrorAt=/sharedRuntime_zero.cpp:80
        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/home/shade/trunks/jdk/src/hotspot/cpu/zero/sharedRuntime_zero.cpp:80), pid=404967, tid=404968
        # Error: ShouldNotCall()
        #
        # JRE version: OpenJDK Runtime Environment (16.0) (fastdebug build 16-internal+0-adhoc.shade.jdk)
        # Java VM: OpenJDK 64-Bit Zero VM (fastdebug 16-internal+0-adhoc.shade.jdk, mixed mode, serial gc, linux-amd64)
        # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/shade/trunks/jdk/core.404967)
        #
        # An error report file with more information is saved as:
        # /home/shade/trunks/jdk/hs_err_pid404967.log
        #
        # If you would like to submit a bug report, please visit:
        # https://bugreport.java.com/bugreport/crash.jsp
        #

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                shade Aleksey Shipilev
                Reporter:
                shade Aleksey Shipilev
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: