The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Handling crashes in Windows apps

I just discovered the cool function SetUnhandledExceptionFilter -- coupled with MiniDumpWriteDump you can write a crash dump file which will let you see stack traces, variable values, etc, when the customer sends you the .dmp file. 

My question now is: If I know I am crashing, should I just terminate the process and hope the customer notices (this is a background task)? (NOTE: When using the API above, Windows does not display the standard error message since you are handling it)  Or pop up a MessageBox (with MB_SERVICE_NOTIFICATION)?  Problem with the MessageBox is I believe other threads are still running and who knows what state they'll be in.  There are other notification mechanisms available, but I'm not sure how much the code can be trusted in this state.

So how do you code for situations where the code can no longer be trusted?
Doug Send private email
Tuesday, May 09, 2006
 
 
You should check out XCrashReport ( http://www.codeproject.com/debug/XCrashReportPt4.asp ).

I uses a seperate executable to handle the dump files and notify the user.
Dave Robbins
Wednesday, May 10, 2006
 
 
Neville Franks Send private email
Wednesday, May 10, 2006
 
 
Neville,

Does the above crash reporter work thru a firewall?
Mr. Analogy {Shrinkwrap µISV since 1995} Send private email
Wednesday, May 10, 2006
 
 
Answer for Firewall question:

According to the docs on codeproject, it requires a pre-configured email (mapi) client such as Outlook, Outlook Express, Eudora, etc, etc.

So YES, it works through firewalls, because its email based.
Heston T. Holtmann Send private email
Wednesday, May 10, 2006
 
 
>Neville,
>Does the above crash reporter work thru a firewall?

It very simply uses the users e-mail program, so assuming that works through a firewall there won't be a problem.

Firewalls don't block e-mail (smtp) to begin with, do they?
Neville Franks Send private email
Wednesday, May 10, 2006
 
 
XCrashReport looks like an awesome solution, except my apps runs as a service--I'm not sure if it is possible to show a UI from a service other than a MessageBox with MB_SERVICE_NOTIFICATION (I can't control whether the user specifies 'allow the service to interact with the desktop').

BUT, having a secondary app show the message box might be the compromise I need--that way the service can terminate immediately.

Thanks for the feedback.
Doug Send private email
Wednesday, May 10, 2006
 
 
Doug, XCrashReport is a stand-alone EXE.
Neville Franks Send private email
Thursday, May 11, 2006
 
 
Yes, I see it is a stand-alone, but if it is launched by a service (from the service's WinStation) it won't be visible to any logged on users (with the possible exception of the case where the service is running using the same credentials as an already logged on user, and even then I don't think it would be visible).
Doug Send private email
Thursday, May 11, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz