RFR(S): 8010190: os_windows missing winsock initialization

David Holmes david.holmes at oracle.com
Thu Mar 21 16:00:12 PDT 2013


Hi Nils,

Looks functional.

Stylistically I'd prefer to see a bool function that is explicitly 
tested rather than using a form that has to be the last thing in 
init_2().  But I'll leave that for the second reviewer to decide.

Thanks,
David

On 21/03/2013 11:35 PM, Nils Eliasson wrote:
> Hi David,
>> If there is only one consumer of this then how did we suddenly start
>> to hit uninitialized paths ? Has that consumer changed which methods
>> it uses?
>
> I started in the compiler team and develop on windows. From the
> beginning no one had even bothered implemented the functions needed for
> streaming the graphs, so I did that. But I missed the initialization,
> probably because it was already initialized from other code.
>
> Taking a closer look at this I notice WSAStartup is also called from:
> ./jdk/src/windows/demo/jvmti/hprof/hprof_md.c
> ./jdk/src/windows/native/java/net/net_util_md.c
> ./jdk/src/windows/transport/socket/socket_md.c
>
>>
>>> New webrev:
>>> http://cr.openjdk.java.net/~neliasso/7034299/webrev.02/
>>
>> The code simplification to only initialize from init_2 seems fine.
>>
>> I'm still a bit concerned about the potential for initialization
>> failures though - is there a reason to not simply have initSock return
>> a boolean and have os_init2 return JNI_ERR on failure?
>>
> No there isn't. I'll add it right away. I don't expect any failures
> since the JDK is using it as well, and we don't see any problems there.
>
> Also bumped the WSA version requested to 2.2, the same as in the JDK
> (WinXP, Win98, Win95 OSR2 and later).
>
> New webrev:
> http://cr.openjdk.java.net/~neliasso/7034299/webrev.03/
>
> Thanks!
>
> //Nils Eliasson
>


More information about the hotspot-runtime-dev mailing list