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

Call cache flush after generating trampoline.

    Details

    • Subcomponent:
    • Resolved In Build:
      b25
    • CPU:
      aarch64
    • OS:
      linux

      Backports

        Description

        The JVM crashes frequently when running graal "CTW" task with jdk11u. It throws an "Illegal Instruction" exception:

            12:28:33 #
            12:28:33 # A fatal error has been detected by the Java Runtime Environment:
            12:28:33 #
            12:28:33 # SIGILL (0x4) at pc=0x0000000800001ac8, pid=11787, tid=11788
            12:28:33 #
            12:28:33 # JRE version: OpenJDK Runtime Environment (11.0.4+11) (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
            12:28:33 # Java VM: OpenJDK 64-Bit Server VM (11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing, tiered, jvmci, compressed oops, g1 gc, linux-aarch64)
            12:28:33 # Problematic frame:
            12:28:33 # C 0x0000000800001ac8
            12:28:33 #
            12:28:33 # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/ent-user/ci- scripts/core.11787)
            12:28:33 #
            12:28:33 # An error report file with more information is saved as:
            12:28:33 # /home/ent-user/ci-scripts/hs_err_pid11787.log

        This is the illegal instruction at 0x0000000800001ac8:
            800001ac8 mov x8, #0x9f0 // #2544
            800001acc movk x8, #0x7c41, lsl #16
            800001ad0 movk x8, #0xffff, lsl #32
            800001ad4 br x8

        And this is part of the dynamic libraries:
            800000000-800002000 rwxp 00001000 08:01 126944208 /home/xiagon01/code/graal/compiler/mxbuild/linux-aarch64/graaljdks/jdk11-cmp/lib/server/classes.jsa

        The illegal instructions are in the CDS CODE section (trampoline), which means the target is a shared method in the CDS archive. And the issue happens at trampoline when it jumps to the real entry of the target.

        Codes in hotspot shows that after the CDS archive is loaded to generate the trampolines for shared methods, it doesn't flush the cache which will invalidate the ICache. This is important on AArch64 because existing CPUs don't have a coherent icache. So an instruction fetch could read old data without this.

        The whole log (hs_err_pid30916.log) is also attached here.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  xgong Xiaohong Gong
                  Reporter:
                  xgong Xiaohong Gong
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: