RFR: 8338883: Add core dump info to -Xlog:os=info [v2]

David Holmes dholmes at openjdk.org
Thu Aug 29 00:50: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

Changes requested by dholmes (Reviewer).

src/hotspot/os/posix/os_posix.cpp line 147:

> 145:   }
> 146: 
> 147:   VMError::record_coredump_status(buffer, success);

It may cause confusion to set this when the logging query is being run. Ideally this would only be done for the actual dumping case. If you pass a parameter to indicate whether the call is for an actual dump then you can skip this in the logging case, and also fold back `prepare_for_dump` back into to this method.

src/hotspot/share/runtime/os.hpp line 937:

> 935: 
> 936:   // On Posix compatible OS it will simply check core dump limits while on Windows
> 937:   // it will check for a client versions of Windows. Use the caller

s/versions/version/

-------------

PR Review: https://git.openjdk.org/jdk/pull/20734#pullrequestreview-2267483065
PR Review Comment: https://git.openjdk.org/jdk/pull/20734#discussion_r1735434524
PR Review Comment: https://git.openjdk.org/jdk/pull/20734#discussion_r1735432398


More information about the hotspot-runtime-dev mailing list