what should I do when Java core dumps? - java

This is the first time I am in this situation with Java.
Java just core dumps with the following error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
[thread 140213457409792 also had an error]# Internal Error (safepoint.cpp:300), pid=4327
, tid=140213211031296
# guarantee(PageArmed == 0) failed: invariant
#
# JRE version: 6.0_24-b24
# Java VM: OpenJDK 64-Bit Server VM (20.0-b12 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea6 1.11.4
# Distribution: Ubuntu 12.04 LTS, package 6b24-1.11.4-1ubuntu0.12.04.1
# An error report file with more information is saved as:
# /tmp/hs_err_pid4327.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
# https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
when I tried running it on a mac os, it core dumps at the same place (the JREs must be different)... so it must be something related to the code. I have no idea how to debug this, this is not an exception, and the log file specified up there does not give me much information. Any ideas what I can do about it to find the bug?

The /tmp/hs_err_pid4327.log file should contain a stack trace of where the core occurred. Unless you are making a JNI call, it is probably a Java bug.

The core dump is telling what you should do...
If you would like to submit a bug report, please include
instructions how to reproduce the bug and visit:
https://bugs.launchpad.net/ubuntu/+source/openjdk-6/

A quick look makes me think this is already reported.
The bug probably isn't in your code, per se. It's most likely an environmental issue - perhaps a JVM bug, perhaps some unusual condition, and most likely, both - a bug that occurs rarely, under an odd circumstance.
Google for the key elements in the message (e.g. "safepoint.cpp:100"), look at the other reports, and look for things you have in common or workarounds that may apply. In this case, one set of reports suggests that heavy multithreading may contribute to the problem.

Check if you have a hprof file in your application directory. Optionally you could dump at will using
jmap -dump:file=<file_name> <pid>
and then analyze the dump using MAT http://www.eclipse.org/mat/
You could also consider other tools quoted here :
Tool for analyzing java core dump

Related

JVM 8 SIGSEGV: which could be the cause?

