On Mon, 13 Apr 2026 15:52:11 GMT, Shiv Shah <[email protected]> wrote:

> Fixed three test files that fail with -Xcheck:jni on debug builds:
> 
> popframe007.cpp: CallStaticVoidMethod in native B() was called with the 
> declaring class (popframe007) instead of TestThread where the method ID 
> belongs. Stored TestThread class as a global ref in getReady() and used it in 
> B()
> 
> aod.cpp: nsk_aod_agentLoaded() and nsk_aod_agentFinished() call 
> CallStaticVoidMethod without checking for pending exceptions. Added 
> nsk_aod_checkJNIException wrapper that describes, clears, and fails on 
> unexpected exceptions. Fixes all 13 AttachOnDemand tests
> 
> retransform003.cpp: ClassFileLoadHook callback calls CallObjectMethod and 
> CallStaticObjectMethod without checking for pending exceptions. Added 
> ExceptionCheck/ExceptionClear after both calls
> 
> bi02t001 and bi03t001 pass without changes, NMT corruption issue from JDK 22 
> appears resolved on JDK 27
> 
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Changes requested by dholmes (Reviewer).

test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/retransform003.cpp
 line 117:

> 115: 
> 116:     if (jni->ExceptionCheck()) {
> 117:         jni->ExceptionClear();

If this code returns to Java (I can't tell easily) then we should not clear the 
exception. Otherwise we should use `ExceptionDescribe` as you do below so that 
we know that something has gone wrong in the test.

test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/retransform003.cpp
 line 131:

> 129: 
> 130:     if (jni->ExceptionCheck()) {
> 131:         jni->ExceptionClear();

Ditto

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

PR Review: https://git.openjdk.org/jdk/pull/30711#pullrequestreview-4103467903
PR Review Comment: https://git.openjdk.org/jdk/pull/30711#discussion_r3077238653
PR Review Comment: https://git.openjdk.org/jdk/pull/30711#discussion_r3077239298

Reply via email to