RFR: 8267564: JDK-8252971 causes SPECjbb2015 socket exceptions on Windows when MKS is installed
Michael McMahon
michaelm at openjdk.java.net
Fri Jun 4 08:26:59 UTC 2021
On Fri, 4 Jun 2021 07:42:14 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Hi,
>>
>> This fixes a problem where unix domain sockets are available on Windows from third party winsock drivers (other than the Microsoft implementation in Windows 10/2019). These are available (unexpectedly) on earlier Windows releases and are not supported by Java.
>>
>> The fix is to search for the expected winsock service provider ID and specifically use that one when creating sockets. Previously, we just attempted to create a unix domain socket, and once that succeeded we assumed we had the right service provider.
>>
>> I haven't included a regression test because the environment to reproduce the issue is not part of the standard test configuration. Also, the new code is well exercised by existing tests.
>>
>> Thanks,
>> Michael.
>
> src/java.base/windows/native/libnio/ch/UnixDomainSockets.c line 101:
>
>> 99: if (g1->Data3 != g2->Data3)
>> 100: return 0;
>> 101: return !memcmp(g1->Data4, g2->Data4, 8);
>
> I think this would be easier to understand if Data4 were compared in the same way as Data1-Data3.
I presume you mean compare each element of the array individually. I guess we can do that, as the function is only called once.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4339
More information about the nio-dev
mailing list