visual-studiomemory-leaksdr-memory

Dr Memory Integrated to visual studio 201x


For a simple program as the following:

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

I am getting the following errors.

     Dr. Memory version 1.6.1
     Running ""C:\Users\********\Documents\Visual Studio 2012\Projects\drmemory\Debug\drmemory.exe""

     Error #1: UNINITIALIZED READ: reading 4 byte(s)
     system call NtClose parameter value #0
         <system call>
     ntdll.dll!ZwClose  
         ??:0
     KERNELBASE.dll!ResumeThread  
         ??:0
     KERNELBASE.dll!CreateDirectoryA
         ??:0
     f_ah.dll!Proc2   
         ??:0
     f_ah.dll!Proc2   
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0
     NSCCOR03.dll!?           
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0

     Error #2: UNINITIALIZED READ: reading 4 byte(s)
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     f_ah.dll!?       
         ??:0
     f_ah.dll!Proc2   
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0
     NSCCOR03.dll!?           
         ??:0

     Error #3: UNADDRESSABLE ACCESS: reading 4 byte(s)
     f_ah.dll!?       
         ??:0
     KERNELBASE.dll!SetFilePointer
         ??:0
     ntdll.dll!RtlImageDirectoryEntryToData
         ??:0
     ntdll.dll!RtlImageDirectoryEntryToData
         ??:0
     ntdll.dll!LdrGetProcedureAddressEx
         ??:0
     ntdll.dll!LdrGetProcedureAddressEx
         ??:0
     ntdll.dll!RtlRunOnceBeginInitialize
         ??:0
     ntdll.dll!LdrGetProcedureAddressEx
         ??:0
     ntdll.dll!NtWriteFile
         ??:0
     KERNELBASE.dll!WriteFile     
         ??:0
     KERNELBASE.dll!WriteFile     
         ??:0
     KERNEL32.dll!GetSystemTime
         ??:0

     Error #4: UNINITIALIZED READ: reading 4 byte(s)
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     ICATCDLL.dll!?           
         ??:0
     ntdll.dll!RtlReleaseRelativeName
         ??:0
     ntdll.dll!RtlRunOnceBeginInitialize
         ??:0
     ntdll.dll!RtlReleaseRelativeName
         ??:0
     ntdll.dll!RtlUnicodeStringToAnsiString
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0

     Error #5: UNINITIALIZED READ: reading register eax
     f_sps.DLL!DllUnregisterServer
         ??:0
     USER32.dll!IsWindow  
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0
     NSCCOR03.dll!?           
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     ntdll.dll!ZwTestAlert
         ??:0

     Error #6: UNINITIALIZED READ: reading 4 byte(s)
     system call NtClose parameter value #0
         <system call>
     ntdll.dll!ZwClose  
         ??:0
     KERNELBASE.dll!ResumeThread  
         ??:0
     KERNELBASE.dll!CreateDirectoryA
         ??:0
     f_acc.dll!Proc3    
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0
     NSCCOR03.dll!?           
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0

     Error #7: UNINITIALIZED READ: reading 4 byte(s)
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     USER32.dll!IsWindow  
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0

     Error #8: UNINITIALIZED READ: reading 4 byte(s)
     NSCCOR03.dll!?           
         ??:0
     NSCCOR03.dll!?           
         ??:0
     NSCCOR03.dll!?           
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!RtlUnicodeStringToAnsiString
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!RtlImageDirectoryEntryToData
         ??:0

     Error #9: UNINITIALIZED READ: reading 4 byte(s)
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!RtlUnicodeStringToAnsiString
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!RtlImageDirectoryEntryToData
         ??:0

     Error #10: UNINITIALIZED READ: reading 4 byte(s)
     ICATCDLL.dll!Ordinal1    
         ??:0
     ICATCDLL.dll!Ordinal1    
         ??:0
     ICATCDLL.dll!Ordinal1    
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!RtlUnicodeStringToAnsiString
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!RtlImageDirectoryEntryToData
         ??:0

     Error #11: UNINITIALIZED READ: reading 4 byte(s)
     ICDCNL.dll!?         
         ??:0
     ICDCNL.dll!?         
         ??:0
     ICDCNL.dll!?         
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!RtlUnicodeStringToAnsiString
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     KERNELBASE.dll!GetVersionExA 
         ??:0
     f_sps.DLL!DllUnregisterServer
         ??:0
     ntdll.dll!RtlImageDirectoryEntryToData
         ??:0

     Error #12: UNINITIALIZED READ: reading 4 byte(s)
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     ntdll.dll!ZwTestAlert
         ??:0
     ntdll.dll!RtlImageDirectoryEntryToData
         ??:0
     ntdll.dll!RtlImageDirectoryEntryToData
         ??:0
     ntdll.dll!LdrGetProcedureAddressEx
         ??:0
     ntdll.dll!LdrGetProcedureAddressEx
         ??:0
     ILT+110(_wmainCRTStartup)
         ??:0
     ntdll.dll!RtlInitializeExceptionChain
         ??:0

     Error #13: UNINITIALIZED READ: reading 1 byte(s)
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0
     PaperHK.dll!?          
         ??:0

     Error #14: LEAK 128 bytes 
     replace_malloc 
         d:\drmemory_package\common\alloc_replace.c(2292):
     f_ah.dll!Proc2   
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0
     NSCCOR03.dll!?           
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     ILT+110(_wmainCRTStartup)
         ??:0
     ntdll.dll!RtlInitializeExceptionChain
         ??:0
     ntdll.dll!RtlInitializeExceptionChain
         ??:0

     Error #15: LEAK 260 bytes 
     replace_operator_new_nomatch
         d:\drmemory_package\common\alloc_replace.c(2544):
     f_ah.dll!Proc2   
         ??:0
     f_ah.dll!Proc2   
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0
     NSCCOR03.dll!?           
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     ILT+110(_wmainCRTStartup)
         ??:0
     ntdll.dll!RtlInitializeExceptionChain
         ??:0

     Error #16: LEAK 260 bytes 
     replace_operator_new_nomatch
         d:\drmemory_package\common\alloc_replace.c(2544):
     f_ah.dll!Proc2   
         ??:0
     f_ah.dll!Proc2   
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0
     NSCCOR03.dll!?           
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     ILT+110(_wmainCRTStartup)
         ??:0
     ntdll.dll!RtlInitializeExceptionChain
         ??:0

     Error #17: LEAK 260 bytes 
     replace_operator_new_nomatch
         d:\drmemory_package\common\alloc_replace.c(2544):
     f_ah.dll!Proc2   
         ??:0
     f_ah.dll!Proc2   
         ??:0
     ntdll.dll!wcsncmp  
         ??:0
     ntdll.dll!EtwEventRegister
         ??:0
     ntdll.dll!LdrUnlockLoaderLock
         ??:0
     ntdll.dll!LdrLoadDll
         ??:0
     NSCCOR03.dll!?           
         ??:0
     KERNEL32.dll!LoadLibraryW
         ??:0
     NSCCOR03.dll!?           
         ??:0
     ILT+110(_wmainCRTStartup)
         ??:0
     ntdll.dll!RtlInitializeExceptionChain
         ??:0

     ERRORS FOUND:
           1 unique,     1 total unaddressable access(es)
          12 unique,   456 total uninitialized access(es)
           0 unique,     0 total invalid heap argument(s)
           0 unique,     0 total GDI usage error(s)
           0 unique,     0 total warning(s)
           4 unique,     4 total,    908 byte(s) of leak(s)
           0 unique,     0 total,      0 byte(s) of possible leak(s)
     Details: C:\Users\******\AppData\Roaming\Dr. Memory\DrMemory-drmemory.exe.58248.000\results.txt

