RFR: 8338883: Add core dump info to -Xlog:os=info
David Holmes
dholmes at openjdk.org
Wed Aug 28 01:14:28 UTC 2024
On Tue, 27 Aug 2024 20:42:48 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:
> We add a small feature, which adds core dump info, which till now was only printed as part of hs_err log file, directly to stdout, when desired using log mechanism, i.e. `-Xlog:os=info`
>
> For example, if we see:
>
> `core dump info: core.28283`
>
> we know all is set up correctly and we can expect a core file if java process crashes. If we see:
>
> `core dump info: Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again`
>
> instead, however, we know that "ulimit -c unlimited" needs to be set.
>
> Testing:
> - passes `"MACH5 runtime/ErrorHandling/CreateCoredumpOnCrash.java"`
> - full MACH5 test in progress...
Sorry, I appreciate the intent here but `os::check_dump_limit` is non-trivial and has a number of side-effects that are only intended for crash reporting. For example on Windows it will actually create a file! And it updates some VMError related status fields.
I think if you really want the basic information here you will need to pass a flag that indicates this is an informational request only and skip some of the actions otherwise undertaken. I'm not sure it is really worth the effort.
It is also not obvious the information you find at startup necessarily reflects what may happen if an actual crash occurs.
-------------
Changes requested by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/20734#pullrequestreview-2264767082
More information about the hotspot-runtime-dev
mailing list