hyperic / sigar

System Information Gatherer And Reporter

Home Page:http://sigar.hyperic.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jvm crashes when using org.hyperic.sigar.Sigar.getCpuPercList to get the cpu info

forestlier opened this issue · comments

when I use Sigar.getCpuPercList to get cpu infos , JVM crashed.
the cpu number of PC is 48.
please help to check this issue.
the following is the crash info:
--------------- T H R E A D ---------------

Current thread (0x0000000884262000): JavaThread "unibi-alarm-cpuUsageSensor-1" daemon [_thread_in_native, id=8536, stack(0x000000088c7e0000,0x000000088c820000)]

siginfo: ExceptionCode=0xc0000005, reading address 0xffffffff8cbb1d68

Registers:
RAX=0xffffffff8cbb1c30, RBX=0x000000088c541c38, RCX=0x00000008842621f8, RDX=0x000000088c81ed90
RSP=0x000000088c81ec00, RBP=0x000000088c81ed70, RSI=0x000000084447c2e8, RDI=0x0000000000000000
R8 =0x0000000000000062, R9 =0x000000084447bf40, R10=0x00000000000003cc, R11=0x0000000069a82538
R12=0x0000000886fea550, R13=0x000000088c541c30, R14=0x000000088c81ed90, R15=0x0000000884262000
RIP=0x000000088c6b4ed4, EFLAGS=0x0000000000010286

Top of Stack: (sp=0x000000088c81ec00)
0x000000088c81ec00: 00000008842621f8 000000088c81ed90
0x000000088c81ec10: 000000088c81ecd0 000000006944c4a7
0x000000088c81ec20: ffffffff8cbb1c30 000000088c541c30
0x000000088c81ec30: 0000000886fea550 000000088c6c2718
0x000000088c81ec40: 00000008842621f8 000000088c81ed90
0x000000088c81ec50: 000000088c541c38 000000088c81ed70
0x000000088c81ec60: 000000088c541c38 000000088c81ed90
0x000000088c81ec70: 00000008813d42b0 000000006932ba36
0x000000088c81ec80: 00000008868b7038 0000000884262000
0x000000088c81ec90: 000000088c541c38 000000006939d0c4
0x000000088c81eca0: 000000088c541c38 0000000884262000
0x000000088c81ecb0: 000000088c541c38 0000000884262000
0x000000088c81ecc0: 0000000000000000 00000000016e8bd7
0x000000088c81ecd0: 000000088c81f400 0000000884262000
0x000000088c81ece0: 000000088c541c38 000000084447c2e8
0x000000088c81ecf0: 0000000000000000 00000000016e8d67

Instructions: (pc=0x000000088c6b4ed4)
0x000000088c6b4eb4: 7c 24 20 00 75 15 48 8d 15 df 58 04 00 48 8b 4c
0x000000088c6b4ec4: 24 40 e8 45 00 00 00 33 c0 eb 32 48 8b 44 24 20
0x000000088c6b4ed4: 83 b8 38 01 00 00 00 74 1f 48 8b 44 24 20 44 8b
0x000000088c6b4ee4: 80 38 01 00 00 48 8b 54 24 20 48 8b 4c 24 40 e8

Register to memory mapping:

RAX=0xffffffff8cbb1c30 is an unknown value
RBX={method} {0x000000088c541c40} 'getCpuListNative' '()[Lorg/hyperic/sigar/Cpu;' in 'org/hyperic/sigar/Sigar'
RCX=0x00000008842621f8 is an unknown value
RDX=0x000000088c81ed90 is pointing into the stack for thread: 0x0000000884262000
RSP=0x000000088c81ec00 is pointing into the stack for thread: 0x0000000884262000
RBP=0x000000088c81ed70 is pointing into the stack for thread: 0x0000000884262000
RSI=0x000000084447c2e8 is an oop
java.lang.Thread

  • klass: 'java/lang/Thread'
    RDI=0x0000000000000000 is an unknown value
    R8 =0x0000000000000062 is an unknown value
    R9 =0x000000084447bf40 is an oop
    org.hyperic.sigar.Sigar
  • klass: 'org/hyperic/sigar/Sigar'
    R10=0x00000000000003cc is an unknown value
    R11=0x0000000069a82538 is an unknown value
    R12=0x0000000886fea550 is an unknown value
    R13=0x000000088c541c30 is pointing into metadata
    R14=0x000000088c81ed90 is pointing into the stack for thread: 0x0000000884262000
    R15=0x0000000884262000 is a thread

Stack: [0x000000088c7e0000,0x000000088c820000], sp=0x000000088c81ec00, free space=251k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [sigar-amd64-winnt.dll+0x14ed4]
C [sigar-amd64-winnt.dll+0x22718]
C 0x00000000016e8d67

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.hyperic.sigar.Sigar.getCpuListNative()[Lorg/hyperic/sigar/Cpu;+0
j org.hyperic.sigar.Sigar.getCpuList()[Lorg/hyperic/sigar/Cpu;+1
j org.hyperic.sigar.Sigar.getCpuPercList()[Lorg/hyperic/sigar/CpuPerc;+8
j com.huawei.unibi.alarm.sensor.impl.CPUUsageCollector.getCpuUsage()F+11
j com.huawei.unibi.alarm.sensor.impl.CPUUsageAlarmSensor$CPUAlarm.getCpuUsage()F+4
j com.huawei.unibi.alarm.sensor.impl.CPUUsageAlarmSensor$CPUAlarm.updateCPUUsage()V+79
j com.huawei.unibi.alarm.sensor.impl.CPUUsageAlarmSensor$CPUAlarm.run()V+1
j java.util.concurrent.Executors$RunnableAdapter.call()Ljava/lang/Object;+4
j java.util.concurrent.FutureTask.runAndReset()Z+47
j java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Ljava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;)Z+1
j java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run()V+37
j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+95
j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub

commented

Did you find any solution for this?

I have a similar crash with libsigar 1.6.4 with OpenJDK 11.0.4:

jvm 5 | #
jvm 5 | # A fatal error has been detected by the Java Runtime Environment:
jvm 5 | #
jvm 5 | # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000010014ed4, pid=12784, tid=7888
jvm 5 | #
jvm 5 | # JRE version: OpenJDK Runtime Environment (11.0.4+11) (build 11.0.4+11)
jvm 5 | # Java VM: OpenJDK 64-Bit Server VM (11.0.4+11, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
jvm 5 | # Problematic frame:
jvm 5 | # C [sigar-amd64-winnt.dll+0x14ed4]

Here is a part of the stack-trace:

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.hyperic.sigar.Sigar.getCpuInfoList()[Lorg/hyperic/sigar/CpuInfo;+0
v ~StubRoutines::call_stub
j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@11.0.4
j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@11.0.4
j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@11.0.4
j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@11.0.4
j org.hyperic.sigar.Humidor$MyHandler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+14
j com.sun.proxy.$Proxy0.getCpuInfoList()[Lorg/hyperic/sigar/CpuInfo;+9

I can provide the full JVM crash log.

In my case, it happens some time only

`Stack: [0x00007f0b5b1eb000,0x00007f0b5b2ec000], sp=0x00007f0b5b2e92d0, free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libsigar-amd64-linux.so+0x132bd] Java_org_hyperic_sigar_CpuPerc_gather+0x2ed

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.hyperic.sigar.CpuPerc.gather(Lorg/hyperic/sigar/Sigar;Lorg/hyperic/sigar/Cpu;Lorg/hyperic/sigar/Cpu;)V+0
j org.hyperic.sigar.CpuPerc.fetch(Lorg/hyperic/sigar/Sigar;Lorg/hyperic/sigar/Cpu;Lorg/hyperic/sigar/Cpu;)Lorg/hyperic/sigar/CpuPerc;+12
j org.hyperic.sigar.Sigar.getCpuPerc()Lorg/hyperic/sigar/CpuPerc;+37
j com.sumologic.index.metrics.IndexerMetricsProtocolHandler.processMetrics()Lcom/sumologic/index/metrics/ProcessMetrics;+16
j com.sumologic.index.metrics.IndexerMetricsProtocolHandler.getMetrics()Lcom/sumologic/index/metrics/api/Metrics;+5
v ~StubRoutines::call_stub`

do we know fix