RFR: 8338883: Add core dump info to -Xlog:os=info [v2]
David Holmes
dholmes at openjdk.org
Thu Aug 29 00:43:19 UTC 2024
On Wed, 28 Aug 2024 20:04:32 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...
>
> Gerard Ziemski has updated the pull request incrementally with two additional commits since the last revision:
>
> - copyright year
> - refactor core dump check code and separate checking from creating core file
There is a lot of history around this code and it is potentially fragile, on some platforms we can't really know for sure whether the core dump will happen and if it does where the file will be, so this is all best-effort. The Windows code was refactored by JDK-8074354 so that the creation of the dump file and the writing of the dump to it became distinct actions, to mirror the way the Posix code worked. The idea being we first check if we can/should do a dump, then do hs_err reporting then finally perform the actual dump if needed.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20734#issuecomment-2316505470
More information about the hotspot-runtime-dev
mailing list