Dr. Memory reports that we are leaking handles from CreateFileW and CreateFileMappingW in disk_cache::BackendIO:
https://build.chromium.org/p/chromium.memory.fyi/builders/Windows%20Browser%20%28DrMemory%20full%29%20%288%29/builds/5164
HANDLE LEAK: KERNEL handle 0x00000634 and 3 similar handle(s) were opened but not closed:
# 0 system call NtCreateFile
# 1 KERNELBASE.dll!CreateFileW +0x35d (0x750ec5fd <KERNELBASE.dll+0x1c5fd>)
# 2 KERNEL32.dll!CreateFileW +0x49 (0x768a3f56 <KERNEL32.dll+0x13f56>)
# 3 net.dll!disk_cache::File::Init [net\disk_cache\blockfile\file_win.cc:86]
# 4 net.dll!disk_cache::MappedFile::Init [net\disk_cache\blockfile\mapped_file_win.cc:16]
# 5 net.dll!disk_cache::BackendImpl::InitBackingStore [net\disk_cache\blockfile\backend_impl.cc:1386]
# 6 net.dll!disk_cache::BackendImpl::SyncInit [net\disk_cache\blockfile\backend_impl.cc:207]
# 7 net.dll!disk_cache::BackendIO::ExecuteBackendOperation [net\disk_cache\blockfile\in_flight_backend_io.cc:239]
# 8 net.dll!base::internal::Invoker<>::Run [base\bind_internal.h:352]
# 9 base.dll!base::debug::TaskAnnotator::RunTask [base\debug\task_annotator.cc:51]
#10 base.dll!base::MessageLoop::RunTask [base\message_loop\message_loop.cc:476]
#11 base.dll!base::MessageLoop::DeferOrRunPendingTask [base\message_loop\message_loop.cc:485]
#12 base.dll!base::MessageLoop::DoWork [base\message_loop\message_loop.cc:597]
#13 base.dll!base::MessagePumpForIO::DoRunLoop [base\message_loop\message_pump_win.cc:485]
#14 base.dll!base::MessageLoop::RunHandler [base\message_loop\message_loop.cc:440]
#15 base.dll!base::MessageLoop::Run [base\message_loop\message_loop.cc:293]
#16 base.dll!base::Thread::Run [base\threading\thread.cc:202]
#17 content.dll!content::BrowserThreadImpl::CacheThreadRun [content\browser\browser_thread_impl.cc:209]
#18 content.dll!content::BrowserThreadImpl::Run [content\browser\browser_thread_impl.cc:249]
#19 base.dll!base::Thread::ThreadMain [base\threading\thread.cc:254]
#20 base.dll!base::`anonymous namespace'::ThreadFunc [base\threading\platform_thread_win.cc:84]
#21 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x768a337a <KERNEL32.dll+0x1337a>)
Note: @0:10:00.321 in thread 2788
Note: handles created with the same callstack are closed here:
Note: # 0 system call NtClose
Note: # 1 KERNELBASE.dll!CloseHandle +0x2c (0x750dc463 <KERNELBASE.dll+0xc463>)
Note: # 2 KERNEL32.dll!CloseHandle +0x27 (0x768a1418 <KERNEL32.dll+0x11418>)
Note: # 3 base.dll!`anonymous namespace'::CloseHandleWrapper [base\win\scoped_handle.cc:116]
Note: # 4 base.dll!`anonymous namespace'::ActiveVerifier::CloseHandle [base\win\scoped_handle.cc:175]
Note: # 5 base.dll!base::win::HandleTraits::CloseHandle [base\win\scoped_handle.cc:264]
Note: # 6 base.dll!base::File::Close [base\files\file_win.cc:40]
Note: # 7 base.dll!base::File::~File [base\files\file.cc:61]
Note: # 8 net.dll!scoped_refptr<>::Release [base\memory\ref_counted.h:419]
Note: # 9 net.dll!disk_cache::BackendImpl::PrepareForRestart [net\disk_cache\blockfile\backend_impl.cc:1528]
Note: #10 net.dll!disk_cache::BackendImpl::SyncDoomAllEntries [net\disk_cache\blockfile\backend_impl.cc:367]
Note: #11 net.dll!base::internal::Invoker<>::Run [base\bind_internal.h:352]
Note: #12 base.dll!base::debug::TaskAnnotator::RunTask [base\debug\task_annotator.cc:51]
Note: #13 base.dll!base::MessageLoop::RunTask [base\message_loop\message_loop.cc:476]
Note: #14 base.dll!base::MessageLoop::DeferOrRunPendingTask [base\message_loop\message_loop.cc:485]
Note: #15 base.dll!base::MessageLoop::DoWork [base\message_loop\message_loop.cc:597]
Note: #16 base.dll!base::MessagePumpForIO::DoRunLoop [base\message_loop\message_pump_win.cc:485]
Note: #17 base.dll!base::MessageLoop::RunHandler [base\message_loop\message_loop.cc:440]
Note: #18 base.dll!base::MessageLoop::Run [base\message_loop\message_loop.cc:293]
Note: #19 base.dll!base::Thread::Run [base\threading\thread.cc:202]
Note: #20 content.dll!content::BrowserThreadImpl::CacheThreadRun [content\browser\browser_thread_impl.cc:209]
Note: #21 content.dll!content::BrowserThreadImpl::Run [content\browser\browser_thread_impl.cc:249]
Note: #22 base.dll!base::Thread::ThreadMain [base\threading\thread.cc:254]
Note: #23 base.dll!base::`anonymous namespace'::ThreadFunc [base\threading\platform_thread_win.cc:84]
Note: #24 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x768a337a <KERNEL32.dll+0x1337a>)
The report came from the `WebUIWebViewBrowserTest.ContentScriptExistsAsLongAsWebViewTagExists` test.
HANDLE LEAK: KERNEL handle 0x00000648 and 3 similar handle(s) were opened but not closed:
# 0 system call NtCreateSection
# 1 KERNELBASE.dll!CreateFileMappingW +0xe4 (0x750de910 <KERNELBASE.dll+0xe910>)
# 2 net.dll!disk_cache::MappedFile::Init [net\disk_cache\blockfile\mapped_file_win.cc:21]
# 3 net.dll!disk_cache::BackendImpl::InitBackingStore [net\disk_cache\blockfile\backend_impl.cc:1386]
# 4 net.dll!disk_cache::BackendImpl::SyncInit [net\disk_cache\blockfile\backend_impl.cc:207]
# 5 net.dll!disk_cache::BackendIO::ExecuteBackendOperation [net\disk_cache\blockfile\in_flight_backend_io.cc:239]
# 6 net.dll!base::internal::Invoker<>::Run [base\bind_internal.h:352]
# 7 base.dll!base::debug::TaskAnnotator::RunTask [base\debug\task_annotator.cc:51]
# 8 base.dll!base::MessageLoop::RunTask [base\message_loop\message_loop.cc:476]
# 9 base.dll!base::MessageLoop::DeferOrRunPendingTask [base\message_loop\message_loop.cc:485]
#10 base.dll!base::MessageLoop::DoWork [base\message_loop\message_loop.cc:597]
#11 base.dll!base::MessagePumpForIO::DoRunLoop [base\message_loop\message_pump_win.cc:485]
#12 base.dll!base::MessageLoop::RunHandler [base\message_loop\message_loop.cc:440]
#13 base.dll!base::MessageLoop::Run [base\message_loop\message_loop.cc:293]
#14 base.dll!base::Thread::Run [base\threading\thread.cc:202]
#15 content.dll!content::BrowserThreadImpl::CacheThreadRun [content\browser\browser_thread_impl.cc:209]
#16 content.dll!content::BrowserThreadImpl::Run [content\browser\browser_thread_impl.cc:249]
#17 base.dll!base::Thread::ThreadMain [base\threading\thread.cc:254]
#18 base.dll!base::`anonymous namespace'::ThreadFunc [base\threading\platform_thread_win.cc:84]
#19 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x768a337a <KERNEL32.dll+0x1337a>)
Note: @0:10:00.357 in thread 2788
Note: handles created with the same callstack are closed here:
Note: # 0 system call NtClose
Note: # 1 KERNELBASE.dll!CloseHandle +0x2c (0x750dc463 <KERNELBASE.dll+0xc463>)
Note: # 2 KERNEL32.dll!CloseHandle +0x27 (0x768a1418 <KERNEL32.dll+0x11418>)
Note: # 3 net.dll!disk_cache::MappedFile::~MappedFile [net\disk_cache\blockfile\mapped_file_win.cc:49]
Note: # 4 net.dll!disk_cache::MappedFile::`vector deleting destructor'
Note: # 5 net.dll!scoped_refptr<>::Release [base\memory\ref_counted.h:419]
Note: # 6 net.dll!disk_cache::BackendImpl::PrepareForRestart [net\disk_cache\blockfile\backend_impl.cc:1528]
Note: # 7 net.dll!disk_cache::BackendImpl::SyncDoomAllEntries [net\disk_cache\blockfile\backend_impl.cc:367]
Note: # 8 net.dll!base::internal::Invoker<>::Run [base\bind_internal.h:352]
Note: # 9 base.dll!base::debug::TaskAnnotator::RunTask [base\debug\task_annotator.cc:51]
Note: #10 base.dll!base::MessageLoop::RunTask [base\message_loop\message_loop.cc:476]
Note: #11 base.dll!base::MessageLoop::DeferOrRunPendingTask [base\message_loop\message_loop.cc:485]
Note: #12 base.dll!base::MessageLoop::DoWork [base\message_loop\message_loop.cc:597]
Note: #13 base.dll!base::MessagePumpForIO::DoRunLoop [base\message_loop\message_pump_win.cc:485]
Note: #14 base.dll!base::MessageLoop::RunHandler [base\message_loop\message_loop.cc:440]
Note: #15 base.dll!base::MessageLoop::Run [base\message_loop\message_loop.cc:293]
Note: #16 base.dll!base::Thread::Run [base\threading\thread.cc:202]
Note: #17 content.dll!content::BrowserThreadImpl::CacheThreadRun [content\browser\browser_thread_impl.cc:209]
Note: #18 content.dll!content::BrowserThreadImpl::Run [content\browser\browser_thread_impl.cc:249]
Note: #19 base.dll!base::Thread::ThreadMain [base\threading\thread.cc:254]
Note: #20 base.dll!base::`anonymous namespace'::ThreadFunc [base\threading\platform_thread_win.cc:84]
Note: #21 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x768a337a <KERNEL32.dll+0x1337a>)
The report came from the `WebUIWebViewBrowserTest.ContentScriptExistsAsLongAsWebViewTagExists` test.
Comment 1 by bugdroid1@chromium.org
, Mar 15 2016