Debugging with gdb on Linux

In case the UrBackup server crashes on Linux a gdb stacktrace is a very helpful tool in finding the cause of the crash.

 

    1. You'll need a self-compiled version of the UrBackup server, as the precompiled versions do not include debugging information. See e.g. here for how it is done
    2. You need to have the gdb debugger installed
    3. With UrBackup server > 2.0:
      1. Run the UrBackup server via
        gdb --args urbackupsrv run -v debug
        If you want to log off while it runs, run it in screen
    4. With UrBackup Server >= 1.3:
      1. Run the UrBackup server via
        start_urbackup_server --loglevel debug --run_in_gdb
        If you want to log off while it runs, run it in screen
    5. If log rotation is enabled enter "handle SIGHUP nostop" in the gdb command prompt to prevent gdb from stopping during log rotation
    6. Enter run in the gdb command prompt to start the server
    7. Once it crashed enter bt to get information on the location where it crashed.