United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6534517 JCK6a: several JVMTI tests for ForceEarlyReturnInt,ForceEarlyReturnLong,ForceEarlyReturnObject fail
6534517 : JCK6a: several JVMTI tests for ForceEarlyReturnInt,ForceEarlyReturnLong,ForceEarlyReturnObject fail

Details
Type:
Bug
Submit Date:
2007-03-14
Status:
Resolved
Updated Date:
2011-09-22
Project Name:
JDK
Resolved Date:
2007-04-24
Component:
hotspot
OS:
generic
Sub-Component:
jvmti
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6,7
Fixed Versions:
hs10

Related Reports
Backport:
Backport:

Sub Tasks

Description
JDK:            6.0-fcs
JCK:            JCK6a-beta b07
Platform[s]:    FAILED on Solaris 10 x86; PASSED on Solaris 10 sparc
switch/Mode:    default (-Xfuture)
JCK test owner: http://javaweb.sfbay/jcce/tcks/jck/docs/others/owners.jto
Failing Test:
  vm/jvmti/ForceEarlyReturnInt/feri001/feri00104/feri00104.html
  vm/jvmti/ForceEarlyReturnLong/ferl001/ferl00104/ferl00104.html
  vm/jvmti/ForceEarlyReturnObject/fero001/fero00104/fero00104.html

These new JCK 6a tests fail on Solaris 10 x86 but pass on Solaris 10 sparc.

Please use the following script to reproduce the failures:
--- runTest.sh ---
echo `uname -a`

PLATFORM=`uname -p`
if [ "$PLATFORM" = "sparc" ]; then
    TESTEDJDK="/set/java/jdk6.0/solaris-sparc"
    CC="/set/devtools/nozomi/SUNWspro/WS6U2"
else 
    TESTEDJDK="/set/java/jdk6.0/solaris-i586"
    CC="/set/venus/dist/intel-S2"
fi

JCK="/set/java/re/jck/6a/promoted/beta/b07/binaries/JCK-runtime-6a/"
OUTPUTDIR=$HOME

TESTCLASS1="javasoft.sqe.tests.vm.jvmti.feri001.feri00104.feri00104"
TESTCLASS2="javasoft.sqe.tests.vm.jvmti.ferl001.ferl00104.ferl00104"
TESTCLASS3="javasoft.sqe.tests.vm.jvmti.fero001.fero00104.fero00104"

AGENTOPTS1="-agentlib:jckjvmti=feri00104"
AGENTOPTS2="-agentlib:jckjvmti=ferl00104"
AGENTOPTS3="-agentlib:jckjvmti=fero00104"

JDKOPTS="-Xfuture"
TESTARGS="-platform.jvmtiSupported true"

echo "Compiling libjckjvmt.so ..."
${CC}/bin/cc -G -KPIC -o ${OUTPUTDIR}/libjckjvmti.so -I${JCK} -I${JCK}src/share/lib/jvmti/include \
    -I${JCK}src/share/lib/jni/include -I${JCK}src/share/lib/jni/include/solaris \
    ${JCK}src/share/lib/jvmti/jckjvmti.c

export LD_LIBRARY_PATH=${OUTPUTDIR}:${LD_LIBRARY_PATH}

# -------------------------------------------------------
echo " "
RUNCMD="${TESTEDJDK}/bin/java ${AGENTOPTS1} ${JDKOPTS} -classpath ${JCK}/classes ${TESTCLASS1} ${TESTARGS}"
echo "Executing test vm/jvmti/ForceEarlyReturnInt/feri001/feri00104/feri00104.html ..."
echo "${RUNCMD}"
$RUNCMD

# -------------------------------------------------------
echo " "
RUNCMD="${TESTEDJDK}/bin/java ${AGENTOPTS2} ${JDKOPTS} -classpath ${JCK}/classes ${TESTCLASS2} ${TESTARGS}"
echo "Executing test vm/jvmti/ForceEarlyReturnLong/ferl001/ferl00104/ferl00104.html ..."
echo "${RUNCMD}"
$RUNCMD

# -------------------------------------------------------
RUNCMD="${TESTEDJDK}/bin/java ${AGENTOPTS3} ${JDKOPTS} -classpath ${JCK}/classes ${TESTCLASS3} ${TESTARGS}"
echo " "
echo "Executing test vm/jvmti/ForceEarlyReturnObject/fero001/fero00104/fero00104.html ..."
echo "${RUNCMD}"
$RUNCMD
--- runTest.sh ---

==============================
test output on Solaris 10 x86:
==============================
<yg153347@jck> ./runTest.sh
SunOS jck 5.10 Generic_118855-33 i86pc i386 i86pc
Compiling libjckjvmt.so ...

Executing test vm/jvmti/ForceEarlyReturnInt/feri001/feri00104/feri00104.html ...
/set/java/jdk6.0/solaris-i586/bin/java -agentlib:jckjvmti=feri00104 -Xfuture -classpath /set/java/re/jck/6a/promoted/beta/b07/binaries/JCK-runtime-6a//classes javasoft.sqe.tests.vm.jvmti.feri001.feri00104.feri00104 -platform.jvmtiSupported true
Trying to acquire a lock on 'testLock' object ... lock acquired.
Unexpected returned value after ForceEarlyReturnInt() successful call: -1233745232

Executing test vm/jvmti/ForceEarlyReturnLong/ferl001/ferl00104/ferl00104.html ...
/set/java/jdk6.0/solaris-i586/bin/java -agentlib:jckjvmti=ferl00104 -Xfuture -classpath /set/java/re/jck/6a/promoted/beta/b07/binaries/JCK-runtime-6a//classes javasoft.sqe.tests.vm.jvmti.ferl001.ferl00104.ferl00104 -platform.jvmtiSupported true
Trying to acquire a lock on 'testLock' object ... lock acquired.
Unexpected returned value after ForceEarlyReturnLong() successful call: -5298895419974710608

Executing test vm/jvmti/ForceEarlyReturnObject/fero001/fero00104/fero00104.html ...
/set/java/jdk6.0/solaris-i586/bin/java -agentlib:jckjvmti=fero00104 -Xfuture -classpath /set/java/re/jck/6a/promoted/beta/b07/binaries/JCK-runtime-6a//classes javasoft.sqe.tests.vm.jvmti.fero001.fero00104.fero00104 -platform.jvmtiSupported true
Trying to acquire a lock on 'testLock' object ... lock acquired.
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xfe86eb1d, pid=4655, tid=2
#
# Java VM: Java HotSpot(TM) Server VM (1.6.0-b105 mixed mode)
# Problematic frame:
# V  [libjvm.so+0x6eb1d]
#
# An error report file with more information is saved as hs_err_pid4655.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
./runTest.sh: line 52:  4655 Abort                   (core dumped) $RUNCMD


================================
test output on Solaris 10 sparc:
================================
<yg153347@d-espb04-125-170> ./runTest.sh
SunOS d-espb04-125-170 5.10 Generic_118833-33 sun4u sparc SUNW,Ultra-60
Compiling libjckjvmt.so ...

Executing test vm/jvmti/ForceEarlyReturnInt/feri001/feri00104/feri00104.html ...
/set/java/jdk6.0/solaris-sparc/bin/java -agentlib:jckjvmti=feri00104 -Xfuture -classpath /set/java/re/jck/6a/promoted/beta/b07/binaries/JCK-runtime-6a//classes javasoft.sqe.tests.vm.jvmti.feri001.feri00104.feri00104 -platform.jvmtiSupported true
Trying to acquire a lock on 'testLock' object ... lock acquired.

Executing test vm/jvmti/ForceEarlyReturnLong/ferl001/ferl00104/ferl00104.html ...
/set/java/jdk6.0/solaris-sparc/bin/java -agentlib:jckjvmti=ferl00104 -Xfuture -classpath /set/java/re/jck/6a/promoted/beta/b07/binaries/JCK-runtime-6a//classes javasoft.sqe.tests.vm.jvmti.ferl001.ferl00104.ferl00104 -platform.jvmtiSupported true
Trying to acquire a lock on 'testLock' object ... lock acquired.

Executing test vm/jvmti/ForceEarlyReturnObject/fero001/fero00104/fero00104.html ...
/set/java/jdk6.0/solaris-sparc/bin/java -agentlib:jckjvmti=fero00104 -Xfuture -classpath /set/java/re/jck/6a/promoted/beta/b07/binaries/JCK-runtime-6a//classes javasoft.sqe.tests.vm.jvmti.fero001.fero00104.fero00104 -platform.jvmtiSupported true
Trying to acquire a lock on 'testLock' object ... lock acquired.

                                    

Comments
SUGGESTED FIX

Method return value must be saved/restored in the remove_activation() code around unlock_object() call with the push(stat)/pop(stat) instructions.

Please, see in attachments the webrev hs_eret7.Apr10.tar.gz.
                                     
2007-04-11
EVALUATION

This is a ForceEarlyReturn bug which is specific to the x86/amd64 platforms.
It happens when the ForceEarlyReturn{int,long,object} is called for a method
which currently is executing inside a synchronized block.
The problem is that inside the remove_activation() code the registers
(x86: eax, edx; amd64: rax) containing a return value are used
in the call to unlock_object() without saving/restore.
                                     
2007-04-11



Hardware and Software, Engineered to Work Together