RFR: java/net/MulticastSocket/SetGetNetworkInterfaceTest.java throws java.net.SocketException: Cannot assign requested address

Mark Sheppard mark.sheppard at oracle.com
Thu Jan 2 08:26:36 PST 2014


Hi Alan,
   added an ExceptionDescribe to native code and an -Xcheck:jni to the 
cmd line options to produce the
following:

WARNING in native method: JNI call made with exception pending
         at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method)
         at 
java.net.AbstractPlainDatagramSocketImpl.setOption(AbstractPlainDatagramSocketImpl.java:309)
         at 
java.net.MulticastSocket.setNetworkInterface(MulticastSocket.java:554)
         - locked <0x000000076c8c78e8> (a java.lang.Object)
         at 
SetGetNetworkInterfaceTest.main(SetGetNetworkInterfaceTest.java:54)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:483)
         at 
com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
         at java.lang.Thread.run(Thread.java:744)

and ExceptionDescribe outputs

Exception in thread "MainThread" java.net.SocketException: Cannot assign 
requested address
         at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method)
         at 
java.net.AbstractPlainDatagramSocketImpl.setOption(AbstractPlainDatagramSocketImpl.java:309)
         at 
java.net.MulticastSocket.setNetworkInterface(MulticastSocket.java:554)
         at 
SetGetNetworkInterfaceTest.main(SetGetNetworkInterfaceTest.java:54)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:483)
         at 
com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
         at java.lang.Thread.run(Thread.java:744)


regards
Mark

On 29/12/2013 17:05, Alan Bateman wrote:
> On 23/12/2013 18:21, Mark Sheppard wrote:
>> Hi,
>>    Please oblige and review the following changes:
>>
>> http://cr.openjdk.java.net/~msheppar/8027903/webrev/
>>
>> which address the issue:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8027903
>>
>> The test failure was found to be due to an interface configured with 
>> an IPv6 address and
>> no IPv4 address. The native code was calling 
>> mcast_set_if_by_addr_v4(...), which
>> raised an exception.
> Do you know what the exception is? Just wondering what exception is 
> being cleared/ignored.
>
> -Alan



More information about the net-dev mailing list