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. Debug Assertion Failed!

Debug Assertion Failed!

Scheduled Pinned Locked Moved C / C++ / MFC
helpannouncementc++debuggingtutorial
5 Posts 3 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.
  • O Offline
    O Offline
    Orville
    wrote on last edited by
    #1

    I have a small console program that I have written that seems to execute correctly, but I keep getting a Debug Assertion Failed! error when the program is exiting. And it points to this file dbgdel.cpp line 52 and Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse). If I just comple a release version I do not get any error messages when the program exits. I am stuck on how to fix this error. Is it important that I do fix it? Any help will be great. ----------------------- Ok now what? -----------------------

    C D 2 Replies Last reply
    0
    • O Orville

      I have a small console program that I have written that seems to execute correctly, but I keep getting a Debug Assertion Failed! error when the program is exiting. And it points to this file dbgdel.cpp line 52 and Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse). If I just comple a release version I do not get any error messages when the program exits. I am stuck on how to fix this error. Is it important that I do fix it? Any help will be great. ----------------------- Ok now what? -----------------------

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      It looks to me like perhaps you're calling delete twice ? When you delete a pointer, do you set it to NULL ? Christian Graus - Microsoft MVP - C++

      O 1 Reply Last reply
      0
      • C Christian Graus

        It looks to me like perhaps you're calling delete twice ? When you delete a pointer, do you set it to NULL ? Christian Graus - Microsoft MVP - C++

        O Offline
        O Offline
        Orville
        wrote on last edited by
        #3

        I don't see any place that I am calling delete twice. I just got a different error. This one said "DAMAGE: after Normal block (#48) at 0x00F74F18" and when I click on the "Ignore" button then I get the first error message again. The program does make calles to a third parties api that I am using is it possible that something in thier code is calling delete after my code has finished? ----------------------- Ok now what? -----------------------

        C 1 Reply Last reply
        0
        • O Orville

          I don't see any place that I am calling delete twice. I just got a different error. This one said "DAMAGE: after Normal block (#48) at 0x00F74F18" and when I click on the "Ignore" button then I get the first error message again. The program does make calles to a third parties api that I am using is it possible that something in thier code is calling delete after my code has finished? ----------------------- Ok now what? -----------------------

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          It's entirely possible that a third party API is creating the ASSERT. Look at the call stack to see where the call comes from that ends up with that ASSERT. Christian Graus - Microsoft MVP - C++

          1 Reply Last reply
          0
          • O Orville

            I have a small console program that I have written that seems to execute correctly, but I keep getting a Debug Assertion Failed! error when the program is exiting. And it points to this file dbgdel.cpp line 52 and Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse). If I just comple a release version I do not get any error messages when the program exits. I am stuck on how to fix this error. Is it important that I do fix it? Any help will be great. ----------------------- Ok now what? -----------------------

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Orville Warnick wrote: And it points to this file dbgdel.cpp line 52 Can you set a breakpoint on this line? When the breakpoint is hit, check the call stack to see how your program got there. Orville Warnick wrote: If I just comple a release version I do not get any error messages when the program exits. You may not get an error message, but the symptom that caused the error still exists. Orville Warnick wrote: Is it important that I do fix it? That all depends on if you want a bug in your program.


            "One must learn from the bite of the fire to leave it alone." - Native American Proverb

            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