United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4372740 debuggee on a dual processor hangs
JDK-4372740 : debuggee on a dual processor hangs

Details
Type:
Bug
Submit Date:
2000-09-20
Status:
Closed
Updated Date:
2001-03-19
Project Name:
JDK
Resolved Date:
2001-03-19
Component:
core-svc
OS:
generic
Sub-Component:
debugger
CPU:
generic
Priority:
P4
Resolution:
Cannot Reproduce
Affected Versions:
1.3.0
Fixed Versions:

Related Reports

Sub Tasks

Description

Name: tb29552			Date: 09/20/2000


I think I've found a problem with JPDA on a Windows NT dual
processor. If I run the debuggee on a dual processor, then
often (not every time, but at least 1 of every 3 times), the
debugger hangs in the middle of a EventQueue.remove() call.

Note that it doesn't seem to matter whether I run the debugger
on a single or multi-processor. But, the debuggee running on
a multi-processor seems to cause the problem.

I've attached a sample debuggee and debugger so that hopefully
you can reproduce the problem for yourselves.

The debuggee I'm using is a little calculator. It has an AWT
Frame with a bunch of buttons.

The debugger is really simple: it attaches, request class
prepare events, and then loops through the events.

I'm using JDK1.3. When I do java -classic -version, it says:
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Classic VM (build 1.3.0-C, native threads, nojit)

======================================================================
tim.bell@Eng 2000-09-20


The debugee process (a class called Calculator) looks like
this.  If I'm reading this correctly, it is in the process
of sending across a class prepare event:

[D:/pub/tmpjava/Oracle] cat calc.sh 
java -classic -showversion -Xrunjdwp:transport=dt_socket,server=y,address=4000 -Xdebug -Xnoagent -Djava.compiler=NONE -classpath "${JAVA_HOME}/lib/tools.jar;." Calculator

[D:/pub/tmpjava/Oracle] sh < calc.sh
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Classic VM (build 1.3.0-C, native threads, nojit)


Full thread dump Classic VM (1.3.0-C, native threads):
    "AWT-EventQueue-0" (TID:0x15a33c0, sys_thread_t:0x7d5d50, state:S, native ID:0xc6) prio=6
        at java.awt.EventQueue.getNextEvent(EventQueue.java:240)
        at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
    "JDWP Command Reader" (TID:0x158e880, sys_thread_t:0x794a70, state:R, native ID:0xc5) prio=5
    "JDWP Event Helper Thread" (TID:0x158e710, sys_thread_t:0x794cc0, state:R, native ID:0xcc) prio=5
    "JDWP Transport Listener: dt_socket" (TID:0x158e488, sys_thread_t:0x794f90, state:CW, native ID:0xb0) prio=5
    "Finalizer" (TID:0x1589528, sys_thread_t:0x77be40, state:CW, native ID:0x9b) prio=8
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162)
    "Reference Handler" (TID:0x1589300, sys_thread_t:0x7792e0, state:CW, native ID:0xb5) prio=10
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:420)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)
    "Signal dispatcher" (TID:0x1589330, sys_thread_t:0x779b50, state:R, native ID:0xc1) prio=5
    "main" (TID:0x15891a0, sys_thread_t:0x761d30, state:CW, native ID:0xd1) prio=5
        at sun.awt.SunToolkit.<init>(SunToolkit.java:56)
        at sun.awt.windows.WToolkit.<init>(WToolkit.java:134)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:237)
        at java.awt.Toolkit$2.run(Toolkit.java:510)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:489)
        at sun.awt.GlobalCursorManager$CursorEvent.<init>(GlobalCursorManager.java:28)
        at sun.awt.GlobalCursorManager.<clinit>(GlobalCursorManager.java:65)
        at java.awt.Cursor.initIDs(Native Method)
        at java.awt.Cursor.<clinit>(Cursor.java:171)
        at java.awt.Window.<init>(Window.java:182)
        at java.awt.Frame.<init>(Frame.java:315)
        at java.awt.Frame.<init>(Frame.java:294)
        at Calculator.<init>(Calculator.java:51)
        at Calculator.main(Calculator.java:504)
Monitor Cache Dump:
    java.lang.ref.ReferenceQueue$Lock@1589540/15BF7A8: <unowned>
        Waiting to be notified:
            "Finalizer" (0x77be40)
    java.lang.Class@1591698/1602630: owner "main" (0x761d30) 1 entry
    java.lang.ref.Reference$Lock@1589310/15BF2B0: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
        Waiting to be notified:
            "Reference Handler" (0x7792e0)
    java.awt.EventQueue@15A3100/16646C8: owner "AWT-EventQueue-0" (0x7d5d50) 1 entry
    java.lang.Class@15A32F8/1664A98: owner "main" (0x761d30) 1 entry
Registered Monitor Dump:
    JDWP Command Queue Lock: <unowned>
        Waiting to be notified:
            "JDWP Transport Listener: dt_socket" (0x794f90)
    JDWP Event Helper Completion Monitor: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
        Waiting to be notified:
            "main" (0x761d30)
    JDWP Event Helper Queue Monitor: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
    JDWP Event Handler Lock: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry

    JDWP Transport Send Monitor: <unowned>
    JDWP Transport Listener Monitor: <unowned>
    JDWP Initialization Monitor: <unowned>
    JDWP Invocation Lock: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
    JDWP Step Handler Lock: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
    JDWP Thread Lock: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
    JDWP Reference Table Monitor: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
    JDWP Alloc Lock: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class linking lock: <unowned>
    System class loader lock: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
    Code rewrite lock: <unowned>
    Heap lock: owner "JDWP Event Helper Thread" (0x794cc0) 1 entry
    Monitor cache lock: owner "Signal dispatcher" (0x779b50) 1 entry
    Thread queue lock: owner "Signal dispatcher" (0x779b50) 1 entry
    Monitor registry: owner "Signal dispatcher" (0x779b50) 1 entry





The debugger process is down inside
com.sun.tools.jdi.EventQueueImpl.remove().  This thread dump
looks incomplete, but I've done a ctrl-Break several times
and this is all I get:

EventSet number: 154
got ClassPrepareEvent for java.awt.EventDispatchThread$1

Full thread dump:

"JDI Target VM Interface" prio=5 tid=0x76ee10 nid=0xdb runnable [0xf5bf000..0xf5bfdc0]
        at java.net.SocketInputStream.socketRead(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:86)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:204)
        at com.sun.tools.jdi.SocketConnection.receivePacket(SocketConnection.java:61)
        at com.sun.tools.jdi.TargetVM.run(TargetVM.java:98)
        at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:488)

"JDI Internal Event Handler" prio=5 tid=0x76d550 nid=0xba waiting on monitor [0xf57f000..0xf57fdc0]
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(../../../src/share/classes/java/lang/Object.java:420)
        at com.sun.tools.jdi.EventQueueImpl.removeUnfiltered(EventQueueImpl.java:164)
        at com.sun.tools.jdi.EventQueueImpl.removeInternal(EventQueueImpl.java:100)
        at com.sun.tools.jdi.InternalEventHandler.run(InternalEventHandler.java:38)
        at java.lang.Thread.run(../../../src/share/classes/java/lang/Thread.java:488)

"Signal Dispatcher" daemon prio=10 tid=0x768a10 nid=0x8a waiting on monitor [0..0]

"Finalizer" daemon prio=9 tid=0x7651e0 nid=0xd8 waiting on monitor [0xf39f000..0xf39fdc0]
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:126)
        at java.lang.ref.Finalizer$FinalizerThread.run(../../../src/share/classes/java/lang/ref/Finalizer.java:162)

"Reference Handler" daemon prio=10 tid=0x765e60 nid=0xc8 waiting on monitor [0xf35f000..0xf35fdc0]
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(../../../src/share/classes/java/lang/Object.java:420)
        at java.lang.ref.Reference$ReferenceHandler.run(../../../src/share/classes/java/lang/ref/Reference.java:110)

"main" prio=5 tid=0x761590 nid=0x6c waiting on monitor [0x6f000..0x6fc34]
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(../../../src/share/classes/java/lang/Object.java:420)
        at com.sun.tools.jdi.EventQueueImpl.removeUnfiltered(EventQueueImpl.java:164)
        at com.sun.tools.jdi.EventQueueImpl.remove(EventQueueImpl.java:81)
        at com.sun.tools.jdi.EventQueueImpl.remove(EventQueueImpl.java:67)
        at debugger.lookAtEvents(debugger.java:117)
        at debugger.debug(debugger.java:70)
        at debugger.main(debugger.java:45)

"VM Thread" prio=5 tid=0x763070 nid=0xcb runnable

"VM Periodic Task Thread" prio=10 tid=0x7675f0 nid=0xc7 waiting on monitor


tim.bell@Eng 2000-09-21  I made a lot of progress today by changing
the command-line launcher to bring up the debugee using java_g instead
of java.

When the debugee is run on NT, using hotspot VM and java_g, I get the
following assertion failure over 75% of the time:

got ClassPrepareEvent for java.awt.Conditional
#
# HotSpot Virtual Machine Error, assertion failure
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# assert(jvmdi::is_bytecode_stepping(), "must be in single step mode, to be at a
t_safepoint")
#
# Error ID: Z:\hotspot_client1.4\ws\win32\hotspot_client1.4beta\src\share\vm\int
erpreter\interpreterRuntime.cpp, 666
#
# Problematic Thread: prio=7 tid=0x7864a8 nid=0x760 runnable
#
# SafepointSynchronize::begin: Fatal error:
# SafepointSynchronize::begin: Timed out while attempting to reach a safepoint.
# SafepointSynchronize::begin: Threads which did not reach the safepoint:
# nid=0x760 runnable
# SafepointSynchronize::begin: (End of list)


When run on Solaris 6 on jano.eng (10-way Ultra-Enterprise), using
hotspot VM and java_g, the debugee hangs (about 50% of the time)
in the following place:

detected a multithreaded program
Attached to process 11275 with 9 LWPs
t@7 (l@1) stopped in _lwp_sema_wait at 0xef6b97c0
0xef6b97c0: _lwp_sema_wait+0x0008:      ta      0x8
Current function is condvarWait
(dbx) where
  [1] _lwp_sema_wait(0xeef05e78, 0x0, 0xad658, 0x7efefeff, 0x81010100, 0xff00), at 0xef6b97c0
  [2] _park(0xeef05dd8, 0xeef05e78, 0x0, 0x2, 0xef797be8, 0xeee03dd8), at 0xef777eb0
  [3] _swtch(0x5, 0xef796bc8, 0xeef05e58, 0xeef05e54, 0xeef05e50, 0xeef05e4c), at 0xef777b94
  [4] cond_wait(0xbc900, 0xbc8e8, 0x4356, 0xef796bc8, 0x8, 0xeef05e2c), at 0xef7768b4
=>[5] condvarWait(condvar = 0xbc900, mutex = 0xbc8e8, wtype = CONDVAR_WAIT), line 83 in "condvar_md.c"
  [6] sysMonitorWait(self = 0xa7f68, mid = 0xbc8e8, millis = -1LL), line 254 in "monitor_md.c"
  [7] jvmdi_RawMonitorWait(monitor = 0xbc8e8, millis = -1LL), line 4046 in "jvmdi.c"
  [8] debugMonitorWait(monitor = 0xbc8e8), line 1096 in "util.c"
  [9] dequeue(packet = 0xeef05b60), line 214 in "debugLoop.c"
  [10] debugLoop_run(), line 77 in "debugLoop.c"
  [11] connectionInitiated(t = 0xeebc4014), line 150 in "transport.c"
  [12] attachThread(ptr = 0xeebc4014), line 177 in "transport.c"
  [13] debugThreadWrapper(arg = 0xeb499b68), line 3876 in "jvmdi.c"
  [14] saveStackBase(args = 0xef5c77b0), line 139 in "threads.c"
  [15] _start(tid_ = 0xa7f68), line 338 in "threads_md.c"

                                    

Comments
EVALUATION

This test case (Calculator.java) works well when
run on build 1.3.1rc1-b18.  A large number of
HotSpot bug fixes have been checked in since this
bug was filed.  Closing as "not reproducable" in
the current code base because I don't have a
specific number for the bug fix that covers this.


tim.bell@Eng 2001-03-19
                                     
2001-03-19
PUBLIC COMMENTS

.
                                     
2004-06-10
WORK AROUND



Name: tb29552			Date: 09/20/2000


1) Run the debugee on a single-cpu machine
2) Run the debugee using the hotspot VM instead of "-classic"

======================================================================
                                     
2004-06-11



Hardware and Software, Engineered to Work Together