RFR: 8295974: jni_FatalError and Xcheck:jni warnings should print the native stack when there are no Java frames

David Holmes dholmes at openjdk.org
Fri Dec 16 07:16:05 UTC 2022


If a JNI Fatal error, or a JNI warning (from Xcheck:jni) is triggered in "top-level" native code (such as the launcher itself, or a freshly attached native thread) then there is no stack printed as there are no Java frames. This enhancement changes that so that we print the native stack, similarly to how error reporting does. We reuse VMError::print_native _stack to do this, but it could be argued this should be moved to a more general purpose utility class - suggestions welcome.

Testing:
  - manual fault injection (see bug report)
  - tiers 1-4

Thanks.

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

Commit messages:
 - Remove unnecessary include
 - 8295974: jni_FatalError and Xcheck:jni warnings should print the native stack when there are no Java frames
 - Merge branch 'master' into 8295974-jni-fatal-native
 - Interim commit with alternate code options.

Changes: https://git.openjdk.org/jdk/pull/11703/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11703&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8295974
  Stats: 30 lines in 2 files changed: 16 ins; 9 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/11703.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11703/head:pull/11703

PR: https://git.openjdk.org/jdk/pull/11703


More information about the hotspot-dev mailing list