-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
beta2
-
generic
-
generic
-
Verified
Name: ipR10196 Date: 03/02/2004
-----------------------------------------------------
Test : nsk/sajdi/ThreadReference/status/status001
VM : ClientVM, ServerVM
Mode : all
Platform : generic
OS : generic
JDK : 1.5.0-beta2-b40 and earlier
------------------------------------------------------
This test checks if ThreadReference methods such as
name(), status(), isSuspended(), suspendCount(), toString()
are working correctly for not running threads (i.e,, not
started or already finished threads).
With SA-JDI connectors name(), status() and toString() throw
NullPointerException for not running threads. With legacy
JDI connectors these functions are working well.
Here is typical test output:
------------------------------------------------------------------
thread #0
java.lang.NullPointerException
at sun.jvm.hotspot.jdi.ThreadReferenceImpl.name(ThreadReferenceImpl.java:73)
at nsk.sajdi.ThreadReference.status.status001.checkThread(status001.java:174)
at nsk.sajdi.ThreadReference.status.status001.runIt(status001.java:146)
at nsk.sajdi.ThreadReference.status.status001.run(status001.java:26)
at nsk.sajdi.ThreadReference.status.status001.main(status001.java:21)
# ERROR: ThreadReference.name() throws unexpected exception:
# ERROR: thread nom: 0
# ERROR: thread name: threadFinished
# ERROR: exception: java.lang.NullPointerException
java.lang.NullPointerException
at sun.jvm.hotspot.jdi.ThreadReferenceImpl.status(ThreadReferenceImpl.java:99)
at nsk.sajdi.ThreadReference.status.status001.checkThread(status001.java:188)
at nsk.sajdi.ThreadReference.status.status001.runIt(status001.java:146)
at nsk.sajdi.ThreadReference.status.status001.run(status001.java:26)
at nsk.sajdi.ThreadReference.status.status001.main(status001.java:21)
# ERROR: ThreadReference.status() throws unexpected exception:
# ERROR: thread nom: 0
# ERROR: thread name: threadFinished
# ERROR: exception: java.lang.NullPointerException
suspendCount: 0
isSuspended: true
isAtBreakpnt: false
class type: class nsk.sajdi.ThreadReference.status.status001aThreadFinished
(loaded by instance of sun.misc.Launcher$AppClassLoader(id=0))
class name: nsk.sajdi.ThreadReference.status.status001aThreadFinished
java.lang.NullPointerException
at sun.jvm.hotspot.jdi.ThreadReferenceImpl.name(ThreadReferenceImpl.java:73)
at sun.jvm.hotspot.jdi.ThreadReferenceImpl.toString(ThreadReferenceImpl.java:304)
at nsk.sajdi.ThreadReference.status.status001.checkThread(status001.java:265)
at nsk.sajdi.ThreadReference.status.status001.runIt(status001.java:146)
at nsk.sajdi.ThreadReference.status.status001.run(status001.java:26)
at nsk.sajdi.ThreadReference.status.status001.main(status001.java:21)
# ERROR: ThreadReference.toString() throws unexpected exception:
# ERROR: thread nom: 0
# ERROR: thread name: threadFinished
# ERROR: exception: java.lang.NullPointerException
virtMachine: JVM version 1.5.0-beta2 (Java HotSpot(TM) Client VM, mixed mode)
------------------------------------------------------------------
To reproduce this failure:
cd /net/jano.sfbay/export/disk20/GammaBase/Bugs/<this bug number>
sh build.sh $JAVA_HOME
sh run.sh [-pid | -core | -socket] [-g] [-v] $JAVA_HOME [JAVA_OPTS]
where:
-pid - run test with SA-JDI pid attaching connector (default)
-core - run test with SA-JDI core attaching connector
-socket - run test with JDI socket attaching connector
-g - run test with java_g binaries
-v - run test in verbose mode
This test will appear in the next r27 testbase release.
Running on Linux this test may fail due to known bug:
4996081 SA-JDI: SAPIDAttachingConnector.attach() throws IOEception on RH AS2.1
======================================================================
Name: ipR10196 Date: 03/03/2004
ThreadReference.frameCount() also throws NullPointerException
for not running threads and the following test failed:
nsk/sajdi/ThreadReference/frames/frames001
java.lang.NullPointerException
at sun.jvm.hotspot.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:183)
at sun.jvm.hotspot.jdi.ThreadReferenceImpl.frameCount(ThreadReferenceImpl.java:152)
at nsk.sajdi.ThreadReference.frames.frames001.checkThread(frames001.java:190)
at nsk.sajdi.ThreadReference.frames.frames001.runIt(frames001.java:146)
at nsk.sajdi.ThreadReference.frames.frames001.run(frames001.java:26)
at nsk.sajdi.ThreadReference.frames.frames001.main(frames001.java:21)
# ERROR: ThreadReference.frameCount() throws unexpected exception:
# ERROR: thread nom: 0
# ERROR: thread name: threadFinished
# ERROR: exception: java.lang.NullPointerException
# ERROR: ThreadReference.frameCount() throws unexpected exception:
# ERROR: thread nom: 1
# ERROR: thread name: threadNotStarted
# ERROR: exception: java.lang.NullPointerException
======================================================================