Debugging with gdb on FreeNAS

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

 

Steps to get a gdb backtrace:

 

  1. Enter the shell of the UrBackup jail
  2. Install gdb in the shell via the command
    pkg_add -r gdb
  3. Shutdown the urbackup server:
    killall urbackupsrv
  4. Install tmux:
    pkg_add -r tmux
  5. Run tmux:
    tmux
  6. Start the UrBackup server in gdb:
    gdb --args /usr/local/sbin/urbackupsrv run -g 104857600 -u root
  7. Start the program in gdb:
    run
  8. Once it crashed enter the shell of the plugin jail again and attach to the tmux session:
    tmux attach
  9. Enter "bt" to get the backtrace to the location it crashed:
    bt
  10. Add the trace information to your bug report

 

How to get debug logging info:

  1. Export the Plugin filesystem via filesharing
  2. Access debug logfile at JAIL_ROOT/var/log