Thread: Visual C++ Debug Error?

  1. #1
    i dont know Vicious's Avatar
    Join Date
    May 2002

    Visual C++ Debug Error?

    What does this mean?

    It pops up when I close my app.
    What is C++?

  2. #2
    Registered User
    Join Date
    Sep 2004
    i probably means one of your chips are damaged.......i dunno, just a guess

  3. #3
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    after searching MSDN I found it is a bugg in the C++ library basic_string class when you assign a shorter string to an existing string the heap gets corrupted

    work around is to string::erase before assigning new string.

    I guess i should clarify that is one possible cause. But the main gist is a heap corruption.
    Last edited by manofsteel972; 09-29-2004 at 10:34 AM.
    "Knowledge is proud that she knows so much; Wisdom is humble that she knows no more."
    -- Cowper

    Operating Systems=Slackware Linux 9.1,Windows 98/Xp
    Compilers=gcc 3.2.3, Visual C++ 6.0, DevC++(Mingw)

    You may teach a person from now until doom's day, but that person will only know what he learns himself.

    Now I know what doesn't work.

    A problem is understood by solving it, not by pondering it.

    For a bit of humor check out xkcd web comic

  4. #4
    i dont know Vicious's Avatar
    Join Date
    May 2002
    mm interesting.
    Im not even using the string class as far as I know.

    Lets hope its just a bug and not something to worry about.
    What is C++?

  5. #5
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    What happens when you debug it (hit retry)? Where is it in the call stack? It is most likely a bug in your program. Like manofsteel972 said, it is quite possibly heap corruption. If there is a destructor in your call stack that would help you pinpoint the location of the problem.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    It says "DAMAGE after..."
    It's pretty likely to be a memory overrun problem with your code.

    I don't know whether that address is the address returned by malloc/new or the actual address of the damage. Either way, looking at the contents of that memory (and the locations nearby) using the debugger should give you some insight into what that memory was used for, and hence possible places in the code which could have used that memory.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  3. Why wont my function exit correctly?
    By LightsOut06 in forum C Programming
    Replies: 2
    Last Post: 10-09-2005, 09:23 PM
  4. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM
  5. <list>
    By Unregistered in forum C++ Programming
    Replies: 9
    Last Post: 02-24-2002, 04:07 PM