RFR: 8025293 - JNI exception pending checks in java.net

Mark Sheppard mark.sheppard at oracle.com
Tue Mar 4 03:54:33 PST 2014


Hi Alan,
   thanks for the response.  I originally had a CHECK_NULL_RETURN after 
getBraodcast and tests
failed on Macos, but not on other platforms!
The issue is that getBroadcast returns NULL when broadcast is not 
available for an interface, or when the ioctl calls
return an error. The former is the case on macos with the loopback lo 
interface.
Hence we went with the ExceptionCheck after these calls.
WRT returning ifs, I just followed the convention created in the 
CHECKED_MALLOC3 macro, as
ifs is an "in" parameter.

regards
Mark

On 04/03/2014 11:28, Alan Bateman wrote:
> 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