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

SIGSEGV in BiasedLocking::revoke_and_rebias

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 7u4, 8u11
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      If I try and run javac with classes that have been statically instrumented for use with javac, I can reliably get the following crash:

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x01085c64, pid=29783, tid=3078806384
      #
      # JRE version: 7.0-b147
      # Java VM: Java HotSpot(TM) Client VM (21.0-b17 mixed mode linux-x86 )
      # Problematic frame:
      # V [libjvm.so+0x9ac64] BiasedLocking::revoke_and_rebias(Handle, bool, Thread*)+0x24
      #


      There are two known workarounds:
      1, suggested by jcov team, set option -Xms30m (actually, -Xms20m works for me)
      2, suggested by Kumar, set -XX:-UseBiasedLocking


      Additionally, Andrey Titov, from the jcov team, writes:
      JCov needs to create long[1 000 000] array at very beginnig of VM initialization. It's 8mb of memory and it seems that VM under javac at this point just doesn't have such memory. VM crashes exactly on array creation. That's all I found while I was investigating this problem.


      I'm getting the crash on Ubuntu 10.04 on MacBookPro+VMWare. The jcov team report the same problem on "sparc system only".


      I can probably provide reproducible test case if needed. Likewise jcov team.
      Here is the crashing call stack from hs_err_pid21472.log:

      Stack: [0x00007f7945af9000,0x00007f7945bfa000], sp=0x00007f7945bf7af0, free space=1018k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x288bc3] BiasedLocking::revoke_and_rebias(Handle, bool, Thread*)+0x33
      V [libjvm.so+0x82a382] ObjectSynchronizer::fast_enter(Handle, BasicLock*, bool, Thread*)+0x42
      V [libjvm.so+0x5287f2] instanceRefKlass::acquire_pending_list_lock(BasicLock*)+0x72
      V [libjvm.so+0x8a3903] VM_GC_Operation::doit_prologue()+0x23
      V [libjvm.so+0x8ab45b] VMThread::execute(VM_Operation*)+0x15b
      V [libjvm.so+0x75dcf6] ParallelScavengeHeap::mem_allocate(unsigned long, bool*)+0x196
      V [libjvm.so+0x878127] typeArrayKlass::allocate_common(int, bool, Thread*)+0x2f7
      V [libjvm.so+0x543fc8] InterpreterRuntime::newarray(JavaThread*, BasicType, int)+0x28
      j com.sun.tdk.jcov.runtime.Collect.enableCounts()V+2
      j com.sun.tdk.jcov.runtime.Collect.<clinit>()V+20
      v ~StubRoutines::call_stub
      V [libjvm.so+0x54def5] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x355
      V [libjvm.so+0x54ca18] JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*)+0x28
      V [libjvm.so+0x5102aa] instanceKlass::call_class_initializer(Thread*)+0xca
      V [libjvm.so+0x510504] instanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x234
      V [libjvm.so+0x51094a] instanceKlass::initialize(Thread*)+0x6a
      V [libjvm.so+0x6663d6] LinkResolver::resolve_static_call(CallInfo&, KlassHandle&, Symbol*, Symbol*, KlassHandle, bool, bool, Thread*)+0x116
      V [libjvm.so+0x666536] LinkResolver::resolve_invokestatic(CallInfo&, constantPoolHandle, int, Thread*)+0xe6
      V [libjvm.so+0x547635] InterpreterRuntime::resolve_invoke(JavaThread*, Bytecodes::Code)+0x165
      j java.lang.String.<clinit>()V+3
      v ~StubRoutines::call_stub
      V [libjvm.so+0x54def5] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x355
      V [libjvm.so+0x54ca18] JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*)+0x28
      V [libjvm.so+0x5102aa] instanceKlass::call_class_initializer(Thread*)+0xca
      V [libjvm.so+0x510504] instanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x234
      V [libjvm.so+0x51094a] instanceKlass::initialize(Thread*)+0x6a
      V [libjvm.so+0x864c2a] Threads::create_vm(JavaVMInitArgs*, bool*)+0x42a
      V [libjvm.so+0x55f9f4] JNI_CreateJavaVM+0x74
      C [libjli.so+0x337e] JavaMain+0x9e

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j com.sun.tdk.jcov.runtime.Collect.enableCounts()V+2
      j com.sun.tdk.jcov.runtime.Collect.<clinit>()V+20
      v ~StubRoutines::call_stub
      j java.lang.String.<clinit>()V+3
      v ~StubRoutines::call_stub
      Here is the crashing call stack from hs_err_pid11199.log:

      Stack: [0xf6bee000,0xf6c3f000], sp=0xf6c3cce8, free space=315kNative frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)V [libjvm.so+0xa3834] BiasedLocking::revoke_and_rebias(Handle, bool, Thread*)+0x24V [libjvm.so+0x429593] ObjectSynchronizer::fast_enter(Handle, BasicLock*, bool, Thread*)+0x43
      V [libjvm.so+0x261905] instanceRefKlass::acquire_pending_list_lock(BasicLock*)+0x55
      V [libjvm.so+0x48e904] VM_GC_Operation::doit_prologue()+0x14V [libjvm.so+0x4975e1] VMThread::execute(VM_Operation*)+0x161V [libjvm.so+0x177918] GenCollectorPolicy::mem_allocate_work(unsigned int, bool, bool*)+0x1c8
      V [libjvm.so+0x220452] GenCollectedHeap::mem_allocate(unsigned int, bool*)+0x22
      V [libjvm.so+0x469865] typeArrayKlass::allocate_common(int, bool, Thread*)+0x225V [libjvm.so+0x3983f3] oopFactory::new_typeArray(BasicType, int, Thread*)+0x23V [libjvm.so+0x270ef3] InterpreterRuntime::newarray(JavaThread*, BasicType, in
      t)+0x33j com.sun.tdk.jcov.runtime.Collect.enableCounts()V+2
      j com.sun.tdk.jcov.runtime.Collect.<clinit>()V+20v ~StubRoutines::call_stub
      V [libjvm.so+0x27a5f5] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaC
      allArguments*, Thread*)+0x315V [libjvm.so+0x39fb59] os::os_exception_wrapper(void (*)(JavaValue*, methodHan
      dle*, JavaCallArguments*, Thread*), JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x19
      V [libjvm.so+0x27940f] JavaCalls::call(JavaValue*, methodHandle, JavaCallArgum
      ents*, Thread*)+0x2f
      V [libjvm.so+0x250fc2] instanceKlass::call_class_initializer(Thread*)+0xc2V [libjvm.so+0x251a25] instanceKlass::initialize_impl(instanceKlassHandle, Thr
      ead*)+0x1c5V [libjvm.so+0x251e0b] instanceKlass::initialize(Thread*)+0x5b
      V [libjvm.so+0x335aba] LinkResolver::resolve_static_call(CallInfo&, KlassHandle&, Symbol*, Symbol*, KlassHandle, bool, bool, Thread*)+0xfaV [libjvm.so+0x335c04] LinkResolver::resolve_invokestatic(CallInfo&, constantP
      oolHandle, int, Thread*)+0xc4V [libjvm.so+0x273c67] InterpreterRuntime::resolve_invoke(JavaThread*, Bytecod
      es::Code)+0x157
      j java.util.Vector.<init>()V+3j java.lang.ClassLoader.<clinit>()V+14
      v ~StubRoutines::call_stub
      V [libjvm.so+0x27a5f5] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x315
      V [libjvm.so+0x39fb59] os::os_exception_wrapper(void (*)(JavaValue*, methodHan
      dle*, JavaCallArguments*, Thread*), JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x19
      V [libjvm.so+0x27940f] JavaCalls::call(JavaValue*, methodHandle, JavaCallArgum
      ents*, Thread*)+0x2f
      V [libjvm.so+0x250fc2] instanceKlass::call_class_initializer(Thread*)+0xc2
      V [libjvm.so+0x251a25] instanceKlass::initialize_impl(instanceKlassHandle, Thr
      ead*)+0x1c5
      V [libjvm.so+0x251e0b] instanceKlass::initialize(Thread*)+0x5b
      V [libjvm.so+0x335aba] LinkResolver::resolve_static_call(CallInfo&, KlassHandl
      e&, Symbol*, Symbol*, KlassHandle, bool, bool, Thread*)+0xfa
      V [libjvm.so+0x279f98] JavaCalls::call_static(JavaValue*, KlassHandle, Symbol*, Symbol*, Handle, Handle, Thread*)+0x88
      V [libjvm.so+0x381c6d] NativeLookup::lookup_style(methodHandle, char*, char const*, int, bool, bool&, Thread*)+0x2dd
      V [libjvm.so+0x381d38] NativeLookup::lookup_entry(methodHandle, bool&, Thread*)+0x68
      V [libjvm.so+0x382221] NativeLookup::lookup_base(methodHandle, bool&, Thread*)
      +0x41V [libjvm.so+0x382307] NativeLookup::lookup(methodHandle, bool&, Thread*)+0x47
      V [libjvm.so+0x270fcb] InterpreterRuntime::prepare_native_call(JavaThread*, methodOopDesc*)+0x7b
      j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;)
      Ljava/lang/Object;+0
      j java.lang.reflect.AccessibleObject.<clinit>()V+19v ~StubRoutines::call_stub
      V [libjvm.so+0x27a5f5] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x315V [libjvm.so+0x39fb59] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle*, JavaCallArguments*, Thread*), JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x19
      V [libjvm.so+0x27940f] JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*)+0x2f
      V [libjvm.so+0x250fc2] instanceKlass::call_class_initializer(Thread*)+0xc2
      V [libjvm.so+0x251a25] instanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x1c5
      V [libjvm.so+0x251e0b] instanceKlass::initialize(Thread*)+0x5b
      V [libjvm.so+0x251c79] instanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x419
      V [libjvm.so+0x251e0b] instanceKlass::initialize(Thread*)+0x5b
      V [libjvm.so+0x251c79] instanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x419
      V [libjvm.so+0x251e0b] instanceKlass::initialize(Thread*)+0x5b
      V [libjvm.so+0x45772d] initialize_class(Symbol*, Thread*)+0x3d
      V [libjvm.so+0x460a2b] Threads::create_vm(JavaVMInitArgs*, bool*)+0x6fb
      V [libjvm.so+0x28c1ec] JNI_CreateJavaVM+0x5c
      C [libjli.so+0x2a71] JavaMain+0xa1
      C [libpthread.so.0+0x6d25] start_thread+0xc5

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j com.sun.tdk.jcov.runtime.Collect.enableCounts()V+2
      j com.sun.tdk.jcov.runtime.Collect.<clinit>()V+20
      v ~StubRoutines::call_stub
      j java.util.Vector.<init>()V+3
      j java.lang.ClassLoader.<clinit>()V+14
      v ~StubRoutines::call_stub
      j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object;+0
      j java.lang.reflect.AccessibleObject.<clinit>()V+19
      v ~StubRoutines::call_stub

        Attachments

          Activity

            People

            Assignee:
            sjohanss Stefan Johansson
            Reporter:
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: