The process of JVM was killed by an unknown reason

70 Views Asked by At

In the production environment。The process of JVM was killed by an unknown reason. jdk_version:dk1.8.0_66

  1. add jvm params: XX:+UseG1GC -Xmx10g -Xms10g -XX:ErrorFile=/opt/log/error.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/log/dump.log -XX:ConcGCThreads=8 -XX:GCTimeRatio=39 -XX:G1HeapRegionSize=8m -XX:MaxGCPauseMillis=40 -XX:ParallelGCThreads=16 -XX:G1RSetUpdatingPauseTimePercent=40 -XX:MetaspaceSize=512M -XX:MaxMetaspaceSize=1024M -XX:MaxTenuringThreshold=15 -XX:InitiatingHeapOccupancyPercent=70 -XX:-UseBiasedLocking

  2. add ShutdownHook code

    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
             @Override
             public void run() {
                 Map<Thread, StackTraceElement[]> allStackTraces = Thread.getAllStackTraces();
                 allStackTraces.forEach((thread, stackTraceElements) -> {
                     System.out.println("Thread name: " + thread.getName());
                     System.out.println("Thread state: " + thread.getState());
                     System.out.println("Stack Trace:");
                     for (StackTraceElement stackTraceElement : stackTraceElements) {
                         System.out.println("\t" + stackTraceElement);
                     }
                 });
             }
         }));
    

remarks:

  1. When the process does not exist, there is no such file(-XX:ErrorFile=/opt/log/error.log、XX:HeapDumpPath=/opt/log/dump.log)
  2. When the process does not exist, there is no addShutdownHook-code print
  3. dmesg no useful message
  4. /var/log/messages no useful message
  5. When there is no request to access this service, the process will not be killed

how can i deail this problems,give me some ideas

today find the ErrorFile'/opt/log/error.log'


    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  SIGSEGV (0xb) at pc=0x00007fcdbcf3af24, pid=2754, tid=140517509351168
    #
    # JRE version: Java(TM) SE Runtime Environment (8.0_66-b17) (build 1.8.0_66-b17)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.66-b17 mixed mode linux-amd64 compressed oops)
    # Problematic frame:
    # V  [libjvm.so+0x812f24]  PhaseIdealLoop::build_loop_late_post(Node*)+0x144
    #
    # Core dump written. Default location: /opt/log/bin/core or core.2754
    #
    # If you would like to submit a bug report, please visit:
    #   http://bugreport.java.com/bugreport/crash.jsp

  ---------------T H R E A D  ---------------
    Current thread (0x00007fcdba448b60):  JavaThread "C2 CompilerThread2" daemon [_thread_in_native, id=2826, stack(0x00007fccc82ac000,0x00007fccc83ad000)]
    
    siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000008
    
    Registers:
    RAX=0x0000000000000000, RBX=0x00007fccc83a96a0, RCX=0x0000000000000000, RDX=0x0000000000000181
    RSP=0x00007fccc83a7e40, RBP=0x00007fccc83a7e70, RSI=0x0000000000000000, RDI=0x00007fcc6d70bcd0
    R8 =0x0000000000000000, R9 =0x00007fcc6cc0d5c0, R10=0x00007fcc6c64afb0, R11=0x00007fcdbd884b50
    R12=0x00007fcc6c1dd890, R13=0x00007fcc6c242020, R14=0x00007fcc6c64aef8, R15=0x0000000000000451
    RIP=0x00007fcdbcf3af24, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000004
      TRAPNO=0x000000000000000e
    
    Top of Stack: (sp=0x00007fccc83a7e40)
    0x00007fccc83a7e40:   00007fccc83a96c0 00007fccc83a8160
    0x00007fccc83a7e50:   00007fcc6c64aef8 00007fccc83a81a0
    0x00007fccc83a7e60:   0000000000000002 0000000000000451
    0x00007fccc83a7e70:   00007fccc83a7ed0 00007fcdbcf3b4dc
    0x00007fccc83a7e80:   00007fcc00000001 00007fcc6d197af0
    0x00007fccc83a7e90:   00007fccc83a8180 00007fccc83a96a0
    0x00007fccc83a7ea0:   00007fccc83aa050 0000000000000001
    0x00007fccc83a7eb0:   00007fcc6823ff20 00007fccc83a96a0
    0x00007fccc83a7ec0:   0000000000000000 00007fccc83a8180
    0x00007fccc83a7ed0:   00007fccc83a81f0 00007fcdbcf3e4bf
    0x00007fccc83a7ee0:   00007fcd7fffffff 00007fccc83a81a0
    0x00007fccc83a7ef0:   00007fccc83a8160 00017fcdbd19cf44
    0x00007fccc83a7f00:   00007fccc83a96c0 00007fcc00000001
    0x00007fccc83a7f10:   00007fcdba448f70 0000000000000004
    0x00007fccc83a7f20:   00007fcc6d09bdb0 00007fcd00000000
    0x00007fccc83a7f30:   00007fcc6d63a4f0 00007fcc68b68d98
    0x00007fccc83a7f40:   00007fcc6c6484b0 00007fcc6c6484f8
    0x00007fccc83a7f50:   00007fccc83aae50 00007fcdb9b95bb0
    0x00007fccc83a7f60:   ffff803337c58021 00007fcc00004002
    0x00007fccc83a7f70:   0000000000001000 0000000000000200
    0x00007fccc83a7f80:   ffff803337c58001 00007fcc000007ff
    0x00007fccc83a7f90:   00000000000001ff 000000000000003f
    0x00007fccc83a7fa0:   0000009a0000022f 00007fccc83a8000
    0x00007fccc83a7fb0:   0000000000000007 0000000000000000
    0x00007fccc83a7fc0:   0000007700000075 0000000000000000
    0x00007fccc83a7fd0:   00007fccc83a7fff 00007fcc6d145298
    0x00007fccc83a7fe0:   00007fccc83a8c60 00007fcc6d146e80
    0x00007fccc83a7ff0:   00007fcc0000007c 00007fcdbcfab3b9
    0x00007fccc83a8000:   00007fcc6d144f90 00007fcc6c000020
    0x00007fccc83a8010:   0000000000040010 0000000000040010
    0x00007fccc83a8020:   0000000000000000 00007fcc6c000020
    0x00007fccc83a8030:   0000000000007fe8 0000000000007fe8 
    
    Instructions: (pc=0x00007fcdbcf3af24)
    0x00007fcdbcf3af04:   00 00 8b 70 28 49 89 c4 0f 1f 40 00 89 f0 48 8d
    0x00007fcdbcf3af14:   3c c5 00 00 00 00 48 03 bb f0 09 00 00 48 8b 0f
    0x00007fcdbcf3af24:   48 8b 41 08 48 83 38 00 75 2b 8b 73 28 0f 1f 80
    0x00007fcdbcf3af34:   00 00 00 00 8b 41 28 31 c9 39 f0 73 0e 89 c2 48 
    
    Register to memory mapping:
    
    RAX=0x0000000000000000 is an unknown value
    RBX=0x00007fccc83a96a0 is pointing into the stack for thread: 0x00007fcdba448b60
    RCX=0x0000000000000000 is an unknown value
    RDX=0x0000000000000181 is an unknown value
    RSP=0x00007fccc83a7e40 is pointing into the stack for thread: 0x00007fcdba448b60
    RBP=0x00007fccc83a7e70 is pointing into the stack for thread: 0x00007fcdba448b60
    RSI=0x0000000000000000 is an unknown value
    RDI=0x00007fcc6d70bcd0 is an unknown value
    R8 =0x0000000000000000 is an unknown value
    R9 =0x00007fcc6cc0d5c0 is an unknown value
    R10=0x00007fcc6c64afb0 is an unknown value
    R11=0x00007fcdbd884b50: <offset 0x182b50> in /lib64/libc.so.6 at 0x00007fcdbd702000
    R12=0x00007fcc6c1dd890 is an unknown value
    R13=0x00007fcc6c242020 is an unknown value
    R14=0x00007fcc6c64aef8 is an unknown value
    R15=0x0000000000000451 is an unknown value
    
    
        

Stack: [0x00007fccc82ac000,0x00007fccc83ad000],  sp=0x00007fccc83a7e40,  free space=1007k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x812f24]  PhaseIdealLoop::build_loop_late_post(Node*)+0x144
    V  [libjvm.so+0x8134dc]  PhaseIdealLoop::build_loop_late(VectorSet&, Node_List&, Node_Stack&)+0x13c
    V  [libjvm.so+0x8164bf]  PhaseIdealLoop::build_and_optimize(bool, bool)+0x82f
    V  [libjvm.so+0x4a1718]  Compile::Optimize()+0x7f8
    V  [libjvm.so+0x4a2eba]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool)+0x13ca
    V  [libjvm.so+0x3f0748]  C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0x198
    V  [libjvm.so+0x4ad3aa]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xc9a
    V  [libjvm.so+0x4ae356]  CompileBroker::compiler_thread_loop()+0x5d6
    V  [libjvm.so+0xa68fff]  JavaThread::thread_main_inner()+0xdf
    V  [libjvm.so+0xa6912c]  JavaThread::run()+0x11c
    V  [libjvm.so+0x91cc68]  java_start(Thread*)+0x108
    C  [libpthread.so.0+0x7dc5]  start_thread+0xc5
    
    
    Current CompileTask:
    C2: 359581 16441 % !   4       xx.xx.xx.PeixunControlStrategy$PeixunControlTask::call$original$eV7of1XQ @ 385 (622 bytes)

0

There are 0 best solutions below