Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JVM Crashing when use sigar 1.6.4 #22

Closed
peiyanfei opened this issue Oct 23, 2019 · 19 comments
Closed

JVM Crashing when use sigar 1.6.4 #22

peiyanfei opened this issue Oct 23, 2019 · 19 comments
Assignees
Milestone

Comments

@peiyanfei
Copy link

OS: Windows Server 2012 R2 , 64 bit build 9600 (6.3.9600.17415)
JRE: 1.8.0_222-b10 64bit
Native frames:
C [sigar-amd64-winnt.dll+0x14ed4]
C [sigar-amd64-winnt.dll+0x22718]

Java frames:
j org.hyperic.sigar.Sigar.getCpuListNative()[Long/hyperic/sigar/Cpu;+0

I have try some versions:
AdoptOpenJDK Builds:
OpenJDK8U-jre_x64_windows_hotspot_8u192b12 jvm not crash
OpenJDK8U-jre_x64_windows_hotspot_8u222b10 jvm crash
OpenJDK8U-jre_x64_windows_hotspot_8u232b09 jvm crash

OpenJDK upstream builds:
OpenJDK8u-jre_x64_windows_8u232b09 jvm not crash

I think something wrong with the last builds of AdoptOpenJDK.

@karianna
Copy link
Contributor

@peiyanfei - Can you send us the full dump file that occurs when this crash happens?

@peiyanfei
Copy link
Author

@karianna For some reason I cannot support the dump file before,So I write a new test program,it‘s crash too. Can you give me an email address, i will send to it. Thanks.

@peiyanfei
Copy link
Author

The log file: hs_err_pid5980.log

@karianna
Copy link
Contributor

karianna commented Oct 26, 2019

@peiyanfei You can mail me at martijn.verburg AT adoptopenjdk.net

@peiyanfei
Copy link
Author

@karianna I have send the dump file to your email, please check.

@karianna karianna self-assigned this Nov 5, 2019
@sxa sxa transferred this issue from adoptium/temurin-build Dec 6, 2019
@aahlenst
Copy link
Contributor

@karianna Could you extract additional information?

@peiyanfei You wrote something about a test program. Please share so that we can reproduce the problem. Otherwise, we cannot work on it.

@karianna
Copy link
Contributor

@peiyanfei - Apologies I didn't not appear to receive it, what size is that file?

@jloisel
Copy link

jloisel commented Jun 4, 2020

Hi, same issue here with the program available here:
https://github.com/OctoPerf/jmx-agent/releases

Simply run the jar using java.

The dump:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001800156c4, pid=10136, tid=8160
#
# JRE version: OpenJDK Runtime Environment (14.0.1+7) (build 14.0.1+7)
# Java VM: OpenJDK 64-Bit Server VM (14.0.1+7, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [sigar-amd64-winnt.dll+0x156c4]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Utilisateur\Documents\GitHub\jmx-agent\metrics-agent\target\hs_err_pid10136.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

hs_err_pid3428.log
hs_err_pid10136.log

@aahlenst
Copy link
Contributor

aahlenst commented Jun 4, 2020

It crashes in Sigar's native code in various places which indicates that it is a problem with Sigar. However, it does not crash with Red Hat's upstream build. Looking at the output of dumpbin /headers (Section "Optional Header Values", entry "linker version") of the different binaries, the values are as follows:

  • Sigar: 9.0 (VS 2008)
  • Upstream 8u252: 10.0 (VS 2010)
  • AdoptOpenJDK 8u252: 12.0 (VS 2013)

For translating the linker versions to Visual Studio versions, see https://mariusbancila.ro/blog/2015/08/12/version-history-of-vc-mfc-and-atl/.

@karianna Is my conclusion correct that this is most likely toolchain related and the right course of action would be to recompile Sigar?

@jloisel
Copy link

jloisel commented Jun 4, 2020

Try with Java 9+. It works fine with Java 8.

@aahlenst
Copy link
Contributor

aahlenst commented Jun 4, 2020

@jloisel I don't follow. https://github.com/OctoPerf/jmx-agent/releases says the software is only compatible to Java 8. Besides, I just got a crash on 8.

@jloisel
Copy link

jloisel commented Jun 4, 2020

Yeah, I've put the warning because it crashes due to Sigar DLL not working on Java 9+. BEsides, the agent only runs on Windows.

@aahlenst
Copy link
Contributor

aahlenst commented Jun 4, 2020

It's more likely to crash on newer JDKs if it's toolchain related because those are even built with VS 2017.

@karianna karianna added bug Something isn't working and removed Waiting on OP labels Jun 4, 2020
@jloisel
Copy link

jloisel commented Jun 5, 2020

What do you mean by toolchain? There is an open issue in Sigar repo too:
hyperic/sigar#136

On my computer, it works with JDK8 and crashes all the time with JDK9+.

@aahlenst
Copy link
Contributor

I managed to recompile Sigar with the same VS version that we're using (VS 2017). This does not help. Zulu 11.0.7 (built with VS 2017) crashes, too.

Everything indicates that this is a problem within Sigar. I recommend to patch Sigar or to select a tool that is being maintained.

@aahlenst aahlenst added not a jvm bug and removed bug Something isn't working labels Jun 23, 2020
@karianna karianna added this to the June 2020 milestone Jun 23, 2020
@jloisel
Copy link

jloisel commented Jun 23, 2020

There is sadly no alternative to Sigar, but thanks anyway.

@peiyanfei
Copy link
Author

There is sadly no alternative to Sigar, but thanks anyway.
May be use oshi instead.
github.com/oshi

@cnstar9988
Copy link

It is sigar 1.6.4 bug.

hyperic/sigar#141
cnstar9988/sigar@9e5dba8

@abserali786
Copy link

I downloaded another sigar 1.6.4 jar (1.6.4.129 (17.1.2016) release) from below link and placed in specific tool lib path (ServerAgent-2.2.3\lib).., then it worked for me.

https://javalibs.com/artifact/org.hyperic/sigar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants