웬디의 기묘한 이야기

글 작성자: WENDYS
반응형

User Process Crash Dump

윈도우 XP에서는 닥터 왓슨을 이용하여 크래시 덤프를 남기지만 Vista 이상에선 사라졌습니다.

Vista이상에선 WER(Windows Error Reporting) 시스템이 MS에 덤프를 전송하지만 로컬에는 남지 않도록 되어있습니다.


이런경우 간단한 설정(?) 으로 로컬에 덤프를 남기도록 설정할 수 있습니다.


https://msdn.microsoft.com/ko-kr/library/windows/desktop/bb787181(v=vs.85).aspx

 

Collecting User-Mode Dumps - Windows applications

Starting with Windows Server 2008 and Windows Vista with Service Pack 1 (SP1), Windows Error Reporting (WER) can be configured so that full user-mode dumps are collected and stored locally after a user-mode application crashes.

docs.microsoft.com


MSDN에 나와있듯이 해당 기능의 기본적으로 활성화 되어있지 않습니다.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps 해당 키는 직접 추가를 해야하며, 내부 설정값은 다음과 같습니다.

ValueDescriptionTypeDefault value
DumpFolderThe path where the dump files are to be stored. If you do not use the default path, then make sure that the folder contains ACLs that allow the crashing process to write data to the folder.

For service crashes, the dump is written to service specific profile folders depending on the service account used. For example, the profile folder for System services is %WINDIR%\System32\Config\SystemProfile. For Network and Local Services, the folder is %WINDIR%\ServiceProfiles.

REG_EXPAND_SZ%LOCALAPPDATA%\CrashDumps
DumpCountThe maximum number of dump files in the folder. When the maximum value is exceeded, the oldest dump file in the folder will be replaced with the new dump file.REG_DWORD10
DumpTypeSpecify one of the following dump types:
  • 0: Custom dump
  • 1: Mini dump
  • 2: Full dump
REG_DWORD1
CustomDumpFlags

The custom dump options to be used. This value is used only whenDumpType is set to 0.

The options are a bitwise combination of the MINIDUMP_TYPEenumeration values.

REG_DWORD

MiniDumpWithDataSegs | MiniDumpWithUnloadedModules | MiniDumpWithProcessThreadData


수동으로 추가하면 간단히 할 수 있으며, 자동을 위하여 .reg 파일을 생성하여 필요시마다 이용할 수 있습니다.


단, *.reg 파일로 만들경우 REG_EXPAND_SZ형태가 hex 값으로만 입력 가능합니다.


직접 만들기 귀찮으신분들은 제가 만들어놓은 해당 reg를 이용하시기 바랍니다.

해당 reg의 DumpFoler는 %LOCALAPPDATA%\CrashDumps 으로 설정되있으며, 원하는 경로로 변경하여 재등록 가능합니다.


usermode_dump_enable.reg

해당파일을 이용하여 등록 후 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps 경로에서 수정이 가능합니다.


위와같이 설정해놓으면 process crash 발생시 process_name.1234.dump 와 같이 name.pid.dmp 형태로 남게됩니다.



반응형