I have tested it on three different PCs and I can reproduce the issue in all the PCS.

I suspect the issue might be with ntdll.dll which manages the memory (?). Any help/pointers in resolving the issue are appreciated.

-Satish


Solution

  • You have a lot of non-operating-system-provided libraries here: f_ah.dll, PaperHK.dll, f_sps.DLL, NSCCOR03.dll. These are not part of your application. They are presumably from other software you have installed on your machine (aside: it is rather disturbing that you have this many libraries injected into this tiny application: you may want to investigate whether you want such invasive software running on your machine). The Dr. Memory developers have never seen these errors before because they will only occur on a machine that has this particular software installed.

    You should ignore all reports from these libraries by adding their paths to Dr. Memory's -lib_blacklist option. For example, assuming the path to f_ah.dll and f_sps.DLL is c:\Program Files\foo\ and to the others is c:\Program Files\bar\, you could run Dr. Memory with the following option:

    -lib_blacklist "c:\windows\syswow64\*.d??,c:\Program Files\foo\*.dll,c:\Program Files\bar\*.dll"
    

    Dr. Memory will now hide any error report whose top 4 frames comes from one of these libraries.

    You may also want to file a bug in Dr. Memory's issue tracker asking the developers to take a look at these errors, as they may be false positives. Provide enough information to reproduce (which applications these libraries are from, in particular).