RFR : 8182672: Java 8u121 on Linux intermittently returns null for MAC address
Seán Coffey
sean.coffey at oracle.com
Thu Jun 22 18:16:48 UTC 2017
Hi Vyom,
thanks for testing. Null is a valid value for some interfaces. I've
excluded the loopback interface from being testing. Perhaps there's
other issues at play here. We know that getHardwareAddress() can throw
SocketException if I/O fails. For this particular scenario we're not
interested in that and perhaps that can be ignored.
I'll take another look.
regards,
Sean.
On 22/06/2017 18:50, Vyom Tewari wrote:
> Hi Sean,
>
> with your patch as well your test case is failing on my
> laptop(Ubuntu16.04), when i tried to run on jdk8 i am getting below
> error.
>
> java.net.SocketException: No such device (ioctl(SIOCGIFHWADDR) failed)
> at java.net.NetworkInterface.getMacAddr0(Native Method)
> at
> java.net.NetworkInterface.getHardwareAddress(NetworkInterface.java:457)
> at com.java.test.GetMacAddress.run(GetMacAddress.java:66)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> java.net.SocketException: No such device (ioctl(SIOCGIFHWADDR) failed)
> at java.net.NetworkInterface.getMacAddr0(Native Method)
> at
> java.net.NetworkInterface.getHardwareAddress(NetworkInterface.java:457)
> at com.java.test.GetMacAddress.run(GetMacAddress.java:66)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Exception in thread "main" java.lang.RuntimeException: Failed
> at com.java.test.GetMacAddress.main(GetMacAddress.java:96)
> mac id is null for interface cscotun0- Thread0
> Testing: cscotun0
> mac id is null for interface cscotun0- Thread3
> Testing: cscotun0
>
> Thanks,
>
> Vyom
>
>
> On Thursday 22 June 2017 09:59 PM, Seán Coffey wrote:
>> JDK 10 fix required to correct a race issue in NetworkInterface. I
>> don't believe the ifreq struct needs to be static in any case. New
>> auto unit testcase also. I propose to skip this fix for JDK 9 and fix
>> in an update release for that family. I also plan to port this to
>> jdk8u-dev.
>>
>> https://bugs.openjdk.java.net/browse/JDK-8182672
>> webrev :
>> http://cr.openjdk.java.net/~coffeys/webrev.8182672.jdk10/webrev/
>>
>> regards,
>> Sean.
>
More information about the net-dev
mailing list