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

David Holmes dholmes at openjdk.org
Fri Dec 23 01:18:34 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.

David Holmes has updated the pull request incrementally with one additional commit since the last revision:

  Move assertion and make clear print_jni_stack is only for current thread.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11703/files
  - new: https://git.openjdk.org/jdk/pull/11703/files/4144c6f1..6c3319af

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11703&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11703&range=02-03

  Stats: 4 lines in 2 files changed: 1 ins; 1 del; 2 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