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

C2: assert(is_valid_AArch64_address(dest.target())) failed: bad address

XMLWordPrintable

    • b26
    • aarch64

        ADDITIONAL SYSTEM INFORMATION :
        MacOS 12 Monterey on M1, OpenJDK 17.0.5, but it's also reproducible on the latest build from the jdk17u project.


        A DESCRIPTION OF THE PROBLEM :
        JVM crash at JIT. Regular build crash on this line: https://github.com/corretto/corretto-17/blob/develop/src/hotspot/cpu/aarch64/assembler_aarch64.hpp#L248 Thus I was assuming it was another manifestation of https://bugs.openjdk.org/browse/JDK-8280476


        I compiled my own slowdebug build, based on jdk17u, revision 120bf27fd1a3916199bb6ff903ba741f913ec4ed
        and it's crashing on an assert even before this. See the attached hs_err files

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Clone https://github.com/questdb/questdb
        2. Run mvn clean test on JDK 17u, on MacOS with M1 CPU

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        no crash
        ACTUAL -
        JVM crash

        FREQUENCY : always


        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/scratch/tohartma/8296924/jdk/open/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:4584), pid=1102669, tid=1102682
        # assert(is_valid_AArch64_address(dest.target())) failed: bad address
        #
        # JRE version: Java(TM) SE Runtime Environment (20.0) (fastdebug build 20-internal-2022-11-16-1350559.tohartma...)
        # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-internal-2022-11-16-1350559.tohartma..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
        # Problematic frame:
        # V [libjvm.so+0x1334210] MacroAssembler::adrp(Register, Address const&, unsigned long&)+0x1b0

        Current CompileTask:
        C2: 2499 186 b 4 io.questdb.griffin.engine.table.LongTreeSet::put (117 bytes)

        Stack: [0x0000fffe23c00000,0x0000fffe23e00000], sp=0x0000fffe23dfa570, free space=2025k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x1334210] MacroAssembler::adrp(Register, Address const&, unsigned long&)+0x1b0 (macroAssembler_aarch64.cpp:4584)
        V [libjvm.so+0x32094c] loadConPNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x22c (aarch64.ad:3384)
        V [libjvm.so+0x151294c] PhaseOutput::scratch_emit_size(Node const*)+0x2f8 (output.cpp:3349)
        V [libjvm.so+0x1509fe4] PhaseOutput::shorten_branches(unsigned int*)+0x2c4 (output.cpp:644)
        V [libjvm.so+0x151ccb8] PhaseOutput::Output()+0xbc8 (output.cpp:445)
        V [libjvm.so+0x99c39c] Compile::Code_Gen()+0x3fc (compile.cpp:3001)
        V [libjvm.so+0x9a07f8] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1284 (compile.cpp:864)
        V [libjvm.so+0x7be468] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1b4 (c2compiler.cpp:113)
        V [libjvm.so+0x9ad1c4] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa14 (compileBroker.cpp:2237)
        V [libjvm.so+0x9ada3c] CompileBroker::compiler_thread_loop()+0x3bc (compileBroker.cpp:1916)
        V [libjvm.so+0xed1c90] JavaThread::thread_main_inner()+0x21c (javaThread.cpp:699)
        V [libjvm.so+0x17e21a8] Thread::call_run()+0xf8 (thread.cpp:224)
        V [libjvm.so+0x14f1ab4] thread_native_entry(Thread*)+0x100 (os_linux.cpp:710)
        C [libpthread.so.0+0x7908] start_thread+0x188


        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (assembler_aarch64.hpp:232), pid=1103668, tid=1103680
        # guarantee(val < (1ULL << nbits)) failed: Field too big for insn

        Current CompileTask:
        C2: 860 57 b Test::test (17 bytes)

        Stack: [0x0000fffeb43f0000,0x0000fffeb45f0000], sp=0x0000fffeb45eb300, free space=2028k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0xc49080] VMError::report_and_die(int, char const*, char const*, std::__va_list, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x138
        V [libjvm.so+0xc49d18] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, std::__va_list)+0x50
        V [libjvm.so+0x5177fc] report_vm_error(char const*, int, char const*, char const*, ...)+0xec
        V [libjvm.so+0x96d204] Assembler::movk(RegisterImpl*, unsigned int, unsigned int)+0xc4
        V [libjvm.so+0x960828] MacroAssembler::adrp(RegisterImpl*, Address const&, unsigned long&)+0xd0
        V [libjvm.so+0x243d44] loadConPNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0xc4
        V [libjvm.so+0x4b0f10] Compile::scratch_emit_size(Node const*)+0x1b8
        V [libjvm.so+0xa63454] Compile::shorten_branches(unsigned int*, int&, int&, int&)+0x234
        V [libjvm.so+0xa668e4] Compile::init_buffer(unsigned int*)+0x17c
        V [libjvm.so+0xa6b480] Compile::Output()+0x358
        V [libjvm.so+0x4babec] Compile::Code_Gen()+0x3bc
        V [libjvm.so+0x4bda5c] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x9fc
        V [libjvm.so+0x3d30dc] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xbc
        V [libjvm.so+0x4c7610] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x2e8
        V [libjvm.so+0x4c8aa8] CompileBroker::compiler_thread_loop()+0x4f0
        V [libjvm.so+0xbe6584] JavaThread::thread_main_inner()+0xdc
        V [libjvm.so+0xbe4294] Thread::call_run()+0x94
        V [libjvm.so+0xa538d4] thread_native_entry(Thread*)+0xec
        C [libpthread.so.0+0x7908] start_thread+0x188

          1. replay.log
            1.32 MB
          2. Test.java
            0.5 kB

              thartmann Tobias Hartmann
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: