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

RedefineClasses hits assertion "Bad cpcache index!" on x86 platforms

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      generic

      Description



      Name: egR10015 Date: 04/04/2002



      HotSpot 1.4.1-b07 fails to redefine classes of almost all tests from
      testbase_nsk and crashes when the testbase is running in a special
      "HotSwap" mode explained below. The observed crash is very similar
      to one described in the bug:

      4628760 RedefineClasses gets assertion: "Should be a method entry in cpcache!"

      except the following. Debugged VM crashes on x86 platforms (win2k,
      linux-i386, solx86) with another assertion failure:

      assert(u2_at_bcp >= 0 && u2_at_bcp < old_cache->length(), "Bad cpcache index!")

      Note that HotSpot 1.4.0-b92 also crashes with this assertion.

      The mentioned "HotSwap" mode of the testbase allows to make class
      file redefinition in every currently running test simultaneously
      with the testing itself, using special JVMDI and Java agents.
      The Java agent prepares necessary data for the redefinition and
      then invokes method "main" of the test, it also loads bytes
      defining a redefined class. The JVMDI agent actually performs
      the redefinition of the test classes via the JVMDI function
      RedefineClasses() in every incoming JVMDI_EVENT_METHOD_ENTRY (by
      default) or JVMDI_EVENT_SINGLE_STEP event.

      I've used a simple test HelloWorld to illustrate the failure. It
      does not throw any exception, so, I guess, this issue is different
      from one described in the bug 4559100.
      The following files are used:

      HelloWorld.java - a simple program which class file (without any
      changes) is to be redefined;

      share/RASagent.java - the Java agent;

      share/JVMDIagent.c - the JVMDI agent which redefines the test
      class in every incoming JVMDI_EVENT_METHOD_ENTRY event.

      To reproduce the bug run with HS1.4.1

      sh doit.sh $JAVA_HOME
      or
      sh doit_g.sh $DEBUG_JAVA_HOME

      in /net/sqesvr.sfbay/export/vsn/GammaBase/Bugs/<this bug number>

      where JAVA_HOME should point to jdk1.4.1

      ---------------- output on Win2k with HS 1.4.1-b07-debug: ------------------
      $ sh doit_g.sh e:/hs_run/jdk/jdk141-b07
      Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
      Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

      JVMDIagent.c
      JVMDITools.c
      Generating Code...
      Microsoft (R) Incremental Linker Version 6.00.8447
      Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

      /dll
      /implib:wintel/JVMDIagent_g.lib
      /out:wintel/JVMDIagent_g.dll
      JVMDIagent.obj
      JVMDITools.obj
         Creating library wintel/JVMDIagent_g.lib and object wintel/JVMDIagent_g.exp
      Compiling support classes...
      Compiling test classes...
      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b07)
      Java HotSpot(TM) Client VM (build 1.4.1-beta-b07-debug, mixed mode)

      Executing the test ...

      #### JVMDIagent: all necessary events were successfully enabled for HotSwap ####


      #### JVMDIagent: found the test class matched with "HelloWorld"
      #### signature=LHelloWorld;
      #### RASagent: loading bytes from class file=HelloWorld\HelloWorld.class
      #### bytes defining the class has been successfully loaded
      #### RASagent: test main class=class HelloWorld
      #### RASagent: invoked method=public static void HelloWorld.main(java.lang.Strin
      g[])

      #### JVMDIagent: hotswapping of the class with signature=LHelloWorld; ...
      #### JVMDIagent: entered the raw monitor "eventLock" ####
      #### JVMDIagent: >>>>>>>> Invoke RedefineClasses():
      #### new class byte count=569
      #### JVMDIagent: <<<<<<<< RedefineClasses() is successfully done ####
      #### JVMDIagent: exited from the raw monitor "eventLock" ####


      #### JVMDIagent: hotswapping of the class with signature=LHelloWorld; ...
      #### JVMDIagent: entered the raw monitor "eventLock" ####
      #### JVMDIagent: >>>>>>>> Invoke RedefineClasses():
      #### new class byte count=569
      #
      # HotSpot Virtual Machine Error, assertion failure
      # Please report this error at
      # http://java.sun.com/cgi-bin/bugreport.cgi
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.1-beta-b07-debug mixed mode)
      #
      # assert(u2_at_bcp >= 0 && u2_at_bcp < old_cache->length(), "Bad cpcache index!"
      )
      #
      # Error happened during: VM_RedefineClasses
      #
      # Error ID: D:/BUILD_AREA/jdk1.4.1/hotspot\src\share\vm\prims\jvmdi_hotswap.cpp,
       326
      #
      # Problematic Thread: prio=5 tid=0x002353E0 nid=0x190 runnable
      #
      exit code = 1
      ----------------------------------------------------------------------------

      The ability to run the whole testbase with class file redefinition in
      every test will be available in release r13 of the testbase_nsk.
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              eugsunw Eug Eug (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: