views:

2170

answers:

2

I have this error like at service windows, this occurs one time a week or more: Application popup: application_name - Application Error : The instruction at memory_location referenced memory at memory_location. The memory could not be "read".

  • production environment;
  • multi-thread app;
  • each thread performs a task;
  • source is C++, VC8;
  • have a PDB files in release version;
  • use UDP to communicate with clients;
  • can not reproduce the error in development environment;
  • the thread that caused the error aborts;
  • is always the same thread that stop at crash;

How to locate the code that causes this error in the source wich this information: "memory location" ?

+2  A: 

It sounds like some a pointer issue. A good start is to enable Dr. Watson to get a crash dump and load the dump file into Visual Studio. Start by reading the Dr. Watson usage guide.

You might also want to consider using Debug Monitor. I find it more useful than Dr. Watson in some cases. The only link that I can find to download it is from Microsoft's FTP site. Here's the address: ftp://ftp.microsoft.com/PSS/Tools/Developer Support Tools/DebugMonitor/

Good luck!

D.Shawley
I think I will use the DebugDiag. What do you think?
lsalamon
I've never used this one. It looks like it should do the job. I usually find that Dr. Watson works fine for generating dumps when a crash occurs and it doesn't require additional installation since it has been in Windows forever.
D.Shawley
I find this: CrashFinder(http://www.wintellect.com/cs/blogs/jrobbins/archive/2006/04/19/crashfinder-returns.aspx) and use address to locate source. After getting map file I get this : ?find@?$_Tree@V?$_Tmap_traits@V?....This help me, because now I know that error is in map usage.
lsalamon
+1  A: 

You can put each thread in the block try () catch. In the case of an unhandled exception - crashdump generated using the API function MiniDumpWriteDump

PS. using this function in the catch block, you can generate crash dump, and send this dump on email to developers. It is standart solution.

dark
The code already in try/catch. For generate DUMP file is necessary other actions (http://support.microsoft.com/kb/241215), or including some code to auto generate dump file or setting register to inform debugger to automate this. But in production environment this is impossible.
lsalamon