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

ZGC: segmentation fault due to missing node type check in barrier elision analysis

XMLWordPrintable

    • b23
    • 21
    • b08

        Running jdk/jfr/api/consumer/streaming/TestFilledChunks.java with ZGC on PPC64 leads to a crash due to a missing node type check in the barrier elision analysis:

        # A fatal error has been detected by the Java Runtime Environment:
        #
        # SIGSEGV (0xb) at pc=0x00001000027ee234, pid=103220, tid=103252
        #
        # JRE version: OpenJDK Runtime Environment (25.0) (fastdebug build 25-internal-2025-01-23-1552158.rocastan.open)
        # Java VM: OpenJDK 64-Bit Server VM (fastdebug 25-internal-2025-01-23-1552158.rocastan.open, mixed mode, tiered, compressed class ptrs, z gc, linux-ppc64le)
        # Problematic frame:
        # V [libjvm.so+0x1bde234] get_base_and_offset(MachNode const*, long&)+0x354
        #

        Stack trace (provided by [~mdoerr]):

        V [libjvm.so+0xa1a3f0] TypePtr::offset() const+0x14 (type.hpp:994)
        V [libjvm.so+0x1d35288] get_base_and_offset(MachNode const*, long&)+0xb0 (zBarrierSetC2.cpp:557)
        V [libjvm.so+0x1d35818] is_allocation(Node const*)+0x108 (zBarrierSetC2.cpp:629)
        V [libjvm.so+0x1d36230] ZBarrierSetC2::analyze_dominating_barriers() const+0x19c (zBarrierSetC2.cpp:759)
        V [libjvm.so+0x1d33ea0] ZBarrierSetC2::late_barrier_analysis() const+0x54 (zBarrierSetC2.cpp:307)
        V [libjvm.so+0x167d36c] PhaseOutput::perform_mach_node_analysis()+0x60 (output.cpp:258)
        V [libjvm.so+0x167dc50] PhaseOutput::Output()+0x890 (output.cpp:346)
        V [libjvm.so+0xa0a57c] Compile::Code_Gen()+0x4e4 (compile.cpp:3030)
        V [libjvm.so+0x9fd51c] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x179c (compile.cpp:884)
        V [libjvm.so+0x80a220] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1f0 (c2compiler.cpp:141)

        The crash has only been observed on PPC64, but there does not seem to be any fundamental reason (other than different addressing mode matching rules) that could prevent it from happening on other platforms.

        Thanks to [~mdoerr] for the original bug report, see more context here: https://github.com/openjdk/jdk/pull/23235.

              mdoerr Martin Doerr
              rcastanedalo Roberto Castaneda Lozano
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: