Pauseless error dump system (Exception Logger)

ProudNet provides the function that keeps recording error directory without shutting down the program in case of error in the program. This is called Pauseless error dump system (Exception Logger).

In case of crash at a general game server, program re-starts right after recording the error history (please refer to Tutorial for Error Dump System Construction) But in case it is absolutely necessary, the game server is kept operating without re-starting as error situation is maintained. You need to pay special attention because it is very dangerous for the server program whose memory has been damaged to be operated continuously.

1. Check list before creating pauseless error dump system.

  • You need to install DbgHelp library (dbghelp.dll).
  • You need to set C++ Exception compile option of Visual Studio (please refer to Compile Setting for Error Dump System).
  • Include : DumpCommon.h, MiniDumper.h
  • Link : ProudNetCommon.lib

2. Example of creating pauseless error dump system.

  • You need to call CExceptionLogger::Instance().Init() function from Main Entry Point and initialize CExceptionLogger instance.
  • You need to inherit IExceptionLoggerDelegate abstract class and override GetDumpDirectory() member, and then you must define dump file directory. In case of returning blank (""), dump files will be saved in the current folder.
  • Note
  • It is operated at the version of Windows XP/ Windows 2003 Server or later.
  • Performance of the program might become worse due to overload of log history in case of using CExceptionLogger class along with AtlTrace() or DebugOutputString().
#include "stdafx.h"
#include <atlpath.h>
#include "../../include/DumpCommon.h"
#include "../../include/MiniDumper.h"
using namespace Proud;
class CIExceptionLoggerDelegate : public IExceptionLoggerDelegate
{
public:
virtual String GetDumpDirectory()
{
return L"";
}
};
CIExceptionLoggerDelegate g_loggerInfo;
void AccessViolation()
{
try
{
int* a = 0;
// 이 루틴은 크래쉬를 의도적으로 발생시킵니다.
// This routine incurs crash on purpose.
// 该例程将会故意造成崩溃。
// このルーティンはクラッシュを意図的に発生させます
*a = 1;
}
catch (...) // catch(...) syntax itself is the usable C++ keyword!
{
// 위 try 구문에 의해 크래쉬가 발생할 경우
// 프로그램이 종료되지 않고 여기로 실행 지점이 오게 됩니다.
// 한편 exception logger에 의해 오류 로그가 파일로 남게 됩니다.
// When crash occurs by the above try syntax,
// the execution point moves to here without terminating the program.
// At the same time, exception logger leaves an error log file.
}
}
void main(int argc, char* argv[])
{
int menu = 0;
CExceptionLogger::Instance().Init(&g_loggerInfo);
while (1)
{
puts("MENU: 1. Access Violation('a')");
printf("> ");
menu = getchar();
switch (menu)
{
case 'a':
AccessViolation();
break;
default:
break;
}
}
}
  • Example of this source file is in <installation folder>\Sample\SimpleExceptionLogger.