RFR(S): 8010190: os_windows missing winsock initialization

Nils Eliasson nils.eliasson at oracle.com
Thu Mar 21 06:35:53 PDT 2013


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