I received this error after more than 2 years of continous running without any problem:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fc4ec043340, pid=1143, tid=0x00007fc4bcb85700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_102-b14) (build 1.8.0.102-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.102-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C 0x00007fc4ec043340
#
# Core dump written. Default location: /home/fportal/jaxx/leo/tomcat-7.0.42/bin/core or core.1143
#
# An error report file with more information is saved as:
# /home/fportal/jaxx/leo/tomcat-7.0.42/bin/hs_err_pid1143.log
Compiled method (c1) -1570440943 731555909 ! 1 java.text.SimpleDateFormat::subParse (1765 bytes)
Any thoughts on which could be the cause?
You have encountered a core dump:
computer program at a specific time, generally when the program has crashed or otherwise terminated abnormally
For your question: What is the root cause ?, the main issue when 2 years of continous running is a patch that has upgraded a library or the kernel (operating system), that your software, being older, doesn't know about.
So, you will have to upgrade your system with the latest, probably upgrading Apache Tomcat and or JRE (Java).
The specific issue that you've hit here is a segmentation fault when running a Java method which has been compiled; in this case, java.text.SimpleDateFormat::subParse. It's probably an error caused by a compilation of that code to native code and there being an error in that generation.
Given that the date parsing can be complex (e.g. TimeZone IDs, positive/negative offsets) it's likely it was triggered by a date format being passed in with dodgy value that would otherwise cause a NullPointerException in Java but was already compiled at a C2 level and some compilation/inlining failure has resulted in an unhandled SIGSEV.
If you find out how to reproduce it then you can raise a bug with the logs that might give a clue, but being able to reproduce it might not be practical.
Lastly, as others have noted, upgrading the JVM will get you further benefits and other fixes, so it's something worth considering.

PyLucene error with IceTea / JDK / JRE

I have followed the installation instructionrs http://bendemott.blogspot.de/2013/11/installing-pylucene-4-451.html for pylucene using the latest pylucene-4.9.0.0.
And when i tried to to lucene.initVM(), I get the following error:
alvas#ubi:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lucene
>>> lucene.initVM()
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007ffba22808b8, pid=5189, tid=140718811092800
#
# JRE version: OpenJDK Runtime Environment (7.0_65-b32) (build 1.7.0_65-b32)
# Java VM: OpenJDK 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 2.5.3
# Distribution: Ubuntu 14.04 LTS, package 7u71-2.5.3-0ubuntu0.14.04.1
# Problematic frame:
# V [libjvm.so+0x6088b8] jni_RegisterNatives+0x58
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/alvas/hs_err_pid5189.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
# http://icedtea.classpath.org/bugzilla
#
Aborted (core dumped)
And the file http://pastebin.com/6B8FyC4Z
Is there something wrong with my IceTea configuration? or my JDK? or JRE?
How should I resolve the problem?
So I took a look at your stack trace, and I don't think the issue was specifically pyLucene. In the stack trace, you see this error:
siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x0000000000000000
If you look at the first part, SIGSEGV, that means you have a segmentation fault somewhere in your system. SEGV_MAPERR is the specific error, which means that OpenJDK was trying to map memory to an object and failed. This could've been caused by not enough memory, a bad pagefile/virtual memory, bad address space, or even a bad library. Why it worked on another machine could be anything. Core dumps are really useful, so if you can run
ulimit -c unlimited
that will help give you something to look at. Was this in a VM or on a physical machine? I've seen random sigsegv in my Ubuntu VMs if they don't have enough memory allocated for various Java tasks. I saw this on my ESXi hypervisors specifically, and I noticed it the most was when ESXi started to perform memory swapping. I was able to resolve this by increasing memory, rebooting the VM, and making sure my hypervisor wasn't swapping memory. Let me know if that helps. :)
Edit: I also noticed that if the underlying storage provider had poor performance, that would impact with swap data and I feel that was also am impact with sigsegv issues.

An unexpected error has been detected by HotSpot Virtual Machine

I am trying to process an excel file.but i am encountering following problem
An unexpected error has been detected by HotSpot Virtual Machine:
SIGSEGV (0xb) at pc=0x68efbaf4, pid=15849, tid=4149892800
Java VM: Java HotSpot(TM) Server VM (1.5.0_22-b03 mixed mode)
Problematic frame:
C [libclntsh.so.10.1+0x1beaf4] kpuhhalpuc+0x43a
An error report file with more information is saved as hs_err_pid15849.log
If you would like to submit a bug report, please visit:
http://java.sun.com/webapps/bugreport/crash.jsp
/opt/Migration/run.sh: line 9: 15849 Aborted $JAVA_HOME/bin/java -Djava.library.path=/opt/oracle/oracle/product/10.2.0/db_3/lib32 -classpath $CLSPTH -Xmx2048M packagename.classname
can anybody help me.
This means the Java runtime has a severe bug (it tried to access memory of other processes) and your application has somehow triggered it.
The next step is to see which shared libraries you have added to the process. Maybe there are newer versions.
If you use Oracle, use the pure Java thin client instead of OCI.
Maybe you have found a real bug in your version of Java. Try to upgrade to the latest version. If that doesn't help, file a bug report.
I got the similar issue. I was able to fix it. HotSpot Virtual Machine tries to access memory of other processes. Make sure you use same JVM for build compile and also your eclipse is using the same JVM as you build tool.
I got same problem, but resolved by following below steps:
Right click on project, select build path
Remove java jre library
again add the default java library
clean and publish the server

Fatal error detected in Eclipse when using Xuggle

I was trying to get frames from a video using Xuggle 5.4. The IDE which I use is Eclipse Juno.The last time (which was roughly one months back) when I tried, I got the frames with a gap of 5 seconds, but today when I tried to run the code I got the below error
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006ee76520, pid=4340, tid=7344
#
# JRE version: 7.0_09-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.5-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [xuggle1062976990104623257.dll+0x736520] Java_com_xuggle_ferry_FerryJNI_SWIGRefCountedTesterUpcast+0x66f005
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\Eclipse workspaces\Eclipse Juno\VideoSteganography\hs_err_pid4340.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
When I googled this, I found similar similar problems, but i failed to get any solution or cause for this problem.
What may be the reason for this? I am not able to find the native code which is the cause for the crash. I used to update Java whenever available.
My need is to get the frames from a video file, what other ways are there to get this done? Feel free to ask for detail.
I had to switch to the 32Bit of JRE7 than it work again.
Problem was with Java7 updates. I just rolled back to Java6. Now it works fine for me now

Java Application Crash

I have been working on a large java application. It is quite parallel, and uses several fixedThreadPools (each with 8 threads). I am running it on a computer with 2 cores, each with 4 processors. My program is analyzing large sets of data, and the analysis is saved (serialized) after every set, though it works across data sets, and so is re-loaded every time I run a new one (and then saved).
My problem is this: after running 4-5 data sets (takes about 2 days, and I'm pretty happy with my coding efficiency) it will crash, after exactly the same amount of time on the 5th set (no matter which data set I use). The program is repetitive, and so there is nothing new in the code going on at this time. It is reproducible, and I am not sure what to do. I can post the full error log if that would help... I understand that this problem is ambiguous without a lot more detailed information, but if there are any go-to suggestions, it would be greatly appreciated.
I have been testing different settings to see if anything helps, and right now I am running with the following arguments.
-Xmx6g -Xmx12g -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC
Thanks,
Joe
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000000000000, pid=18454, tid=140120548144896
#
# JRE version: 7.0_03-b147
# Java VM: OpenJDK 64-Bit Server VM (22.0-b10 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea7 2.1.1pre
# Distribution: Ubuntu precise (development branch), package 7~u3-2.1.1~pre1-1ubuntu2
# Problematic frame:
# C 0x0000000000000000
#
# 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 include
# instructions on how to reproduce the bug and visit:
# https://bugs.launchpad.net/ubuntu/+source/openjdk-7/
#
Just a hard guess...
Might be it is not able to create more files
if you are running this in linux Try running
ulimit -c unlimited
Before you run your java program... This should help in two ways
It should increase the file creation limit
If any error occurs it will create the Core dump.
See how many file IO it is using while the program is running.
I'd instrument it with something like Visual VM. It'll show what's happening in memory, threads, CPU, objects created, etc. in real time as your app runs.
The nice version that I have is for Oracle/Sun JVMs only. There's one that ships with the JDK, but I don't believe it shows as much detail as the version 1.6.3 with all plugins installed.
Just add -Dorg.eclipse.swt.browser.DefaultType=mozilla in eclipse.ini file .

Categories

Resources