Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can cause hs_err_pid file not to be created on crash?

Tags:

java

crash

I need to investigate crashes of a Java client application. It's s Swing application, running in Java Web Start environement on Java SE 6 Update 23 on Windows. Unfortunately for some crash cases the hs_err_pid file was not created. It wasn't on the desktop, so I've searched for it on PC and did not find it(there was an old hs_err_pid file on the desktop, for the same application, so it's reasonable to assume the new one should have been created there too). There is no exception in the log in the end, as it usually happens when JVM crashes on Java exception, so it looks like a crash that should result on creation of hs_err_pid file.

Do I need to configure something to make it work? Can the configuration of Dr. Watson affect the creation of hs_err_pid file?

Thanks

We configured Dr' Watson and analyzed the core dump file, which was created after the app crashed again. The error I saw was "Access violation". From the stack trace I was able to see that the crash is caused by exception in a native code of a third party we use. This was enough to delegate the issue to them.

Bottom line:
1. Some Java crashes are not handled as expected by JVM so that hs_err_pid file is not created.
2. Configuring OS to create a core dump can help in those cases, as the crash that is not handled by JVM will be handled by the OS. You'll get less information in this case, still it can be helpful.

like image 975
Leonid B Avatar asked Mar 01 '11 12:03

Leonid B


People also ask

What is Hs_err_pid error?

The text file name starts with hs_err_pid . The following error message appears in the file. Error Message: An unexpected error has been detected by HotSpot Virtual Machine. CAUSE. There could be many reasons for the applet crash.

What happens when JVM crashes?

When the JRockit JVM crashes, it generates a binary crash file ( . core or . mdmp ). By default, the binary crash file contains a copy of the entire JVM process.

What causes Java to crash?

There are various possible reasons for a crash. For example, a crash can occur due to a bug in the Java HotSpot VM, in a system library, in a Java SE library or an API, in application native code, or even in the operating system (OS). External factors, such as resource exhaustion in the OS can also cause a crash.

Can I delete Hs_err_pid?

The file hs_err_pid. mdmp is a memory dump from a process crash. Any process can create this memory dump. You can safely remove them from server if you face any space issue in your environment.


1 Answers

If the crash occurs as the result of a native stack overflow (typically resulting in a SIGSEGV as the application tries to read/write a stack guard page), no hs_err_pid file is generated on many platforms (e.g., Linux) since the process which creates the file cannot complete if you are out of stack space.

like image 169
BeeOnRope Avatar answered Nov 12 '22 21:11

BeeOnRope