http://bugs.winehq.org/show_bug.cgi?id=20548
Summary: Memory leak in pending overlapped I/O? Product: Wine Version: 1.1.32 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com
Valgrinding the chromium ipc tests shows definite leaks like this:
768 bytes in 32 blocks are definitely lost in loss record 812 of 907 by RtlAllocateHeap (heap.c:1421) by NtWriteFile (file.c:987) by WriteFile (file.c:532) by IPC::Channel::ChannelImpl::ProcessOutgoingMessages (ipc_channel_win.cc:351)
and
5,572 bytes in 199 blocks are definitely lost in loss record 884 of 907 by RtlAllocateHeap (heap.c:1421) by NtReadFile (file.c:660) by ReadFile (file.c:424) by IPC::Channel::ChannelImpl::ProcessIncomingMessages (ipc_channel_win.cc:255)
What is supposed to free that memory?
http://bugs.winehq.org/show_bug.cgi?id=20548
--- Comment #1 from Dan Kegel dank@kegel.com 2009-11-01 15:38:13 --- Here's a similar example, this time in ws2:
52 bytes in 1 blocks are definitely lost in loss record 431 of 983 by RtlAllocateHeap (heap.c:1421) by WS2_register_async_shutdown (socket.c:1526) by WS_shutdown (socket.c:3468) by net::TCPClientSocketWin::Disconnect (tcp_client_socket_win.cc:345) by net::`anonymous namespace'::TCPClientSocketTest_Connect_Test::TestBody (tcp_client_socket_unittest.cc:110)
Again, if the status is STATUS_PENDING, who's supposed to free that memory?
To reproduce the second example: mkdir demo cd demo wget -c http://kegel.com/wine/chromium/chromium-tests.tar.bz2 tar -xjvf chromium-tests.tar.bz2 valgrind --trace-children=yes --leak-check=full wine src/chrome/Debug/net_unittests.exe --gtest_filter=TCPClientSocketTest.Connect
http://bugs.winehq.org/show_bug.cgi?id=20548
--- Comment #2 from Dan Kegel dank@kegel.com 2009-11-09 15:31:46 --- And another one in ConnectNamedPipe:
24 bytes in 1 blocks are definitely lost in loss record 218 of 920 at RtlAllocateHeap (heap.c:1423) by server_ioctl_file (file.c:1216) by NtFsControlFile (file.c:1451) by ConnectNamedPipe (sync.c:1588) by IPC::Channel::ChannelImpl::ProcessConnection (ipc_channel_win.cc:202)
To reproduce, wget -c http://kegel.com/wine/chromium/chromium-tests.tar.bz2 tar -xjvf chromium-tests.tar.bz2 valgrind --trace-children=yes --leak-check=full wine src/chrome/Debug/ipc_tests.exe
http://bugs.winehq.org/show_bug.cgi?id=20548
--- Comment #3 from Alexandre Julliard julliard@winehq.org 2009-11-11 05:39:32 --- The memory is freed once the user APC routine is called. If the app exits without doing an alertable wait then it won't get freed. Fixing this would be quite complicated since we can't free memory inside a signal handler.
http://bugs.winehq.org/show_bug.cgi?id=20548
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WONTFIX
--- Comment #4 from Alexandre Julliard julliard@winehq.org 2009-11-11 10:00:09 --- Marking wontfix for now, reopen if it affects a real app.
http://bugs.winehq.org/show_bug.cgi?id=20548
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Dmitry Timoshkov dmitry@codeweavers.com 2009-11-16 06:42:20 --- Closing WONTFIX.
http://bugs.winehq.org/show_bug.cgi?id=20548
--- Comment #6 from Dan Kegel dank@kegel.com 2009-11-27 17:32:39 --- FWIW, it looks like this also happens in the wine conformance tests, in kernel32/tests/pipe.c:
24 bytes in 1 blocks are definitely lost in loss record 139 of 526 at RtlAllocateHeap (heap.c:1697) by server_ioctl_file (file.c:1216) by NtFsControlFile (file.c:1451) by ConnectNamedPipe (sync.c:1588) by serverThreadMain3 (pipe.c:551)
24 bytes in 1 blocks are definitely lost in loss record 140 of 526 at RtlAllocateHeap (heap.c:1697) by server_ioctl_file (file.c:1216) by NtFsControlFile (file.c:1451) by ConnectNamedPipe (sync.c:1588) by overlapped_server (pipe.c:1406)
28 bytes in 1 blocks are definitely lost in loss record 163 of 526 at RtlAllocateHeap (heap.c:1697) by NtReadFile (file.c:660) by ReadFile (file.c:424) by serverThreadMain4 (pipe.c:697)
28 bytes in 1 blocks are definitely lost in loss record 164 of 526 at RtlAllocateHeap (heap.c:1697) by NtReadFile (file.c:660) by ReadFile (file.c:424) by overlapped_server (pipe.c:1419)
192 bytes in 8 blocks are definitely lost in loss record 385 of 526 at RtlAllocateHeap (heap.c:1697) by server_ioctl_file (file.c:1216) by NtFsControlFile (file.c:1451) by ConnectNamedPipe (sync.c:1588) by serverThreadMain4 (pipe.c:671)