RFR: 8338883: Show warning when CreateCoredumpOnCrash set, but core dump will not happen [v14]
Gerard Ziemski
gziemski at openjdk.org
Sat Oct 5 18:38:54 UTC 2024
The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.
----------------------------------------------------------------------
> We add a small feature, which prints a warning if user explicitly requests `CreateCoredumpOnCrash`, but it's disabled on the os level.
>
> This behavior is the same as other VM features that can be turned on by runtime flags, but are unavailable. For example we show `"UseCRC32 specified, but not supported on this CPU"` if `UseCRC32` is set, but unavailable.
>
> Example of output:
>
>
> # 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:
change how we call ulimit, relax the checks to accommodate get_core_path() code paths
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/20734/files
- new: https://git.openjdk.org/jdk/pull/20734/files/6140c609..8534c143
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=20734&range=13
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=20734&range=12-13
Stats: 4 lines in 1 file changed: 1 ins; 2 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/20734.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/20734/head:pull/20734
PR: https://git.openjdk.org/jdk/pull/20734
More information about the hotspot-runtime-dev
mailing list