[jdk17u-dev] RFR: 8295974: jni_FatalError and Xcheck:jni warnings should print the native stack when there are no Java frames
Thomas Stuefe
stuefe at openjdk.org
Tue May 16 13:40:05 UTC 2023
On Sat, 6 May 2023 20:58:02 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
> Oracle backported this helpful feature: [JDK-8295974](https://bugs.openjdk.org/browse/JDK-8295974). We should have it, too.
>
> The original change doesn't apply cleanly:
> Manual integration of JtregNativeHotspot.gmk and vmError.hpp was easy.
> JavaThread files don't exist in 17u. I had to integrate into thread.hpp/cpp and take JavaThread::print_jni_stack() from upstream. I have removed the Loom/vthread related parts. Also removed the print_source_info and max stack parameters for print_native_stack which aren't used in 17u.
> Added the required parts of [JDK-8292674](https://bugs.openjdk.org/browse/JDK-8292674) in 2nd commit. That one is not backported because it contains code for Loom.
Just skimmed over this. Pre-existing, and should be fixed in upstream, but is this always guaranteed to run on an attached thread that has an active resource area? Should the buffer not rather allocated from the RA of the thread given ReportJNIFatalError instead from the RA of the current thread?
It would probably be safer to just malloc a buffer.
-------------
PR Comment: https://git.openjdk.org/jdk17u-dev/pull/1328#issuecomment-1549691223
More information about the jdk-updates-dev
mailing list