I tried to debug a subtle memory issue in a large project. These were weeks, and I still could not find him. My program crashes after starting for a certain time. As a result, I tried to get a memory debugger. Here are the options I reviewed / tried:
- IBM Purify - successfully detects a memory leak, but asks me to pay money to find out where it is.
- Valgrind - I heard good things about this program, but it is for Linux, and I would have to transfer my entire project on top of
- MPatrol - again this is mainly for linux. The Windows version is for MingGW, and I'm using Visual Studio. I found the binaries for VC ++ online and followed the instructions, but the program refused to display the log files.
- Application Verifier - throws a random breakpoint at startup, requests a nonexistent source file (sdk.cpp) in Visual Studio, and then gives this error every time, regardless of what exe I attach it to: "First chance access violation for the current stack trace "
- WinDbg - I donβt even know if this program does what I think. Always gives "ERROR: file with symbol not found". And it looks like it does nothing when I run my exe.
I searched all these errors on Google for several hours to no avail. The relevant documentation for these packages does not seem to contain information about my specific problems. Is there a debugger that works? Do I need to port my program to Linux? Can someone point me in the direction of good documentation regarding memory debugging? Any help would be greatly appreciated. Thanks in advance!
Edit:
Thanks for all the answers. I understand that the problem with the crash is probably not a memory leak. After working for a while, he just freezes. There is no error message. This usually happens when writing to cout. So I realized that it was some corruption of memory. I think I will consider the deeper possibilities of the visual studio. In fact, using the trial version of Purify, I found several errors, but I do not want to cough up to $ 1,600 for the full version. In the worst case, I port it to Linux. Thanks again for the help.
Edit 2:
After some testing with Purify, it looks like there are no more memory errors in my program. I noticed that the program freezes when I click on it, as on the command line itself. So I'm going to suggest that this is not a problem with my code, but rather a way to interact with text selection. (Edit 2a: facepalm should make the choice) Thanks again for the help.
In the future, where can I learn about more complex debugging? I used breakpoints and watched the expressions, but at school they only teach the language itself. Do I need to learn the x86 build?
source share