Visual C++ Debug Error?

This is a discussion on Visual C++ Debug Error? within the C++ Programming forums, part of the General Programming Boards category; What does this mean? It pops up when I close my app....

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

    Visual C++ Debug Error?

    What does this mean?

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

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    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
    Posts
    317
    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.

    [edit]
    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 http://xkcd.com/235/

  4. #4
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    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
    Posts
    1,088
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,591
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 02:07 AM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 03: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, 03:49 AM
  5. <list>
    By Unregistered in forum C++ Programming
    Replies: 9
    Last Post: 02-24-2002, 03:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21