Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8008511

JSR 292: MemberName vmtarget refs to methods must be updated at class redefinition

XMLWordPrintable

    • b30
    • generic
    • generic

        The following two INDY tests fail because of this issue:
           vm/mlvm/indy/func/jvmti/redefineClassInBootstrap
           vm/mlvm/indy/func/jvmti/redefineClassInTarget


        with the following exception:

        [2013-02-20T02:10:50.16] Original bootstrap(): Lookup vm.mlvm.indy.func.jvmti.redefineClassInBootstrap.INDIFY_Dummy0; method name = greet; method type = (Object,String,int)Boolean
        [2013-02-20T02:10:50.16] Original bootstrap(): Lookup vm.mlvm.indy.func.jvmti.redefineClassInBootstrap.INDIFY_Dummy0; method name = greet; method type = (Object,String,int)Boolean
        [2013-02-20T02:10:50.16] # ERROR: Test caught an exception:
        [2013-02-20T02:10:50.16] # ERROR: java.lang.reflect.InvocationTargetException
        [2013-02-20T02:10:50.16] # ERROR: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        [2013-02-20T02:10:50.16] # ERROR: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        [2013-02-20T02:10:50.17] # ERROR: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        [2013-02-20T02:10:50.17] # ERROR: at java.lang.reflect.Method.invoke(Method.java:487)
        [2013-02-20T02:10:50.17] # ERROR: at vm.mlvm.indy.func.jvmti.share.IndyRedefineTest.run(IndyRedefineTest.java:30)
        [2013-02-20T02:10:50.17] # ERROR: at vm.mlvm.share.MlvmTest.runMlvmTest(MlvmTest.java:195)
        [2013-02-20T02:10:50.17] # ERROR: at vm.mlvm.share.MlvmTest.launch(MlvmTest.java:133)
        [2013-02-20T02:10:50.17] # ERROR: at vm.mlvm.share.MlvmTest.launch(MlvmTest.java:107)
        [2013-02-20T02:10:50.17] # ERROR: at vm.mlvm.indy.func.jvmti.share.IndyRedefineTest.main(IndyRedefineTest.java:44)
        [2013-02-20T02:10:50.17] # ERROR: Caused by: java.lang.BootstrapMethodError: call site initialization exception
        [2013-02-20T02:10:50.17] # ERROR: at java.lang.invoke.CallSite.makeSite(CallSite.java:298)
        [2013-02-20T02:10:50.17] # ERROR: at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:294)
        [2013-02-20T02:10:50.17] # ERROR: at vm.mlvm.indy.func.jvmti.redefineClassInBootstrap.INDIFY_Dummy0.bootstrap(Unknown Source)
        [2013-02-20T02:10:50.17] # ERROR: ... 9 more
        [2013-02-20T02:10:50.17] # ERROR: Caused by: java.lang.RuntimeException: Bootstrap method has not been redefined. Test failed.
        [2013-02-20T02:10:50.19] # ERROR: at vm.mlvm.indy.func.jvmti.redefineClassInBootstrap.INDIFY_Dummy0.bootstrap(Unknown Source)
        [2013-02-20T02:10:50.19] # ERROR: at java.lang.invoke.CallSite.makeSite(CallSite.java:270)
        [2013-02-20T02:10:50.19] # ERROR: ... 11 more
        [2013-02-20T02:10:50.19] ### TRACE 1: TEST FAILED


        The problem is that the old version of the bootstrap method is re-invoked after a popframe from
        the bootstrap method execution.
        It is because the MemberName keeps a stale reference to the old method version.

        This is the last issue which prevents the tests above to pass.
        In fact, they pass with my prototype of the fix.

        This is a log when the test test is passed with a temporary fix:

        cat /net/sc11152596/export/home/sspitsyn/tst/nskx/.February19,.sparc/sspitsyn.SunOS.sparc/redefineClassInBootstrap/redefineClassInBootstrap.log
        #
        [2013-02-20T02:08:20.96] export TESTED_JAVA_HOME
        [2013-02-20T02:08:20.96] export SYSTEMROOT
        [2013-02-20T02:08:20.96] export HOME
        [2013-02-20T02:08:20.96] export TEMP
        [2013-02-20T02:08:20.96] export RAS_OPTIONS
        [2013-02-20T02:08:20.96] export BASH_ENV
        [2013-02-20T02:08:20.96] export SHELL
        [2013-02-20T02:08:20.96] export TEST_CLEANUP
        [2013-02-20T02:08:20.96] export LIBJSIG_PATH
        [2013-02-20T02:08:20.96] export CLASSPATH
        [2013-02-20T02:08:20.96] export ROOTDIR
        [2013-02-20T02:08:20.96] export JAVA_OPTS
        [2013-02-20T02:08:20.96] export DISPLAY
        [2013-02-20T02:08:20.96] export WINDIR
        [2013-02-20T02:08:20.96] export PATH
        [2013-02-20T02:08:20.96] export JAVA_64_BITS
        [2013-02-20T02:08:20.96] export LD_LIBRARY_PATH
        [2013-02-20T02:08:20.96] export TESTBASE
        [2013-02-20T02:08:20.96] TEST_DEST_DIR="redefineClassInBootstrap"
        [2013-02-20T02:08:21.02] # Actual: TEST_DEST_DIR=redefineClassInBootstrap
        [2013-02-20T02:08:21.02] TESTNAME="${test_case_name}"
        [2013-02-20T02:08:21.02] # Actual: TESTNAME=redefineClassInBootstrap
        [2013-02-20T02:08:21.02] testName="vm/mlvm/indy/func/jvmti//redefineClassInBootstrap"
        [2013-02-20T02:08:21.02] # Actual: testName=vm/mlvm/indy/func/jvmti//redefineClassInBootstrap
        [2013-02-20T02:08:21.02] TESTDIR="${test_work_dir}"
        [2013-02-20T02:08:21.02] # Actual: TESTDIR=/net/sc11152596/export/home/sspitsyn/tst/nskx/.February19,.sparc/sspitsyn.SunOS.sparc/redefineClassInBootstrap
        [2013-02-20T02:08:21.02] testWorkDir="${test_work_dir}/"
        [2013-02-20T02:08:21.02] # Actual: testWorkDir=/net/sc11152596/export/home/sspitsyn/tst/nskx/.February19,.sparc/sspitsyn.SunOS.sparc/redefineClassInBootstrap/
        [2013-02-20T02:08:21.02] export testWorkDir
        [2013-02-20T02:08:21.02] tlogOutFile="${test_work_dir}/${test_name}.tlog"
        [2013-02-20T02:08:21.02] # Actual: tlogOutFile=/net/sc11152596/export/home/sspitsyn/tst/nskx/.February19,.sparc/sspitsyn.SunOS.sparc/redefineClassInBootstrap/redefineClassInBootstrap.tlog
        [2013-02-20T02:08:21.02] testErrFile="${test_work_dir}/${test_name}.err"
        [2013-02-20T02:08:21.02] # Actual: testErrFile=/net/sc11152596/export/home/sspitsyn/tst/nskx/.February19,.sparc/sspitsyn.SunOS.sparc/redefineClassInBootstrap/redefineClassInBootstrap.err
        [2013-02-20T02:08:21.02] EXECUTE_CLASS="${test_name}"
        [2013-02-20T02:08:21.02] # Actual: EXECUTE_CLASS=redefineClassInBootstrap
        [2013-02-20T02:08:21.02] EXECUTE_CLASS="vm.mlvm.indy.func.jvmti.share.IndyRedefineTest"
        [2013-02-20T02:08:21.03] # Actual: EXECUTE_CLASS=vm.mlvm.indy.func.jvmti.share.IndyRedefineTest
        [2013-02-20T02:08:21.03] TEST_ARGS="${TEST_ARGS} -dummyClassName=vm.mlvm.indy.func.jvmti.redefineClassInBootstrap.INDIFY_Dummy0 -popFrames true"
        [2013-02-20T02:08:21.03] # Actual: TEST_ARGS=-dummyClassName=vm.mlvm.indy.func.jvmti.redefineClassInBootstrap.INDIFY_Dummy0 -popFrames true
        [2013-02-20T02:08:21.03] LD_LIBRARY_PATH="${COMMON_LIBS_LOCATION}/lib/${ARCH}/vm/mlvm/indy/func/jvmti/share${SEPARATOR}${LD_LIBRARY_PATH}"
        [2013-02-20T02:08:21.03] # Actual: LD_LIBRARY_PATH=/net/sc11152541/export/home/sspitsyn/utb7/vm/bin/lib/solaris-sparc/vm/mlvm/indy/func/jvmti/share:/net/sc11152541/export/home/sspitsyn/hs25/solaris-sparc/fastdebug/jre/lib/sparc/server
        [2013-02-20T02:08:21.03] export LD_LIBRARY_PATH
        [2013-02-20T02:08:21.03] JAVAC_OPTS="${JAVAC_OPTS} -g"
        [2013-02-20T02:08:21.03] # Actual: JAVAC_OPTS=-g
        [2013-02-20T02:08:21.03] AGENTS="-agentlib:IndyRedefineClass=verbose=~pathToNewByteCode=${COMMON_CLASSES_LOCATION}/newclass"
        [2013-02-20T02:08:21.03] # Actual: AGENTS=-agentlib:IndyRedefineClass=verbose=~pathToNewByteCode=/net/sc11152541/export/home/sspitsyn/utb7/vm/bin/newclass
        [2013-02-20T02:08:21.03] JAVA_OPTS="${JAVA_OPTS} ${AGENTS}"
        [2013-02-20T02:08:21.04] # Actual: JAVA_OPTS=-server -verbose=1 -agentlib:IndyRedefineClass=verbose=~pathToNewByteCode=/net/sc11152541/export/home/sspitsyn/utb7/vm/bin/newclass
        [2013-02-20T02:08:21.04] APPLICATION_TIMEOUT="${TIMEOUT}"
        [2013-02-20T02:08:21.04] # Actual: APPLICATION_TIMEOUT=15
        [2013-02-20T02:08:21.04] CLASSPATH="${test_work_dir}${PS}${CLASSPATH}"
        [2013-02-20T02:08:21.04] # Actual: CLASSPATH=/net/sc11152596/export/home/sspitsyn/tst/nskx/.February19,.sparc/sspitsyn.SunOS.sparc/redefineClassInBootstrap:/net/sc11152541/export/home/sspitsyn/utb7/vm/bin/classes:/net/sc11152541/export/home/sspitsyn/hs25/solaris-sparc/fastdebug/lib/tools.jar
        [2013-02-20T02:08:21.04] export CLASSPATH
        [2013-02-20T02:08:21.04] ${JAVA} ${JAVA_OPTS} ${EXECUTE_CLASS} ${TEST_ARGS}
        [2013-02-20T02:08:21.05] # Actual: /net/sc11152541/export/home/sspitsyn/hs25/solaris-sparc/fastdebug/bin/java -server -verbose=1 -agentlib:IndyRedefineClass=verbose=~pathToNewByteCode=/net/sc11152541/export/home/sspitsyn/utb7/vm/bin/newclass vm.mlvm.indy.func.jvmti.share.IndyRedefineTest -dummyClassName=vm.mlvm.indy.func.jvmti.redefineClassInBootstrap.INDIFY_Dummy0 -popFrames true
        [2013-02-20T02:08:21.05] - IndyRedefineClass.c, 37: Setting redefined class name to vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/INDIFY_Dummy0
        [2013-02-20T02:08:25.57] - IndyRedefineClass.c, 31: Setting redefine trigger method name to redefineNow
        [2013-02-20T02:08:25.57] - IndyRedefineClass.c, 109: Entering redefine tigger method: Lvm/mlvm/indy/func/jvmti/redefineClassInBootstrap/INDIFY_Dummy0;.redefineNow
        [2013-02-20T02:08:25.57] - IndyRedefineClass.c, 117: Redefining class vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/INDIFY_Dummy0
        [2013-02-20T02:08:25.57] # info :: File = /net/sc11152541/export/home/sspitsyn/utb7/vm/bin/newclass/vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/INDIFY_Dummy0.class
        [2013-02-20T02:08:25.57] # info **Agent:: opening file /net/sc11152541/export/home/sspitsyn/utb7/vm/bin/newclass/vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/INDIFY_Dummy0.class
        [2013-02-20T02:08:25.57] # info file size= 2860
        [2013-02-20T02:08:25.57] File red completely
        [2013-02-20T02:08:25.57] - IndyRedefineClass.c, 71: Enabling single step
        [2013-02-20T02:08:25.57] - IndyRedefineClass.c, 80: Forcing early return
        [2013-02-20T02:08:25.57] - IndyRedefineClass.c, 145: Single step event: Lvm/mlvm/indy/func/jvmti/redefineClassInBootstrap/INDIFY_Dummy0; .bootstrap :2e
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 71: Enabling single step
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 76: Popping a frame
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 145: Single step event: Ljava/lang/invoke/LambdaForm$DMH; .invokeStatic_LLL_L :e
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 65: Disabling single step
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 48: The following values should be non-zero for test to pass:
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 49: Method entry event fired? 1
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 50: Single step event fired? 1
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 51: The following value should be zero for test to pass:
        [2013-02-20T02:08:25.67] - IndyRedefineClass.c, 52: Any other error occured? 0
        [2013-02-20T02:08:25.67] ### TRACE 1: TEST PASSED
        [2013-02-20T02:08:25.67] # Test level exit status: 95

              sspitsyn Serguei Spitsyn
              sspitsyn Serguei Spitsyn
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: