2

This is a bad situation: I have a large C++ application on Windows which is having a memory corruption.

Basically I dumped the content of a float variable and found the ASCII code of "hell" from a string elsewhere which was "hello world".

The big problem is: I can't debug it with a memory breakpoint since this is ONLY happening in release mode outside visual studio (release mode started by visual studio isn't triggering the bug, nor release with debug symbols).

Since the application is large and operates with lots of strings, I don't know how to debug it.

Do you have any idea on how to proceed?

Marco A.
  • 43,032
  • 26
  • 132
  • 246
  • 3
    Libera te tutemet ex infernis. – Cat Plus Plus Aug 30 '13 at 15:57
  • 1
    +1 just for title:) Can you twiddle with optimization levels to make a version with debug symbols that fails? Also, link things in a different order, maybe? – Martin James Aug 30 '13 at 16:03
  • Also, I have to ask, 'operates with lots of strings' - these strings, are they, by any chance, C-style strings with char*? – Martin James Aug 30 '13 at 16:10
  • Unfortunately many C-style strings with char*, I would have preferred std::strings but I didn't write the code... very large, didn't count the lines but over 400.000+ I suppose – Marco A. Aug 30 '13 at 17:13
  • @CatPlusPlus http://youtu.be/mAfhwQxwD7I – Manu343726 Aug 30 '13 at 17:53
  • If your code is portable, try GCC or Clang. With their warnings and support for AddressSanatizer and MemorySanatizer, they are very helpful. Valgrind is very helpful but does not work on Windows. Maybe it's worth to try it together with Wine, see http://wiki.winehq.org/Wine_and_Valgrind Maybe this dated question has some helpful answers: http://stackoverflow.com/q/413477 – usr1234567 Dec 08 '13 at 12:05

1 Answers1

0

Divide and conquer. printf. Patience.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055