Fog Creek Software
Discussion Board




Code for Windows crash reports?

We use a ton of custom internal tools for artists at our company (a game company).

These tools are often unstable and crash.  I want to be able to get crash reports in the field -- basically I guess the exception handler should send e-mails to some address with info on what happened.

I would like to also get the PC name and user name.  In additional, it is feasible for us to compile debug info (symbols) into the tools.  It would be even better if the exception handler could include a stack trace with symbols.

Is there any code out there that does this?  All tools are developed and run under Windows.

I basically want the microsoft crash dialog, but in a form customized to our needs and send to us and not them, obviously.

Roose
Wednesday, September 01, 2004

I found a couple at the Code Project website, but one of them doesn't seem to work when I run the .exe tests.

Anyone have any direct experiences or recommendations in this area?

Roose
Wednesday, September 01, 2004

Your should hire decent Windows software engineers so that your applications don't crash in the first place.

.
Wednesday, September 01, 2004

COMPUTERNAME and USERNAME environment variables will tell you the username and computer name.

http://win32.mvps.org/ looks to have exactly what you need in the stack walking department. (Also handy for operator new.)

Tom_
Wednesday, September 01, 2004

Check Virutal Dub (www.virtualdub.org). It has crash reporting and I think it even has a disassembler. It's open source.

Dan Maas
Wednesday, September 01, 2004

You're a "game compnay" but you can't write programs that don't crash a lot?

Wassup Wit Dat??

Bob's Your Uncle
Wednesday, September 01, 2004


Normally game code is written and a *MUCH* lower level than your run of the mill ASP, so crashes don't always just generate nice little error codes.

Some just die.

KC
Wednesday, September 01, 2004

> Normally game code is written and a *MUCH* lower level than your run of the mill ASP, so crashes don't always just generate nice little error codes.

That's not an excuse. I write games. There is no excuse for either games or, in this case, artists' tools, crashing. No excuse. Also, artists' tools are much the same as general applications anyway.

.
Wednesday, September 01, 2004

I was just talking to a brilliant sysadmin about this the other day...

the following link is to a MS product that hijacks the MS error reporting messages, send it to a secure machine on your network. And it does much more!

http://www.microsoft.com/resources/satech/cer/

PopCulture
Wednesday, September 01, 2004

"There is no excuse for either games or, in this case, artists' tools, crashing."

Artists tools crash all the time, what studio are you from?? Not only do the new guys/interns always end up doing tools, but nobody has the budget to spend money to QA a tool. And who's going to train the testers?

It's a lot easier just to have them come get you if something like that happens (which they probably do, anyway). A stack dump or even the line of code it crashes on has rarely been helpful to me, in my experience. Usually you want to be able to quiz them on what they were doing and how you can recreate it.

I think email type crash reports are only useful for a public beta. If you only have 10 or 20 users, don't bother.

Game Programmer Bob
Wednesday, September 01, 2004

Bob, these guys probably have probably never worked on a team of 60 or 100 people, shipping console games that sells millions of copies.  Not even going to bother with these jokers -- go get a job in the game industry (no not writing code in your bedroom) and then talk.

As for your comment about it not being that useful, the problem is supporting all the artists is more than a full time job.  They don't always tell you when things crash, they come up with weird workarounds that may bite you later.  I want to see what is crashing and how often, and focus on the most common ones.

Often the tools crash on out of date source files (e.g. a format change), and the new guys can't figure out why while the old guys can recognize what data was bad or what they need to do a get on... much better to replace these crashes with some error messages.

Thanks to all who provided links and info.

Roose
Wednesday, September 01, 2004

and don't forget drwtsn32

mb
Wednesday, September 01, 2004

A very old article on MSDN explains how to do this in detail:

http://www.microsoft.com/library/images/msdn/library/periodic/periodic/msj/hood897.htm

You may find a better version of this article with all related code sample in your MSDN Library DVD.

GinG
Wednesday, September 01, 2004

I wrote a windows error reporting clone for some software a year or two ago and the best source of info was this article:

http://www.codeproject.com/debug/postmortemdebug_standalone1.asp

Basically, you override the default unhandled exception handler and get that to create a minidump file when a crash occurs. You then fire off a separete exe that packages that up and ftps it back to base (or emails it). Back at base you load the minidump under VS.NET 2003, check the build number of the exe that crashed, locate the debug symbols you build and stored for that exe (you did keep a copy didn't you?), and hey presto, you get a stack trace.

Just read the article, or if you'd prefer to look at a working example, drop me an email and I'll send you the source.

John C
Thursday, September 02, 2004

Oh, it's worth noting that you don't need to build your application with VS.NET 2003, you can build it with VC6. It's just that you need VS.NET 2003 to read the minidump file (although there are alternatives).

John C
Thursday, September 02, 2004

Microsoft already wrote most of the code for you (at least in XP and 2003). Look at the Windows Error Reporting stuff (start from https://winqual.microsoft.com/info/default.aspx ). The service is free, but you do need a Verisign Digital ID.

See also http://weblogs.asp.net/chris_pratley/archive/2004/02/04/67276.aspx for some good info/pointers .

Just me (Sir to you)
Thursday, September 02, 2004

>That's not an excuse. I write games. There is no excuse for either games or, in this case, artists' tools, crashing. No excuse.
If Everquest can get away with it, and they have some half million monthly subscribers, I suppose anyone else can get away with it. But then,  the number of crashes went up about tenfold when they made everyone upgrade to DirectX 9. I don't know what else changed at that time, but that is when it went from occasional annoyance to crashing several times per playing session.

Peter
Thursday, September 02, 2004

*  Recent Topics

*  Fog Creek Home