RFR: 8025293 - JNI exception pending checks in java.net
Alan Bateman
Alan.Bateman at oracle.com
Tue Mar 4 03:28:00 PST 2014
On 04/03/2014 11:06, Mark Sheppard wrote:
> Hi
> please oblige and review the following changes
>
> http://cr.openjdk.java.net/~msheppar/8025293/webrev/
>
> to address the issue in
>
> https://bugs.openjdk.java.net/browse/JDK-8025293
>
> this applies additional checks after JNI native calls in
> src/solaris/native/java/net/NetworkInterface.c
> src/windows/native/java/net/NetworkInterface.c
>
> The main changes are NULL checks and pending exception checks.
I went through the webrev and it looks reasonable to me. The awkwardness
of not knowing if GetStringUTFChars fails with a pending exception or
not makes me wonder if the recent suggestion on core-libs-dev to check
for a pending exception might be worth looking at again, even by
introducing variations of JNU_ThrowOutOfMemoryError. Not for this patch
of course but this patch does highlight the issue again.
One thing that isn't 100% clear to me is in the Solaris/Linux version of
addif where it returns ifs if either getBroadcast or getSubnet fail with
a pending exception. Is there additional cleanup/free that needs to be
done for this case or is this the reason for returning the partially
initialized ifs. I also wonder if it's necessary to check for a pending
exception, could getBroadcast returning NULL is used too?
-Alan.
More information about the net-dev
mailing list