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

RISC-V: runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java crash with debug VMs

XMLWordPrintable

    • b05
    • riscv
    • linux

        On the crash site, we are invoking the `SharedRuntime::dsin` C++ routine with `call(address)`.
        After JDK-8343242, `call(address)` won't check the range. It does auipc + jalr and thus expects intra code cache targets which is not satisfied for this case.
        For targets outside of the code cache, we should use the `rt_call` assembler routine which performs necessary check.

        $ make test TEST="runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java"

        ------------------------------------------------
        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/home/ubuntu/jdk/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp:873), pid=487308, tid=487311
        # assert(is_valid_32bit_offset(distance)) failed: Must be
        #
        # JRE version: (25.0) (fastdebug build )
        # Java VM: OpenJDK 64-Bit Server VM (fastdebug 25-internal-adhoc.ubuntu.jdk, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-riscv64)
        # Problematic frame:
        # V [libjvm.so+0xf67536] MacroAssembler::la(Register, unsigned char*, int&) [clone .part.0]+0x1e
        #
        # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/ubuntu/jdk/build/linux-riscv64-
        server-fastdebug/test-support/jtreg_test_hotspot_jtreg_tier3/scratch/1/core.487308)
        #
        #

        --------------- S U M M A R Y ------------

        Command Line: -Xmx1024m -XX:-ZapUnusedHeapArea -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:LogEventsBufferEntries=1048576 optionsvalidation.JVMStartup

        Host: premier-p550, RISCV64, 4 cores, 15G, Ubuntu 24.04.1 LTS
        Time: Thu Dec 26 09:49:48 2024 CST elapsed time: 4.041104 seconds (0d 0h 0m 4s)

        --------------- T H R E A D ---------------

        Current thread (0x00007ffce401d5c0): JavaThread "Unknown thread" [_thread_in_vm, id=487311, stack(0x00007ffce8600000,0x00007ffce8800000) (2048K)]

        Stack: [0x00007ffce8600000,0x00007ffce8800000], sp=0x00007ffce87fc0c0, free space=2032k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0xf67536] MacroAssembler::la(Register, unsigned char*, int&) [clone .part.0]+0x1e (macroAssembler_riscv.cpp:873)
        V [libjvm.so+0xf6e6ae] MacroAssembler::call(unsigned char*, Register)+0x86 (macroAssembler_riscv.cpp:873)
        V [libjvm.so+0x1497e9e] TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind)+0x10a (templateInterpreterGenerator_riscv.cpp:192)
        V [libjvm.so+0x14948c6] TemplateInterpreterGenerator::generate_all()+0x846 (templateInterpreterGenerator.cpp:471)
        V [libjvm.so+0x14922ce] TemplateInterpreter::initialize_code()+0x7c (templateInterpreter.cpp:67)
        V [libjvm.so+0xb53d3a] interpreter_init_code()+0x12 (interpreter.cpp:142)
        V [libjvm.so+0xb1dfde] init_globals2()+0x18 (init.cpp:164)
        V [libjvm.so+0x14e6846] Threads::create_vm(JavaVMInitArgs*, bool*)+0x34a (threads.cpp:593)
        V [libjvm.so+0xc75bcc] JNI_CreateJavaVM+0x68 (jni.cpp:3589)
        C [libjli.so+0x34fc] JavaMain+0x76 (java.c:1495)
        C [libjli.so+0x629c] ThreadJavaMain+0xc (java_md.c:649)
        C [libc.so.6+0x710f4]
        ------------------------------------------------

              fyang Fei Yang
              fyang Fei Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: