RFR: 8297431: [JVMCI] HotSpotJVMCIRuntime.encodeThrowable should not throw an exception [v2]
Tom Rodriguez
never at openjdk.org
Wed Nov 23 17:01:30 UTC 2022
On Wed, 23 Nov 2022 10:55:13 GMT, Doug Simon <dnsimon at openjdk.org> wrote:
>> src/hotspot/share/jvmci/jvmciEnv.cpp line 321:
>>
>>> 319: jlong buffer = (jlong) NEW_RESOURCE_ARRAY_IN_THREAD_RETURN_NULL(THREAD, jbyte, buffer_size);
>>> 320: if (buffer == 0L) {
>>> 321: decode(THREAD, runtimeKlass, 0L);
>>
>> Can we add an argument so that each of these call sites reports a unique message? Should we get the class name from the pending exception and include that as well? I think we should include enough breadcrumbs for future failures in the this path that we might have a better guess what's happening.
>
> I think the case we care about most is an `OutOfMemoryError` occurring in the HotSpot heap so I've pushed a change that calls this out. I've also distinguished the case where the native buffer for the encoding cannot be allocated (although if that happens, the VM is in real trouble).
I was thinking we could get the jthrowable and somehow find the name of the exception from the jclass but I guess JNI doesn't let you do that. Should we use `_from_env->describe_pending_exception()`?
-------------
PR: https://git.openjdk.org/jdk/pull/11286
More information about the hotspot-compiler-dev
mailing list