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

Gerard Ziemski gziemski at openjdk.org
Tue Sep 10 21:11:06 UTC 2024


On Tue, 10 Sep 2024 15:29:50 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix PATH_MAX on Windows, use check_only for record_coredump_status
>
> The name of the core dump file is not that useful, and it is potentially confusing since it appears to the casual analyst as if there is a core file somewhere. Moreover, with Linux and core dump crash demons, the printed name is often wrong, at least in my experience.
> 
> It is useful to check, at VM start, whether cores would be prevented were they to happen, but only if the caller is interested in core files. But in that case, a timid info in some log is not useful. Nobody but you will probably remember this code exists, let alone activating the log and looking for the info.
> 
> If the user really wants core dumps, it would be better to check ulimit at startup and do a clear unconditional warning() or even an vm_exit_during_initialization(). But we should not do this if the limit is large enough, even if it is not unlimited. E.g. many customers set core file limits to something like 4g or somesuch. If the VM was started with 128MB, we will probably reach the 4G.
> 
> Proposal:
> - if both `CreateCoredumpOnCrash`=1 *and* it had been explicitly enabled at the command line, write an unconditional warning using the warning() function if it looks like core files would be prevented
> - Even if limit is not unlimited, don't warn for cases where limit is high enough for the current projected footprint. Can be a simple logic depending on max heap size, e.g. max heap size * 4.
> - The future core file name is unimportant since we will print it out anyway when we crash. If you remove that part, the patch becomes a lot simpler, since it would be limited to an ulimit check at startup if `CreateCoredumpOnCrash=1`.
> 
> 
> Just my 5 cents,
> 
> Cheers, Thomas

> > @tstuefe Can you please take a look?
> > I adopted the name you suggested (back in 2015) and made changes to make both POSIX and Windows impl be more alike.
> 
> I have no idea what you refer to, but then, this is ancient history :)
> 
> sure, I take a look

Sorry, it was pointed out earlier in the PR. David remembered your comment in  https://mail.openjdk.org/pipermail/hotspot-runtime-dev/2015-March/014356.html and pointed it out to me.

Thank you for your feedback!

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

PR Comment: https://git.openjdk.org/jdk/pull/20734#issuecomment-2342013152


More information about the hotspot-runtime-dev mailing list