Kwakkelflap: tools for the IT pro

Monday, September 24, 2007

Weird crash problem

The new Watchdog – O – Matic version has been released for a while now. I noticed I had a strange crash problem in the new version when closing the program. It only happened on Vista 64 bit. No problems on XP 32 and 64 bit, and no problems on Vista 32 bit.

So I fired up ye olde debugger to locate the problem. The crash seemed very erratic. It crashed at a certain point for no obvious reason, and when I disabled that code, it crashed somewhere else. The Microsoft debugger couldn't help me find the problem. Then I stumbled on an innocent looking line of code at the beginning of the program:

m_pszRegistryKey = "SOFTWARE\\Kwakkelflap\\Watchdog";


This is a string that's part of the CWinApp class that you have to initialize in your application if you want to read something from the registry. It seems that in Vista x64 there is a problem freeing the memory allocated by CWinApp when you close the program causing the crash. So I simply disabled this and everything works like a charm.

Things like this prove once more that a program like Watchdog – O – Matic is very useful for everyone. I bet there are a lot of crashes and unexpected system behavior out there caused by the shift to Vista (and 64 bit operating systems).

Labels: ,

0 Comments:

Post a Comment

<< Home