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

Assertion hit while using class and redefining it with RedefineClasses simultaneously

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • hs25
    • hs25
    • hotspot
    • b52

        As far as I understand it's okay to use class and redefine it simultaneously. The following tests invoke class methods with reflection and redefine it with multiple threads meanwhile. It results in assertion in reflection.cpp. Probably reflection implementation isn't thread safe in this sense.

        nsk/jvmti/RedefineClasses/StressRedefine
        nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption

        # Internal Error (/HUDSON/workspace/2-build-linux-i586/jdk8/5336/hotspot/src/share/vm/runtime/reflection.cpp:1065), pid=12394, tid=3793415024
        # assert(java_args.size_of_parameters() == method->size_of_parameters()) failed: just checking
        #
        # JRE version: Java(TM) SE Runtime Environment (8.0-b102) (build 1.8.0-ea-fastdebug-b102)
        # Java VM: Java HotSpot(TM) Client VM (25.0-b44-fastdebug mixed mode linux-x86 )
        # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
        #
        # If you would like to submit a bug report, please visit:
        # http://bugreport.sun.com/bugreport/crash.jsp
        #

        --------------- T H R E A D ---------------

        Current thread (0xe23a1800): JavaThread "Thread-1" [_thread_in_vm, id=12734, stack(0xe215e000,0xe21af000)]

        Stack: [0xe215e000,0xe21af000], sp=0xe21ad5d0, free space=317k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x894045] VMError::report_and_die()+0x185
        V [libjvm.so+0x3388b8] report_vm_error(char const*, int, char const*, char const*)+0x68
        V [libjvm.so+0x77d2bd] Reflection::invoke(instanceKlassHandle, methodHandle, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*)+0x6dd
        V [libjvm.so+0x77dff6] Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0x1a6
        V [libjvm.so+0x5766e7] JVM_InvokeMethod+0x1b7
        C [libjava.so+0xc322] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x32
        j sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
        j sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
        J sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; @ 0xf43658d0 [0xf4365890+64]
        j java.lang.Thread.run()V+11
        v ~StubRoutines::call_stub
        V [libjvm.so+0x481c87] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x17e7
        V [libjvm.so+0x709849] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle*, JavaCallArguments*, Thread*), JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x19
        V [libjvm.so+0x48235b] JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x4eb
        V [libjvm.so+0x482a11] JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*)+0x61
        V [libjvm.so+0x542b1e] thread_entry(JavaThread*, Thread*)+0x7e
        V [libjvm.so+0x842429] JavaThread::thread_main_inner()+0x1b9
        V [libjvm.so+0x842738] JavaThread::run()+0x268
        V [libjvm.so+0x711e69] java_start(Thread*)+0x119
        C [libpthread.so.0+0x5e72] start_thread+0xd2

        Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
        j sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
        j sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
        J sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; @ 0xf43658d0 [0xf4365890+64]
        J java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; @ 0xf4365454 [0xf4365380+212]
        j nsk.jvmti.RedefineClasses.StressRedefine$StaticMethodCaller.run()V+163
        j java.lang.Thread.run()V+11
        v ~StubRoutines::call_stub

        Steps to reproduce: go to vmsqe-core2q-03, cd to /export/local/repr1 and run local.rerun.sh.1 until it returns nonzero as exit code. Failure is fairly reproducible. It takes ~8 attempts to reproduce.

              coleenp Coleen Phillimore
              atimofee Aleksey Timofeev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: