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

JPDA backend deadlock under stress testing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.0_01
    • Component/s: core-svc
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      01
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Backports

        Description



        Name: dd4877 Date: 11/20/2001


        daniel.daugherty@sun 2001-11-14

        During recent stress testing for my most recent batch of bug fixes, a
        MultiBreakpointsTest java_g run hung on Solaris SPARC.

        This is a classic deadlock in JDWP:

        Thread t@7 owns the "JDWP Thread Lock" and is blocked on the "JDWP
        Invocation Lock" which is owned by thread t@14.

        Thread t@14 owns the "JDWP Invocation Lock" and is blocked on the
        "JDWP Thread Lock" which is owned by thread t@7:


        THREAD t@7

        This thread owns the "JDWP Thread Lock" and is blocked on the "JDWP
        Invocation Lock" which is owned by thread t@14.

        *monitor = {
            JvmdiMonitor::_magic = 1145655885
            JvmdiMonitor::_name = 0xd15a0 "JDWP Invocation Lock"
            JvmdiMonitor::_monitor = {
                ObjectMonitor::_header = (nil)
                ObjectMonitor::_object = (nil)
                ObjectMonitor::_owner = 0x1cf158
                ObjectMonitor::_queue = (nil)
                ObjectMonitor::_count = 0
                ObjectMonitor::_waiters = 0
                ObjectMonitor::_recursions = 0
                ObjectMonitor::_mutex = {
                    OSMutex::_owner = 14U
                    OSMutex::_is_owned = 1
                    OSMutex::_mutex = (
        {
                        _lwp_mutex::flags = {
                            _mutex_flags::flag1 = 0
                            _mutex_flags::flag2 = '\0'
                            _mutex_flags::ceiling = '\0'
                            _mutex_flags::mbcp_type_un = {
                                _mbcp_type_un::bcptype = 0
                                _mbcp_type_un::mtype_rcount = {
                                    _mtype_rcount::count_type1 = '\0'
                                    _mtype_rcount::count_type2 = '\0'
                                }
                            }
                            _mutex_flags::magic = 0
                        }
                        _lwp_mutex::lock = {
                            _mutex_lock_un::lock64 = {
                                _mutex_lock::pad = ""
                            }
                            _mutex_lock_un::owner64 = 4278190081ULL
                        }
                        _lwp_mutex::data = 0
                    }
        )
                }
            }
        }


        t@7(l@8) stopped in ___lwp_mutex_lock at 0xff31b318
        0xff31b318: ___lwp_mutex_lock+0x0008: ta 0x8
        current thread: t@7
          [1] ___lwp_mutex_lock(0x164588, 0x164578, 0x7abc0b, 0x0, 0xff3e0000,
        0xff0610e4), at 0xff31b318
        =>[2] os::Solaris::mutex_lock(mx = 0x164588), line 168 in "os_solaris.hpp"
          [3] os::Solaris::OSMutex::lock(this = 0x164578), line 482 in "os_solaris.hpp"
          [4] ObjectMonitor::raw_enter(this = 0x164558, __the_thread__ = 0xd5e10,
        isRawMonitor = 0), line 401 in "objectMonitor_solaris.cpp"
          [5] RawMonitorEnter(_monitor = 0x164550), line 3075 in "jvmdi.cpp"
          [6] debugMonitorEnter(0x164550, 0xf9a81570, 0xfffffffc, 0x0, 0x0, 0x0), at
        0xfe579d54
          [7] invoker_detach(0x1c8cc0, 0xd5e10, 0x0, 0xff3e0770, 0x17a4c, 0x0), at
        0xfe56bd38
          [8] detachHelper(0xd5eac, 0x1c8c70, 0x0, 0x1, 0xff3e0000, 0xff0610e4), at
        0xfe574ac0
          [9] enumerateOverThreadList(0xd5eac, 0xfe597a70, 0xfe574a88, 0x0, 0xff3e0000,
        0xff0610e4), at 0xfe5712d0
          [10] threadControl_detachInvokes(0x164938, 0xfe5415b0, 0xb7, 0x1, 0xff3e0000,
        0xff0610e4), at 0xfe574b68
          [11] eventHandler_reset(0x1, 0xfe5694c0, 0xd5eac, 0xf9a81810, 0x5b440043,
        0x4c4d756c), at 0xfe563ff0
          [12] debugInit_reset(0x168738, 0xf9a818a4, 0x1645f8, 0x164608, 0x81010100,
        0xff00), at 0xfe5592c0
          [13] debugLoop_run(0x164888, 0x1, 0x4, 0x11, 0xfffffff8, 0xd6390), at
        0xfe55a6a4
          [14] connectionInitiated(0xfe533b5c, 0x6, 0x4, 0xffffffff, 0xfffffff8,
        0xd67b8), at 0xfe575980
          [15] attachThread(0xfe533b5c, 0xd5e10, 0x0, 0xffffffff, 0xfffffff8, 0xd67b8),
        at 0xfe575aac
          [16] DebuggerThread::start_function_wrapper(thread = 0xd5e10, __the_thread__ =
        0xd5e10), line 2584 in "jvmdi.cpp"
          [17] JavaThread::thread_main_inner(this = 0xd5e10), line 1300 in "thread.cpp"
          [18] JavaThread::run(this = 0xd5e10), line 1284 in "thread.cpp"
          [19] _start(data = 0xd5e10), line 536 in "os_solaris.cpp"
        Current function is os::Solaris::cond_wait
          184 static int cond_wait(cond_t *cv, mutex_t *mx) { return _cond_wait(cv,
        mx); }


        THREAD t@14

        This thread owns the "JDWP Invocation Lock" and is blocked on the
        "JDWP Thread Lock" which is owned by thread t@7:

        *monitor = {
            JvmdiMonitor::_magic = 1145655885
            JvmdiMonitor::_name = 0xd14c8 "JDWP Thread Lock"
            JvmdiMonitor::_monitor = {
                ObjectMonitor::_header = (nil)
                ObjectMonitor::_object = (nil)
                ObjectMonitor::_owner = 0xd5e10
                ObjectMonitor::_queue = (nil)
                ObjectMonitor::_count = 0
                ObjectMonitor::_waiters = 0
                ObjectMonitor::_recursions = 0
                ObjectMonitor::_mutex = {
                    OSMutex::_owner = 7U
                    OSMutex::_is_owned = 1
                    OSMutex::_mutex = (
        {
                        _lwp_mutex::flags = {
                            _mutex_flags::flag1 = 0
                            _mutex_flags::flag2 = '\0'
                            _mutex_flags::ceiling = '\0'
                            _mutex_flags::mbcp_type_un = {
                                _mbcp_type_un::bcptype = 0
                                _mbcp_type_un::mtype_rcount = {
                                    _mtype_rcount::count_type1 = '\0'
                                    _mtype_rcount::count_type2 = '\0'
                                }
                            }
                            _mutex_flags::magic = 0
                        }
                        _lwp_mutex::lock = {
                            _mutex_lock_un::lock64 = {
                                _mutex_lock::pad = ""
                            }
                            _mutex_lock_un::owner64 = 4278190081ULL
                        }
                        _lwp_mutex::data = 0
                    }
        )
                }
            }
        }

        t@14(l@15) stopped in ___lwp_mutex_lock at 0xff31b318
        0xff31b318: ___lwp_mutex_lock+0x0008: ta 0x8
        current thread: t@14
          [1] ___lwp_mutex_lock(0x1644d8, 0x1644c8, 0x1c55a8, 0xf1181488, 0x169718,
        0x0), at 0xff31b318
        =>[2] os::Solaris::mutex_lock(mx = 0x1644d8), line 168 in "os_solaris.hpp"
          [3] os::Solaris::OSMutex::lock(this = 0x1644c8), line 482 in "os_solaris.hpp"
          [4] ObjectMonitor::raw_enter(this = 0x1644a8, __the_thread__ = 0x1cf158,
        isRawMonitor = 0), line 401 in "objectMonitor_solaris.cpp"
          [5] RawMonitorEnter(_monitor = 0x1644a0), line 3075 in "jvmdi.cpp"
          [6] debugMonitorEnter(0x1644a0, 0xf11812d4, 0x10002, 0xfffffff8, 0x0,
        0x1c8d49), at 0xfe579d54
          [7] threadControl_getInvokeRequest(0x1c55a8, 0x1, 0x0, 0x4, 0x0, 0x1c8e70), at
        0xfe573a9c
          [8] invoker_doInvoke(0x1c55a8, 0x1c8588, 0x1c55a8, 0x169718, 0xf1803730, 0x0),
        at 0xfe56b47c
          [9] reportEvents(0x1cf1f4, 0x0, 0x1c55a8, 0xf1181488, 0x169718, 0x0), at
        0xfe562fe4
          [10] eventHook(0x1cf1f4, 0xf1181488, 0x8, 0xf9c248d8, 0xf1a00000, 0x0), at
        0xfe563794
          [11] JvmdiInternal::post_event(jvmdi_e = CLASS), line 2110 in "jvmdi.cpp"
          [12] jvmdi::post_breakpoint_event(thread = 0x1cf158, method = 0xf59085b8,
        location = 0xf59085fc "\xca\xff\xc0\xe3"), line 3804 in "jvmdi.cpp"
          [13] InterpreterRuntime::_breakpoint(thread = 0x1cf158, method = 0xf59085b8,
        bcp = 0xf59085fc "\xca\xff\xc0\xe3"), line 664 in "interpreterRuntime.cpp"
          [14] 0xf9c2b668(0xf183f288, 0xf5908f00, 0x1d, 0x3, 0xf1a00000, 0xf11816c0), at
        0xf9c2b667
          [15] 0xf9c06680(0xf1845990, 0x1cf158, 0x8, 0xf9c28498, 0xf1181adc,
        0xf1181760), at 0xf9c0667f
          [16] 0xf9c00528(0xf118184c, 0xf1181b88, 0xa, 0xf5908e70, 0xf9c0d684,
        0xf1181ad0), at 0xf9c00527
          [17] JavaCalls::call_helper(result = 0xf1181b80, m = 0xf1181a08, args =
        0xf1181ac4, __the_thread__ = 0x1cf158), line 368 in "javaCalls.cpp"
          [18] os::os_exception_wrapper(f = 0xfdb474a0 =
        &JavaCalls::call_helper(JavaValue*,methodHandle*,JavaCallArguments*,Thread*),
        value = 0xf1181b80, method = 0xf1181a08, args = 0xf1181ac4, thread = 0x1cf158),
        line 2028 in "os_solaris.cpp"
          [19] JavaCalls::call(result = 0xf1181b80, method = CLASS, args = 0xf1181ac4,
        __the_thread__ = 0x1cf158), line 305 in "javaCalls.cpp"
          [20] JavaCalls::call_virtual(result = 0xf1181b80, spec_klass = CLASS, name =
        CLASS, signature = CLASS, args = 0xf1181ac4, __the_thread__ = 0x1cf158), line
        201 in "javaCalls.cpp"
          [21] JavaCalls::call_virtual(result = 0xf1181b80, receiver = CLASS, spec_klass
        = CLASS, name = CLASS, signature = CLASS, __the_thread__ = 0x1cf158), line 207
        in "javaCalls.cpp"
          [22] thread_entry(thread = 0x1cf158, __the_thread__ = 0x1cf158), line 1734 in
        "jvm.cpp"
          [23] JavaThread::thread_main_inner(this = 0x1cf158), line 1300 in "thread.cpp"
          [24] JavaThread::run(this = 0x1cf158), line 1284 in "thread.cpp"
          [25] _start(data = 0x1cf158), line 536 in "os_solaris.cpp"
        Current function is os::Solaris::mutex_lock
          168 static int mutex_lock(mutex_t *mx) { return _mutex_lock(mx); }

        The output log for the test shows the following unexpected exception:

        FAILED: Exception occured in eventHandler: com.sun.jdi.InternalException: Unexpe
        cted JDWP Error: 13
        com.sun.jdi.InternalException: Unexpected JDWP Error: 13
                at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:50)
                at com.sun.tools.jdi.VirtualMachineImpl.resume(VirtualMachineImpl.java:4
        14)
                at com.sun.tools.jdi.EventSetImpl.resume(EventSetImpl.java:583)
                at TestScaffold.eventSetComplete(TestScaffold.java:86)
                at TestScaffold$EventHandler.run(TestScaffold.java:234)
                at java.lang.Thread.run(Thread.java:539)

        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dcubed Daniel Daugherty
                Reporter:
                dcubed Daniel Daugherty
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: