RFR: 8345422: Fix JNI Checker "in native method" warnings in the debug agent and debugger tests

David Holmes dholmes at openjdk.org
Wed Dec 4 05:40:37 UTC 2024


On Wed, 4 Dec 2024 04:53:08 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c line 56:
>> 
>>> 54:         JNI_FUNC_PTR(env,ExceptionClear)(env); // keep -Xcheck:jni happy
>>> 55:         ERROR_MESSAGE(("JNI Exception occurred calling Module.getName()"));
>>> 56:         EXIT_ERROR(AGENT_ERROR_JNI_EXCEPTION, NULL);
>> 
>> Don't you want to report what the exception was?
>
> That might be nice, but we don't do it in other places where we have this pattern. This call should never fail, thus the "fatal error" approach.

Sure but when it does fail because of a bug the person trying to debug it will lament the fact they don't know what exception was encountered. Seems a little helper function could do the above and call `ExceptionDescribe`. Future RFE I guess.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22528#discussion_r1868747644


More information about the hotspot-runtime-dev mailing list