http://bugs.winehq.org/show_bug.cgi?id=20372
Summary: WS2_register_async_shutdown forgets to initialize local_iosb.Information to zero? Product: Wine Version: 1.1.31 Platform: PC OS/Version: Linux Status: NEW Keywords: download, patch, source Severity: normal Priority: P2 Component: winsock AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com
TCPClientSocketTest.Connect, SSLClientSocketTest.Connect, and TCPPingerTest.Ping all exhibit valgrind warnings like this:
Syscall param writev(vector[...]) points to uninitialised byte(s) at writev (writev.c:46) by send_request (server.c:214) by wine_server_call (server.c:295) by NTDLL_wait_for_multiple_objects (sync.c:1122) by wait_suspend (exception.c:85) by usr1_handler (signal_i386.c:1993) Address 0x7ffdadfc is on thread 1's stack Uninitialised value was created by a client request at mark_block_uninitialized (heap.c:187) by RtlAllocateHeap (heap.c:1429) by WS2_register_async_shutdown (socket.c:1522) by WS_shutdown (socket.c:3444) by net::TCPClientSocketWin::Disconnect (tcp_client_socket_win.cc:345) by net::`anonymous namespace'::TCPClientSocketTest_Connect_Test::TestBody (tcp_client_socket_unittest.cc:110)
There are similar errors on other tests that call WS_shutdown. This looks oddly like the problem in bug 20336, and indeed, clearing local_iosb.Information gets rid of the warning:
--- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1526,6 +1526,7 @@ static int WS2_register_async_shutdown( SOCKET s, int type ) wsa->hSocket = SOCKET2HANDLE(s); wsa->type = type; wsa->completion_func = NULL; + wsa->local_iosb.Information = 0;
SERVER_START_REQ( register_async ) {
Is this the right place to do it, or should the system be clearing it instead somewhere else?
http://bugs.winehq.org/show_bug.cgi?id=20372
--- Comment #1 from Dan Kegel dank@kegel.com 2009-10-14 19:07:12 --- Sorry, I should have mentioned that the above three tests are all Chromium net_unittests.
http://bugs.winehq.org/show_bug.cgi?id=20372
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #2 from Alexandre Julliard julliard@winehq.org 2009-10-19 10:30:31 --- Actually it should be set once the async call is finished. I committed a fix.
http://bugs.winehq.org/show_bug.cgi?id=20372
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Alexandre Julliard julliard@winehq.org 2009-10-23 13:19:41 --- Closing bugs fixed in 1.1.32.