This bug affects the following JavaTest/JTREG tests:
com/sun/jdi/EarlyReturnNegativeTest.java
com/sun/jdi/NewInstanceTest.java
com/sun/jdi/RedefineCrossEvent.java
And the following VM tests:
nsk/jdi/MethodExitEvent/returnValue/returnValue003
nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn006
The tests pass with b26 and earlier and fail with b27 and b28.
This is on solaris-sparc. Haven't tried other platforms.
The failure occurs when both -client and -Xcomp are used on the debuggee
The failure doesn't occur with -server -Xcomp nor with -client without -Xcomp.
I believe the jtreg failures weren't caught in nightly or PIT testing because they don't run JPDA debuggees with -Xcomp.
I believe the nsk failures weren't caught in nightly or PIT testing because they run with -Xcomp -XX:CompileOnly=nsk.
I believe for every drop of rain that falls, a flower grows.
And I believe that Ronald Reagan can make this country what it once was - an arctic region covered with ice.
This is the failure
com.sun.jdi.ClassNotLoadedException: Class java.lang.Object not loaded
at com.sun.tools.jdi.ClassLoaderReferenceImpl.findType(ClassLoaderReferenceImpl.java:106)
at com.sun.tools.jdi.ReferenceTypeImpl.findType(ReferenceTypeImpl.java:1156)
at com.sun.tools.jdi.MethodImpl.findType(MethodImpl.java:148)
at com.sun.tools.jdi.MethodImpl$ReturnContainer.findType(MethodImpl.java:241)
at com.sun.tools.jdi.ArrayReferenceImpl.validateAssignment(ArrayReferenceImpl.java:243)
at com.sun.tools.jdi.ObjectReferenceImpl.prepareForAssignmentTo(ObjectReferenceImpl.java:557)
at com.sun.tools.jdi.ValueImpl.prepareForAssignment(ValueImpl.java:48)
at com.sun.tools.jdi.ThreadReferenceImpl.forceEarlyReturn(ThreadReferenceImpl.java:531)
at EarlyReturnNegativeTest.doEarly(EarlyReturnNegativeTest.java:212)
at EarlyReturnNegativeTest.breakpointReached(EarlyReturnNegativeTest.java:262)
at TestScaffold$EventHandler.notifyEvent(TestScaffold.java:191)
at TestScaffold$EventHandler.run(TestScaffold.java:275)
at java.lang.Thread.run(Thread.java:674)
which is a bit obscure since it is a stack trace in the debugger, not the debuggee.
I believe that what has happened is
- we hit a bkpt at EarlyReturnNegativeTarg:117
- the debugger asked for all the 'visibleClasses' of sun.misc.Launcher$AppClassLoader. This became a call to
jvmti:GetClassLoaderClasses
- it got back 30 classes, but java.lang.Object wasn't one of them. This caused the failure. The 30 classes are shown in the first comment
Here is a script that can be used to duplicate the bug. Run it in a <jdk>/test/com/sun/jdi dir
================================================
!/bin/sh
jdk=/java/re/jdk/7/promoted/all/b27/binaries/solaris-sparc
options="-client -Xcomp"
resultDir=/tmp/early
mkdir -p /tmp/early/classes
export CLASSPATH
CLASSPATH=$jdk/classes:$jdk/lib/tools.jar:$resultDir/classes
set -x
$jdk/bin/javac -g -J-Xms40m -d $resultDir/classes VMConnection.java EarlyReturnNegativeTest.java TestScaffold.java TargetAdapter.java TargetListener.java
# start the debuggee
$jdk/bin/java -Xrunjdwp:transport=dt_socket,server=y,address=4571 $options EarlyReturnNegativeTarg &
pid=$!
sleep 5
# run the debugger
$jdk/bin/java EarlyReturnNegativeTest -connect com.sun.jdi.SocketAttach:hostname=localhost,port=4571
kill $pid
==================================================
com/sun/jdi/EarlyReturnNegativeTest.java
com/sun/jdi/NewInstanceTest.java
com/sun/jdi/RedefineCrossEvent.java
And the following VM tests:
nsk/jdi/MethodExitEvent/returnValue/returnValue003
nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn006
The tests pass with b26 and earlier and fail with b27 and b28.
This is on solaris-sparc. Haven't tried other platforms.
The failure occurs when both -client and -Xcomp are used on the debuggee
The failure doesn't occur with -server -Xcomp nor with -client without -Xcomp.
I believe the jtreg failures weren't caught in nightly or PIT testing because they don't run JPDA debuggees with -Xcomp.
I believe the nsk failures weren't caught in nightly or PIT testing because they run with -Xcomp -XX:CompileOnly=nsk.
I believe for every drop of rain that falls, a flower grows.
And I believe that Ronald Reagan can make this country what it once was - an arctic region covered with ice.
This is the failure
com.sun.jdi.ClassNotLoadedException: Class java.lang.Object not loaded
at com.sun.tools.jdi.ClassLoaderReferenceImpl.findType(ClassLoaderReferenceImpl.java:106)
at com.sun.tools.jdi.ReferenceTypeImpl.findType(ReferenceTypeImpl.java:1156)
at com.sun.tools.jdi.MethodImpl.findType(MethodImpl.java:148)
at com.sun.tools.jdi.MethodImpl$ReturnContainer.findType(MethodImpl.java:241)
at com.sun.tools.jdi.ArrayReferenceImpl.validateAssignment(ArrayReferenceImpl.java:243)
at com.sun.tools.jdi.ObjectReferenceImpl.prepareForAssignmentTo(ObjectReferenceImpl.java:557)
at com.sun.tools.jdi.ValueImpl.prepareForAssignment(ValueImpl.java:48)
at com.sun.tools.jdi.ThreadReferenceImpl.forceEarlyReturn(ThreadReferenceImpl.java:531)
at EarlyReturnNegativeTest.doEarly(EarlyReturnNegativeTest.java:212)
at EarlyReturnNegativeTest.breakpointReached(EarlyReturnNegativeTest.java:262)
at TestScaffold$EventHandler.notifyEvent(TestScaffold.java:191)
at TestScaffold$EventHandler.run(TestScaffold.java:275)
at java.lang.Thread.run(Thread.java:674)
which is a bit obscure since it is a stack trace in the debugger, not the debuggee.
I believe that what has happened is
- we hit a bkpt at EarlyReturnNegativeTarg:117
- the debugger asked for all the 'visibleClasses' of sun.misc.Launcher$AppClassLoader. This became a call to
jvmti:GetClassLoaderClasses
- it got back 30 classes, but java.lang.Object wasn't one of them. This caused the failure. The 30 classes are shown in the first comment
Here is a script that can be used to duplicate the bug. Run it in a <jdk>/test/com/sun/jdi dir
================================================
!/bin/sh
jdk=/java/re/jdk/7/promoted/all/b27/binaries/solaris-sparc
options="-client -Xcomp"
resultDir=/tmp/early
mkdir -p /tmp/early/classes
export CLASSPATH
CLASSPATH=$jdk/classes:$jdk/lib/tools.jar:$resultDir/classes
set -x
$jdk/bin/javac -g -J-Xms40m -d $resultDir/classes VMConnection.java EarlyReturnNegativeTest.java TestScaffold.java TargetAdapter.java TargetListener.java
# start the debuggee
$jdk/bin/java -Xrunjdwp:transport=dt_socket,server=y,address=4571 $options EarlyReturnNegativeTarg &
pid=$!
sleep 5
# run the debugger
$jdk/bin/java EarlyReturnNegativeTest -connect com.sun.jdi.SocketAttach:hostname=localhost,port=4571
kill $pid
==================================================