简体   繁体   中英

what should I do when Java core dumps?

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 (eg "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

Parameters.java:6: error: ';' expected my Method("Liam"); ^ Parameters.java:7: error: ';' expected my Method("Jenny"); ^ Parameters.java:8: error: ';' expected my Method("Anja"); ^ Parameters.java:9: error: reached end of file while parsing } ^

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM