GNU Debugger (GDB)
The GNU Debugger is useful for:
- Performing interactive debugging - for a single process execution (or on a limited number of processes).
- Analyzing core files generated by an execution that terminated with a memory dump.
Memory Dump core Files Analysis
The following command allows opening a memory dump ‘core’ file with GDB:
gdb <binary> <coredump>
Inside the GDB interactive session, the backtrace command makes it possible to inspect the backtrace of routine calls. Example : Analysis of a Memory Dump core File (EMMA Application)
$ gdb coredir.0/core.93667
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
[…]
Core was generated by `~/emma/1.2/bin/emmacpu param.'.
Program terminated with signal 11, Segmentation fault.
#0 0x00001000279e1b78 in ?? ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-105.el7.ppc64le libgcc-4.8.5-4.el7.ppc64le libibverbs-1.1.8mlnx1-OFED.3.1.1.0.0.ppc64le libmlx4-1.0.6mlnx1-OFED.3.1.1.0.0.ppc64le libmlx5-1.0.2mlnx1-OFED.3.1.1.0.5.ppc64le libnl-1.1.4-3.el7.ppc64le libstdc++-4.8.5-4.el7.ppc64le numactl-libs-2.0.9-5.el7_1.ppc64le xorg-x11-drv-nvidia-devel-352.59-1.el7.ppc64le
(gdb) backtrace
#0 0x00001000279e1b78 in ?? ()
#1 0x0000000010033030 in PoissonMgrid (level=-952000048, param=0x10000022b5b0 <MPIDI_SendDoneCB>, firstoct=0x1000000f250c <MPIR_Barrier_intra+684>, cpu=0x10000032c770, stencil=0x14, stride=-952000048, tsim=6.72623263e-44)
at /pwrwork/login/emma/1.2/000008/000000_build/work/EMMA-develop/src/poisson_utils.c:1346
#2 0x0000000010033898 in PoissonSolver (level=-951999664, param=0x10028044442, firstoct=0x3fffc741a2b0, cpu=0x10000032c770, stencil=0x1000000f21fc <MPIR_Barrier_impl+172>, stride=-951999664, aexp=0)
at /pwrwork/login/emma/1.2/000008/000000_build/work/EMMA-develop/src/poisson_utils.c:1546
#3 0x0000000010023bac in Advance_level (level=-951998944, adt=0x0, cpu=0x3f8a502100000000, param=0x405335436a8046bf, firstoct=0xc01eb0a6e0000000, lastoct=0xbff6dc31c0000000, stencil=0x1000006d1370 <_pthread_cleanup_pop_restore>,
gstencil=0x0, rstencil=0x10009c180010, ndt=0x1000598dbc0, nsteps=-951998944, tloc=0) at /pwrwork/login/emma/1.2/000008/000000_build/work/EMMA-develop/src/advanceamr.c:442
#4 0x000000001000350c in main (argc=2, argv=0x3fffc7437688) at /pwrwork/login/emma/1.2/000008/000000_build/work/EMMA-develop/src/emma.c:1949
(gdb)