The WebKit Open Source Project

Getting a Useful Crash Log

Crash logs are incredibly useful when trying to track down a bug, especially if it's not immediately reproducible.

OS X

Obtaining a crash log on OS X is incredibly easy since it automatically creates easily accessible crash logs for you.

  1. If WebKit has just crashed or you can easily reproduce the crash, press the Report button on the CrashReporter dialog box to view the crash information.

    OS X Crash report box
  2. Copy and paste the entire contents of the top portion of the CrashReporter window into your favorite text editor and upload it as an attachment in Bugzilla.

    OS X Crash log
  3. If the crash report dialog does not appear or the crash is hard to reproduce, crash logs can be retrieved from the ~/Library/Logs/CrashReporter folder.

    On Leopard (Mac OS X 10.5), crash logs are stored as individually dated and time stamped files. Despite having a “.crash” extension, they are plain text files and can be attached directly to a bug report.

    On Tiger (Mac OS X 10.4), all crashes are logged to Safari.crash.log. This is a plain text file and can be viewed in the default Console.app or your favorite text editor. All of Safari's crashes are logged to this file so please only attach the last crash in it. Crashes are separated by a series of asterisks (∗∗∗∗∗∗∗∗∗∗) for easy identification.

Windows XP

Windows XP does not automatically log crashes like OS X, but it does include Dr. Watson, an easy to set up tool that can be configured to log them.

  1. In the Start menu's Run box or from a DOS or Cygwin prompt, enter the command drwtsn32 -i.

    Dr Watson install command
  2. A dialog box will appear informing you that Dr. Watson has been installed as the default debugger. Press OK.

    Dr Watson was installed box
  3. Crash information will now be logged to the user.dmp file in C:\Documents and Settings\All Users\Application Data\Microsoft\Dr Watson\.

    Dr. Watson will create a user.dmp file that records what WebKit was doing when it crashed. Be careful as it is overwritten with every crash.

    When reporting a WebKit bug, please upload the user.dmp file if possible.

  4. Running drwtsn32 without any options or switches will bring up a window that allows you to change various setting such as moving the log folder to a more easily accessible location or throwing a visual alert letting you know it caught the crash.

    Dr Watson window

Windows Vista

Windows Vista does not include Dr. Watson. Instead, Windows Error Reporting (WER) has been integrated into the operating system. By default, Vista uploads the crash logs to Microsoft, but does not save a local copy. This is configurable via the registry.

  1. Save the following text to a file named wer.reg:

    Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting] "ForceQueue"=dword:00000001
  2. Double-click the file from Windows Explorer and respond affirmatively to any prompts.

  3. Reboot

The next time Safari (or any other application) crashes, the crash information will be written into a folder located inside %LOCALAPPDATA%\Microsoft\Windows\WER\ReportQueue. Check the modification date to make sure you are using the correct file.

Be sure to include the following files in your bug report:

WERxxxx.tmp.mdmp
This is the most important file. It contains the crash dump that can be opened inside Visual Studio or other Windows debuggers.
WERxxxx.tmp.version.txt
Contains the operating system version and other hardware information.
WERxxxx.tmp.appcompat.txt
Lists all of the DLLs loaded at the time of the crash with their version information.