RFR: 8338883: Show warning when CreateCoredumpOnCrash set, but core dump will not happen [v6]
Gerard Ziemski
gziemski at openjdk.org
Mon Sep 23 18:59:51 UTC 2024
On Sat, 14 Sep 2024 00:22:22 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:
>> We add a small feature, which prints a warning if user explicitly requests `CreateCoredumpOnCrash`, but it's disabled on the os level.
>>
>> Example:
>>
>>
>> # ulimit -c 0
>> # ./build/xcode/build/jdk/bin/java -XX:+CreateCoredumpOnCrash -version
>> OpenJDK 64-Bit Server VM warning: CreateCoredumpOnCrash specified, but Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
>> openjdk version "24-internal" 2025-03-18
>> OpenJDK Runtime Environment (build 24-internal-adhoc.gerard.jdk)
>> OpenJDK 64-Bit Server VM (build 24-internal-adhoc.gerard.jdk, mixed mode, sharing)
>>
>> # ulimit -c 1024
>> # ./build/xcode/build/jdk/bin/java -XX:+CreateCoredumpOnCrash -version
>> OpenJDK 64-Bit Server VM warning: CreateCoredumpOnCrash specified, but /cores/core.66547 (max size 512 k). To ensure a full core dump, try "ulimit -c unlimited" before starting Java again
>> openjdk version "24-internal" 2025-03-18
>> OpenJDK Runtime Environment (build 24-internal-adhoc.gerard.jdk)
>> OpenJDK 64-Bit Server VM (build 24-internal-adhoc.gerard.jdk, mixed mode, sharing)
>>
>> # ulimit -c unlimited
>> # ./build/xcode/build/jdk/bin/java -XX:+CreateCoredumpOnCrash -version
>> openjdk version "24-internal" 2025-03-18
>> OpenJDK Runtime Environment (build 24-internal-adhoc.gerard.jdk)
>> OpenJDK 64-Bit Server VM (build 24-internal-adhoc.gerard.jdk, mixed mode, sharing)
>>
>>
>>
>>
>>
>> Testing:
>> - passes `"MACH5 runtime/ErrorHandling/CreateCoredumpOnCrash.java"`
>> - full MACH5 test in progress...
>
> Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision:
>
> use warning to show when core dump is not going to happen
I redid the changes:
- Made POSIX/Windows code as similar as I could
- Introduced `warn` variable, which keeps track whether we want to print a VM warning at the startup. It differs from `success` in that it is more aggressive and will complain if it detects `ulimit -c` lees than `unlimited`.
- Fleshed out the test more
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20734#issuecomment-2369112797
More information about the hotspot-runtime-dev
mailing list