Re: [GD-Windows] RE: [Algorithms] Crash helper
Brought to you by:
vexxed72
From: Mike W. <mi...@ge...> - 2004-04-12 08:25:36
|
The only other thing i can suggest (from our own experience with strange crashes like this) is to use a LOT of logging output that does the same basic thing that try loops do, except output human-readable output to the log (and soon in-engine console) when errors occur. We do alot of things like this: theGraphicsEngine = new CGraphicsEngine(bFullScreen, nWidth, nHeight, szTitle, hInstance, chTheDriver, bSoftware, UseDialog, szStartLevel); if(theGraphicsEngine == NULL) { theGraphicsEngine ->ReportError("Can't create Graphics engine!\n", true); return -1; } It's not rocket science, but used liberally throughout the engine it provides us with at least an idea of WHERE exactly the issue is occuring. I've been going on a 'debuglog' wave of late adding as much of this kind of logging output to the various sub-classes as appropriate. By setting a 'DEBUGLEVEL' define (either at runtime or compile), you could set it up to disable or enable the output logging, and can also set the debug to go to the console (ie in-game) if desired. (by default i leave it on - personally i like seeing the various sub-systems fire up as the engine loads) Our developers as a whole don't use any memory/crash dumps, stricly logging errors. It's not the perfect solution, but debugging full-screen apps just isn't really fun, and the logging technique has been working for the 5 years we've been putting out releases. Unfortunately none of our programmers speak native binary or hex and the protocol droid is in the shop... Good luck, lookin forward to seeing the Suffering in stores soon ;} Cheers Mike W www.realityfactory.ca Jon Watte wrote: > I'm copying this to gd-windows, which is where the question should be asked. > (gam...@li...) > > We wrap our game loop in __try / __except and do a crash dump in the except > handler: > > > static BOOL (WINAPI * MyMiniDumpWriteDump)( > HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION, > PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION ); > static HMODULE hDbgHelp = (HMODULE)INVALID_HANDLE_VALUE; > > void InitExceptionSupportAtProgramStart() > { > hDbgHelp = LoadLibrary( "DbgHelp.dll" ); > if( hDbgHelp != (HMODULE)INVALID_HANDLE_VALUE ) { > *(FARPROC *)&MyMiniDumpWriteDump = GetProcAddress( hDbgHelp, > "MiniDumpWriteDump" ); > } > } > > DWORD ExceptionHandler() > { > if( MyMiniDumpWriteDump ) { > HANDLE hFile = CreateFile( ... ); > ... GetExceptionInformation() ... > (*MyMiniDumpWriteDump)( ... ); > CloseHandle( hFile ); > } > else { > // walk the stack from esp up to stack base, looking > // for things that returns like return addresses into > // our executables and DLLS, using the ImageHelp library > // and address/code sniffing; dump into a text-mode file > } > return EXCEPTION_EXECUTE_HANDLER; > } > > > __try { > while( 1 ) { > GameLoop(); > } > } > __except( ExceptionHandler() ) { > UserMessage( "The computer hates you." ); > ExitProcess( -1 ); > } > > > > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...]On Behalf Of Tom > Vykruta > Sent: Thursday, April 08, 2004 4:48 PM > To: gda...@li... > Subject: [Algorithms] Crash helper > > > I apologize for a slightly off topic question, but it's advanced and > hopefully someone has ideas. I'm currently in the midst of running a PC > game (The Suffering) through QA. Unfortunately when it crashes, there is > nothing helpful besides "Crashed to desktop". I want a crash report > generated. I can ship the PDB along with the game, or not. The ideal > thing would be to dump the stack, registers, and perhaps even > disassembly at the crash site. Are there any existing ways to do this? > > I'm compiling under .NET 7.1 + D3D9, pretty standard setup. Thanks all. > > Tomas Vykruta > Project Lead, The Suffering PC > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_ida88 > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > |