Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Memory Leaks in Microsoft Dlls

Memory Leaks in Microsoft Dlls

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++debuggingjsonperformance
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SanShou
    wrote on last edited by
    #1

    I have been looking at solving some "inconsistent" problems with my program which seemed to be memory related. Strings displayed in dialog boxes overwritten when there was no command to change them. In order to check that I did a build with Boundschecker. Although I am not sure how I fixed my own problems :confused:, after a few full rebuilds and initializing data in the pointer class I was using, my code seemed to solidfy. However bounds checker gave me a list of memory leaks within external dlls. (i.e. Dynamic memory overrun Copying 65535 bytes to a block allocated in DNSAPI.DLL!0000121A Starting offset: 0, destination size: 2 bytes HANDLE: 0x0016B5A8 allocating thread ID: 0x6DC, current thread ID: 0x6DC Location of Error DNSAPI.DLL!0000141D (unknown) (unknown) DNSAPI.DLL!000015BA (unknown) (unknown) DNSAPI.DLL!00002AAF (unknown) (unknown) DNSAPI.DLL!000029E4 (unknown) (unknown) DNSAPI.DLL!0000298F (unknown) (unknown) Point of Allocation DNSAPI.DLL!0000121A (unknown) (unknown) DNSAPI.DLL!00002AAF (unknown) (unknown) DNSAPI.DLL!000029E4 (unknown) (unknown) DNSAPI.DLL!0000298F (unknown) (unknown) or Memory leak 1152 bytes allocated by MSVCRT.DLL!0000101F in MSVCRT.DLL!00003517, HANDLE: 0x01F31F20 Location of Error MSVCRT.DLL!00003517 (unknown) (unknown) MSVCRT.DLL!00001431 (unknown) (unknown) Is there a way to debug this.. I assume it is something that I am doing in the calling of the API and MFC code. Okay I am one that doesn't want to just blame Microsoft :mad: and release something with errors that I can resolve. Unfortunatly I am not a debug guru and haven't been able to study under any master, so any help could be cool. Otherwise when I get time, I guess I could comment out calls and find out what is causing these leaks. Trust me I learned alot debugging my AddRef/ Release extremly simple garbage collection for some classes. I learned I should probably have used a better smart pointer class ;P instead of my simple technique.... Anyway thanks for any tips... The path to mastery is full of stupid moments and errors, but the error of the stupid is to assume that they are masters.

    S 1 Reply Last reply
    0
    • S SanShou

      I have been looking at solving some "inconsistent" problems with my program which seemed to be memory related. Strings displayed in dialog boxes overwritten when there was no command to change them. In order to check that I did a build with Boundschecker. Although I am not sure how I fixed my own problems :confused:, after a few full rebuilds and initializing data in the pointer class I was using, my code seemed to solidfy. However bounds checker gave me a list of memory leaks within external dlls. (i.e. Dynamic memory overrun Copying 65535 bytes to a block allocated in DNSAPI.DLL!0000121A Starting offset: 0, destination size: 2 bytes HANDLE: 0x0016B5A8 allocating thread ID: 0x6DC, current thread ID: 0x6DC Location of Error DNSAPI.DLL!0000141D (unknown) (unknown) DNSAPI.DLL!000015BA (unknown) (unknown) DNSAPI.DLL!00002AAF (unknown) (unknown) DNSAPI.DLL!000029E4 (unknown) (unknown) DNSAPI.DLL!0000298F (unknown) (unknown) Point of Allocation DNSAPI.DLL!0000121A (unknown) (unknown) DNSAPI.DLL!00002AAF (unknown) (unknown) DNSAPI.DLL!000029E4 (unknown) (unknown) DNSAPI.DLL!0000298F (unknown) (unknown) or Memory leak 1152 bytes allocated by MSVCRT.DLL!0000101F in MSVCRT.DLL!00003517, HANDLE: 0x01F31F20 Location of Error MSVCRT.DLL!00003517 (unknown) (unknown) MSVCRT.DLL!00001431 (unknown) (unknown) Is there a way to debug this.. I assume it is something that I am doing in the calling of the API and MFC code. Okay I am one that doesn't want to just blame Microsoft :mad: and release something with errors that I can resolve. Unfortunatly I am not a debug guru and haven't been able to study under any master, so any help could be cool. Otherwise when I get time, I guess I could comment out calls and find out what is causing these leaks. Trust me I learned alot debugging my AddRef/ Release extremly simple garbage collection for some classes. I learned I should probably have used a better smart pointer class ;P instead of my simple technique.... Anyway thanks for any tips... The path to mastery is full of stupid moments and errors, but the error of the stupid is to assume that they are masters.

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      - you cannot debug MSVCRT - BoundsChecker is not always accurate. Far from that, type casting makes it easily confused and say wrong things about it. Moreover, you are not telling us whether BoundsChecker reports it is a object leak, interface leak, gdi leak.... If that's an object leak, then MSDEV is likely to show it as well (as a proof whether BoundsChecker is wrong or not). - Best advice would be : -- do not use DNSAPI if you can -- try to use it in another similar program


      MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.

      S 1 Reply Last reply
      0
      • S Stephane Rodriguez

        - you cannot debug MSVCRT - BoundsChecker is not always accurate. Far from that, type casting makes it easily confused and say wrong things about it. Moreover, you are not telling us whether BoundsChecker reports it is a object leak, interface leak, gdi leak.... If that's an object leak, then MSDEV is likely to show it as well (as a proof whether BoundsChecker is wrong or not). - Best advice would be : -- do not use DNSAPI if you can -- try to use it in another similar program


        MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.

        S Offline
        S Offline
        SanShou
        wrote on last edited by
        #3

        Wish I could not use DNSAPI, but one of the requirements that I have already is that I can resolve an Internet Address by name as well as by numbers, so I have to use it. I sort of realized that boundschecker is not going to be completely accurate. Many people have posted examples of the way I use gethostbyname, so I will check out one of their programs to see if it is the same problem. Otherwise it must be the way I am using it. As far as the leak goes... It is labeled as a memory leak. VC++ doesn't record the leak, which is where I normally start. I usually use Boundschecker if I have had a problem that might be memory related. I have learned to ignore resource leaks and gdi leaks unless they are in my code. Thanks for the help though. I appreciate the feedback...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups