Debugging DUNE far detector SW

From DUNE
Revision as of 13:36, 20 July 2015 by DavidAdams (talk | contribs) (Created page with "== Crashes == LArSoft will sometimes crash with a stack trace but other times simply exit prematurely without any error message. In the latter case, it may help to run in a de...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Crashes

LArSoft will sometimes crash with a stack trace but other times simply exit prematurely without any error message. In the latter case, it may help to run in a debugger (e.g. gdb) and then print the stack trace when the program terminates. In gdb, the command "bt" will show the trace.

gdb

To run with gdb, I replace the command "lar $ARGS" with "gdb --args lar $ARGS" followed by the gdb command "r". One can also attach to an existing process with "gdb -a PID".

To stop execution when an exception is raised, use the gdb command "catch throw".

totalview

At FNAL, one can debug with totalview.

FCL

LArsSoft can have a rather complicated nest of FCL files to set parameter values. To see the final value assignments, export the variable ART_DEBUG_CONFIG=1 before running.