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

SIGSEGV in get_current_contended_monitor

    XMLWordPrintable

Details

    • svc
    • b25

    Backports

      Description

        In ThreadService::get_current_contended_monitor, "wait_obj" or "enter_obj" can be observed to be NULL after NULL check due to concurrent modification. These two variables and the memory locations from which they were read from are not declared volatile, so C++ compilers are allowed to generate code which reloads them from memory after the NULL checks.

        Crashes with SIGSEGV were observed on s390 when running the test serviceability/monitoring/ThreadInfo/GetLockOwnerName/GetLockOwnerName.java since May 15. The problem is reproducible with fastdebug build, but not with slowdebug.

        # SIGSEGV (0xb) at pc=0x000003ff98f1ce46, pid=48257, tid=48285
        #
        # JRE version: OpenJDK Runtime Environment (17.0.0.1) (fastdebug build 17.0.0.1-internal+0-adhoc.openjdk.jdk-dev)
        # Java VM: OpenJDK 64-Bit Server VM (fastdebug 17.0.0.1-internal+0-adhoc.openjdk.jdk-dev, mixed mode, sharing, tiered, compressed oops, co
        mpressed class ptrs, g1 gc, linux-s390x)
        # Problematic frame:
        # V [libjvm.so+0xf1ce46] ObjectMonitor::object() const+0x156

        Stack from gdb with line numbers:
        #7 <signal handler called>
        #8 ObjectMonitor::object (this=0x0) at /openjdk/nb/linuxs390x/jdk-dev/src/hotspot/share/oops/weakHandle.hpp:56
        #9 0x000003ff9921fd68 in ThreadService::get_current_contended_monitor (thread=thread@entry=0x3ff300aa720)
            at /openjdk/nb/linuxs390x/jdk-dev/src/hotspot/share/services/threadService.cpp:242
        #10 0x000003ff992224f6 in ThreadSnapshot::initialize (this=this@entry=0x3ff300ae380, t_list=<optimized out>,
            thread=thread@entry=0x3ff300aa720)
            at /openjdk/nb/linuxs390x/jdk-dev/src/hotspot/share/services/threadService.cpp:885
        #11 0x000003ff99222e60 in ThreadDumpResult::add_thread_snapshot (this=this@entry=0x3ff69d7d5b0, thread=0x3ff300aa720)
            at /openjdk/nb/linuxs390x/jdk-dev/src/hotspot/share/runtime/threadSMR.hpp:279
        #12 0x000003ff98dfc360 in jmm_GetThreadInfo (env=<optimized out>, ids=<optimized out>, maxDepth=<optimized out>,
            infoArray=<optimized out>) at /openjdk/nb/linuxs390x/jdk-dev/src/hotspot/share/services/management.cpp:1106

        Attachments

          Issue Links

            Activity

              People

                mdoerr Martin Doerr
                mdoerr Martin Doerr
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: