IBSurgeon library

How to configure Firebird dump collection on Windows

Shortly, there are 3 steps:

  1. If you have installed Firebird with Guardian option, disable Firebird Guardian - set its service to Disable, and change Firebird Server from manual to automatic.

  2. Set in firebird.conf parameter BugCheckAbort=1 (and uncomment, if necessary), and restart Firebird to apply.

  3. Configure and verify dump collection for Firebird executable in Windows Error Reporting (WER)

Important!

Make sure you have files with debug information (extension *.pdb) in Firebird folder. HQbird Enterprise distribution already has these files, and for community Firebird, these files can be download from the Firebird download page - use download link with “debug”.

The following pdb files should be put:

for Firebird 2.5.x:

fbclient.pdb, fbembed.pdb, fbserver.pdb fb_inet_server.pdb - to bin\ folder of Firebird

for Firebird 3.x and Firebird 4.x:

fbclient.pdb and firebird.pdb - to the root folder of Firebird;

engine12.pdb (for 3.x) and engine13.pdb (for 4.x) - to the folder plugins\

Setting up WER

Ready-to-use reg files

Enable WER

/download/dump/wer_fb_on2.reg

Disable WER

/download/dump/wer_fb_off.reg

Below is the detailed description what should be done to setup it manually:

To setup WER, find in the registry the following key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows

and open its subkeys.

Highlight " Windows Error Reporting" and make sure there is a parameter with the name Disabled, type REG_DWORD, and its value is 0.

Open it.

Note! Don’t confuse this key with HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Error Reporting (without Windows after Microsoft\).

In the key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting

create and (or only set if created) parameter:

name: DontShowUI

type: DWORD

value: 1

Then, on the opened key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting

find subkey LocalDumps; create it, if it does not exists.

Then open HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps.

WER allows specifying common and local (private) settings.

In general, we need dumps for all processes.

For this, create parameters to subfolder LocalDumps:

  • DumpFolder, REG_EXPAND_SZ, - folder name where to store dumps. It should have enough free space (~2x times of RAM of the server if you are running SuperServer or SuperClassic). Also, accounts that are used to run services to be dumped must have permissions for this folder (that’s why network location can be a bad choice, since LocalSystem account, which is used by Firebird, does not have rights to access remote locations).
  • DumpCount, REG_DWORD, - max number of dump files (dumps will be rotated after reaching its number), set 2 or more
  • DumpType, REG_DWORD, - dump type, must be 2.

When a crash will occur, the dump file will be created in the folder, configured in DumpFolder!

More details on WER setup

  1. https://docs.microsoft.com/en-us/windows/desktop/wer/wer-settings

  2. https://docs.microsoft.com/en-us/windows/desktop/wer/collecting-user-mode-dumps

How to check dump creation (only when no actual users are connected!)

To test dump collection, we need to provoke Firebird crash: download /download/killudf/badudf.dll.7z

unzip and put the badudf.dll to folder UDF ( don’t forget to remove it after the test!) and then run the following cmd file

@echo off

setlocal enabledelayedexpansion enableextensions

set fbc=C:\HQBird25.in

set dbnm=%~dp0tmptest.fdb.tmp

set usr=SYSDBA

set psw=masterkey

del !dbnm! 2>nul

echo create database 'localhost:!dbnm!' user '!usr!' password '!psw!'; | "!fbc!\isql.exe" -q -z

(

echo set echo on;

echo declare external function crashme

echo returns int by value

echo entry_point 'crashme' module_name 'badudf';

echo commit;

echo show function;

echo select crashme(^) from rdb$database;

) > %~dp0tmptest.sql.tmp

"!fbc!\isql.exe" localhost:!dbnm! -q -i %~dp0tmptest.sql.tmp -user !usr! -pas !psw!

del !dbnm!

del %~dp0tmptest.sql.tmp

Contact us

If you are experiencing Firebird crashes or other abnormal behavior, please contact us: [email protected]