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

AArch64: jaotc generates incorrect code for compressed OOPs with non-zero heap base

XMLWordPrintable

    • b24
    • aarch64
    • linux

        From Andrew Haley:

        ------

        If I then run the AOT-compiled code with -Xmx31G I get:

        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # SIGSEGV (0xb) at pc=0x0000ffffa142bd3c, pid=9965, tid=10174
        #
        # JRE version: (15.0) (slowdebug build )
        # Java VM: OpenJDK 64-Bit Server VM (slowdebug 15-internal+0-adhoc.aph.jdk-tmp, mixed mode, aot, tiered, compressed oops, g1 gc, linux-aarch64)
        # Problematic frame:
        # A 388 java.lang.Thread.setPriority(I)V java.base (56 bytes) @ 0x0000ffffa142bd3c [0x0000ffffa142bac0+0x000000000000027c]

           0x0000ffffa142bd30 <+624>: ldr w1, [x4, #56]
           0x0000ffffa142bd34 <+628>: cbz w1, 0xffffa142bd84 <java.lang.Thread.setPriority(I)V+708>
           0x0000ffffa142bd38 <+632>: lsl x1, x1, #3
           0x0000ffffa142bd3c <+636>: ldr w0, [x1, #12]

        ... so the AOT-compiled code is still trying to use the shift of 3,
        but it is not adding in the base, which is 0x1000000000.

        ------

        jaotc uses the heap base value from the running VM to decide whether to use the heap base register or not. This is wrong as the generated code may later be loaded into a VM with non-zero base.

              ngasson Nick Gasson
              ngasson Nick Gasson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: