RFR: 8338883: Show warning when CreateCoredumpOnCrash set, but core dump will not happen [v11]

Gerard Ziemski gziemski at openjdk.org
Wed Sep 25 18:15:21 UTC 2024


> 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 19 additional commits since the last revision:

 - Merge remote-tracking branch 'upstream/master' into JDK-8338883
 - fix test on Windows
 - Merge remote-tracking branch 'upstream/master' into JDK-8338883
 - fix Windows compile err
 - re-do
 - use warning to show when core dump is not going to happen
 - fix PATH_MAX on Windows, use check_only for record_coredump_status
 - fix bufferSize name
 - white space
 - windows issue
 - ... and 9 more: https://git.openjdk.org/jdk/compare/fe0804ca...533ca4d6

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20734/files
  - new: https://git.openjdk.org/jdk/pull/20734/files/5f66c662..533ca4d6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20734&range=10
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20734&range=09-10

  Stats: 2085 lines in 54 files changed: 1960 ins; 53 del; 72 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