-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
How to turn on hs_err_* reporting on JVM crashes on MacOS? #834
Comments
By default, the JVM should create this file in the working directory of the process at the time of the crash (or $TEMP). For instance, if you launched your application from the terminal in your home directory, that's where the crash log should be created. However, if the JVM is not creating this file, it may be because it doesn't have write permissions to the directory. You can specify the location where the JVM should create the hs_err_pid file by using the java command-line option
|
That is what I would have thought, too, but that is not what happens. The home directory is in fact where I'm running Java from, but there's no hs_err_* file there after the process crashes. I've even tried running the program from another directory where I know the JVM has write access (because it successfully writes other files to it before it crashes) just in case MacOS has some kind of complex per-program permissions or something on the home directory, but still nothing. I wasn't aware of the It is perhaps worth noting that my crash problem seems to be specific to Apple Silicon, so that's the kind of hardware that I'm testing on, in case that makes a difference. |
In fact, if that really is how it's supposed to work, but not actually how it does work, does that mean I should open a bug report instead of a support request? |
In fact I've searched my whole home directory (with |
We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable. |
@dolda2000 sorry to let this one slip. What version of Mac OS X are you running and what was the location you specified. Was the Java process running as the same user as that location, i.e., would the Java process have permission to write to that location. |
Hi! The version of Mac OS X should be stated in the OP. I don't know exactly what name of OSX v21 corresponds to, but Wikipedia seems to think it's Monterey. Is the JVM supposed to also invoke Mac OS X's own error reporting facility, or is it just taking over for some reason? |
Do you get the crash message from the customer/user on stdout/stderr? It usually has a line saying something like trying to write hs_err_* to a location and can give a hint as to why that's not occuring. |
It's coming from myself, it's just that I don't have permanent access to any Mac hardware, so I'm sneaking into stores and stuff to gain temporary access
It's been a while since I last tried now, but I'm pretty sure it was just silent. Can probably try again within the not-too-distant future if need be, but I'm fairly certain. The way it looks to me, it's just like OSX's crash reporting mechanism was triggering instead of the JVM's own. Would the actual crash report from OSX help in debugging this? I'm attaching it just in case. Perhaps it is something to do with the signal being |
Hmm, that is odd, are you installing Java via the tar.gz archive or a DMG/PKG? Looks like you might be using LWJGL - is this this Minecraft by any chance? |
I'm using the tarball, and no, it's not Minecraft, it's Haven & Hearth. |
I'd try using the package installer and see if that makes a difference (it should add in the correct hooks). |
However, I also just received an error report from a user which looks extremely similar, but indicates a JDK installation path of Is it normal for the JDK to dump both the system error report and the hs_err_* report, or should I assume whenever the system error report gets dumped that there is no hs_err_* report to be found? |
I'll try to give a fuller picture and see if this helps with the diagnosis (it may be a type of crash that doesn't create a log, see below). When Java crashes on macOS, it often produces an However, whether a macOS crash log (typically found in the "Console" application under "User Diagnostic Reports" or "System Diagnostic Reports") is generated in addition to the
In summary, while the presence of an |
As far as I can tell from the MacOS crash log, this crash seems to be what you classify as "Native Code Crash", as it seems to be crashing in AppKit:
Any thoughts on my previous speculation that it might be because the JVM receives |
The JVM does have mechanisms to handle various signals, including
In conclusion, while the JVM does handle |
We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable. |
Just for the record, this is still an issue. I just don't know how to debug it. |
I have been try to find a solution to the issue Dolda mentioned for a while too. Can we keep this issue open for the sake of raising visibility on the issue? @karianna |
I see this is tagged waiting on me, but I'm not sure what it's waiting for. Is there anything I can do to further it? |
I removed that tag :-) |
We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable. |
We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable. |
Question
I've been trying to track down a crash issue that happens on MacOS, but I can't seem to figure out how to make the JVM write hs_err* log files like it does on Windows and Linux. Impractically enough, I don't have any Apple hardware myself, so I find myself only in temporary access at friends and in stores, making it difficult to do any in-depth research at the time.
What happens is that MacOS seems to do its own error reporting, which gives its own log-file, but since MacOS can't decode Java stack frames, this log file isn't nearly as useful as hs_err_* logs have been on other platforms. Is deferring to MacOS' crash handler a deliberate choice, or is it something that is just difficult to avoid for some reason? In the former case, I'd expect there would be some sort of command-line option to re-enable hs_err_* logging, but I have not been able to find it.
Context
Java version: Temurin-17.0.7+7 (build 17.0.7+7)
Your operating system and platform: Darwin 21.1.0 Kernel Version 21.1.0 root:xnu-8019.41.0-1/RELEASE_ARM64_T8101 arm64
The text was updated successfully, but these errors were encountered: