JDK-4397764 : JDI: Uncaught exception in debugee does not lead to VM exit
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.3.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-12-13
  • Updated: 2001-02-02
  • Resolved: 2001-02-02
Related Reports
Duplicate :  
Relates :  
Relates :  
Description

Name: egR10015			Date: 12/13/2000



The internal build (provided by Karen Kinnear) of
HotSpot 1.3.1beta-b11 (build 1.3.1-internal) fails to pass the tests

nsk/jdi/EventRequestManager/createExceptionRequest/crexreq003,
nsk/jdi/EventRequestManager/createExceptionRequest/crexreq005,
nsk/jdi/EventRequestManager/createExceptionRequest/crexreq007

from testbase_nsk on all platforms (Solaris/Sparc, Linux and win32), except
Solaris/x86.
The tests hang in method Thread.join() when wait for a separate
thread to die. This separate thread asynchronously listens to JDI events
and exits after processing the exceptions InterruptedException or
VMDisconnectedException. These exceptions are thrown by JDI method
EventQueue.remove() if the connection to the target VM is no longer
available (see source file share/EventListener.java from
/net/sqesvr/export/vsn/GammaBase/Bugs/<this bug number>).

For example please look at the test crexreq003 from GammaBase.
This test consists of debugger program (see source file crexreq003.java)
and debugee program (see source file crexreq003t.java).
Debugee throws uncaught exception crexreq003tException which should lead
to the VM exit, but actually the process with the target VM (debugee) does
not really exit after throwing the exception. Therefore the previously
mentioned event listener thread in the debugger VM never ends, and the main
test program hangs.

Note that with previous builds of HotSpot the tests fail with exit code 97
due to a bug 4323439 (nevertheless the process with the target VM really
exits after uncaught exception). Also the test crexreq003 passes
with HotSpot 1.3.1-b11 (build 1.3.1beta-b11) on Solaris/x86,
Linux and win32.

To reproduce the bug run 
doit.ksh <jdk root directory> on Solaris/Sparc, Linux and win32
in
/net/sqesvr/export/vsn/GammaBase/Bugs/<this bug number>

--- output on Linux with with HS 1.3.1-b11 (build 1.3.1-internal) ---
$ ./doit.ksh /home/eug/novo73/hotspot/jdk1.3.1ph/linux
Note: crexreq003.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
java version "1.3.1beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1beta-b11)
Java HotSpot(TM) Client VM (build 1.3.1-internal, mixed mode)
thread 80aa158 resume depth=1
VirtualMachineManager: version 1.3
LaunchingConnector:
    name: com.sun.jdi.CommandLineLaunch
    description: Launches target using Sun Java VM command line and attaches to 
it
    transport: dt_socket
Arguments: 
{home=home=/.automount/novo73/root/export/home2/java/hotspot/jdk1.3.1ph/linux, 
vmexec=vmexec=java, options=options=, main=main=crexreq003t, quote=quote=", 
suspend=suspend=true}
<the test hangs>
^C
--------------------------------------------------------------------

----- output on Linux with HS 1.3.1-b11 (build 1.3.1beta-b11) ------
$ ./doit.sh /net/java10/export/home/java/dest/jdk1.3.1-b11/linux-i386
Note: crexreq003.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
java version "1.3.1beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1beta-b11)
Java HotSpot(TM) Client VM (build 1.3.1beta-b11, mixed mode)
VirtualMachineManager: version 1.3
LaunchingConnector:
    name: com.sun.jdi.CommandLineLaunch
    description: Launches target using Sun Java VM command line and attaches to 
it
    transport: dt_socket
Arguments: 
{home=home=/.automount/java10/root/export/home/java/dest/jdk1.3.1-b11/linux-i386
, vmexec=vmexec=java, options=options=, main=main=crexreq003t, quote=quote=", 
suspend=suspend=true}
Event name is
VMStartEvent in thread main
Exception in thread "main" crexreq003tException
        at crexreq003t.communication(crexreq003t.java:21)
        at crexreq003t.main(crexreq003t.java:12)
com.sun.jdi.VMDisconnectedException: Socket closed
        at com.sun.tools.jdi.TargetVM.send(TargetVM.java:260)
        at 
com.sun.tools.jdi.VirtualMachineImpl.sendToTarget(VirtualMachineImpl.java:691)
        at com.sun.tools.jdi.PacketStream.send(PacketStream.java:44)
        at 
com.sun.tools.jdi.JDWP$VirtualMachine$Resume.enqueueCommand(JDWP.java:603)
        at 
com.sun.tools.jdi.VirtualMachineImpl$1.send(VirtualMachineImpl.java:280)
        at com.sun.tools.jdi.VMState.thawCommand(VMState.java:97)
        at 
com.sun.tools.jdi.VirtualMachineImpl.resume(VirtualMachineImpl.java:284)
        at com.sun.tools.jdi.EventSetImpl.resume(EventSetImpl.java:578)
        at nsk.jdi.share.EventListener.run(EventListener.java:50)
<the test passes with exit code 95>
--------------------------------------------------------------------

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

Comments
EVALUATION Cannot reproduce in my workspace - presumed fixed by fix to 4407397. Note test as written doesn't run now since unprepared classes are not returned. Have put fixed test in /net/sqesvr/export/vsn/GammaBase/Bugs/4397764 with "rgf" suffix. Please verify against my workspace: /net/jpda.eng/export/ladybird robert.field@Eng 2001-01-31 ----------------------- This bug is about the test hangup and was filed only against the Karen Kinnear's internal build of HotSpot 1.3.1beta-b11 with thread resume/suspend fixes, which are proved to be broken. Then those broken fixes had been rollbacked, therefore the test has stopped to hang and the bug was automaticly fixed. So, I suppose, the bug could be marked as fixed integrated without any actual changes in HotSpot. Please note, that the test fails with exit code 97 in accordance with a separate bug 4407397. Eugene Gorbachev <###@###.###> Begin - robert.field@Eng 2001-02-02 OK then, what this means is this is another manifestation of the aynchronous suspend/resume which breaks JDI level debugging in many ways. This is being dealt with by bug 4406166 - "jdb fails to set breakpoint in HelloWorld" which doesn't sound anything like this but has the same cause. I am closing this as a duplicate of 4406166. End - robert.field@Eng 2001-02-02
02-02-2001