none
How to debug an executable RRS feed

  • Question

  • Hi,

    I run into a dead end with a Windows application written in C#. If I open my source code in Visual Studio 2010 and hit "F5", everything runs fine.

    I then build it into a msi installer, then install this application. However, when I run this installed application, it constantly dies with this error message: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." How do I debug this executable?

    Please help - customer is pushing for release and I am stuck here. Many thanks!

    Saturday, January 4, 2014 1:53 PM

Answers

  • This one is hard to debug. The damage is usually done a long time before you get this error, sometimes even before your application starts (e.g. your saved data is corrupt in the last run due to your bad code that hides exceptions instead of crashing the app right away). You would be extremely lucky if the faulty code is on the call stack. 

    Search "crash dump" in the Visual Studio debugger forum to see how to collect a crash dump from client machine and load in Visual Studio. Search "access violation" there for other people's thoughts about how to track down this problem. If you need help in using the debugger, post in that forum.



    Visual C++ MVP

    Saturday, January 4, 2014 4:47 PM