System.OutOfMemory and random errors

One of my (read "created by me") programs suddenly stopped working - to my surprise, for everyone else everything was working flawlessly - except me...

 It was giving me range of random errors (most common was System.OutOfMemory), even when I run it through debugger, it was crashing on random lines with really strange errors (psadi.dll was not found...)... That was really strange. And it was really strange that all other .NET applications were working fine. Most of the time System.OutOfMemory was throwing when reading 5 text files (all of them contained 1 line of text) - come on, we are not in middle age, modern computer should be able to handle it ;)

For all my applications (and many of my project) I really love to use Subversion - if you dont know it, drop me line and I will write some details about it.. I decided to revert to older version of application.

Because I also wanted to keep my current version, I saved file under different file name - and tadaaa - it was working flawlessly again. Then I tried to rename also my latest version - and now it was running smoothly. So I checked HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options - this is the key where all debuggers etc are hooking to application processes (including my tool Hook Application)...

 To my surprise MyApp.exe contained tons of subkeys with strange names like DangerousAPIs, Locks etc... I tried to rename this registry key - and application was working..

After small investigation I traced the root of problem to Application Verifier - and then I remembered that this week I had presentation where I showed also AppVerif - and I was presenting on my program.

To make long story short - if your application works after you rename main exe, check Image File Execution Options registry key and maybe it will help you.

 

Published Thu, Feb 28 2008 15:40 by martin