Hi Philippe, I found that I can work around the problem of gdb failing to produce backtraces by compiling with -O0. Switching to -O1 or higher is enough to cause issues. I also experimented using dwarf-2, dwarf-3, or dwarf-3 debug information but that did not seem to matter.
I tried to narrow down the problem with -O1, -gdwarf2, newer valgrind, and newer gdb: $ valgrind --tool=massif --vgdb-error=0 ../../Q2D/LamyRidge/src/model/LR_model ==4881== Massif, a heap profiler ==4881== Copyright (C) 2003-2013, and GNU GPL'd, by Nicholas Nethercote ==4881== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info ==4881== Command: ../../Q2D/LamyRidge/src/model/LR_model [...] $ gdb ../../Q2D/LamyRidge/src/model/LR_model GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. [...] (gdb) target remote | /usr/lib/valgrind/../../bin/vgdb --pid=4881 Remote debugging using | /usr/lib/valgrind/../../bin/vgdb --pid=4881 [...] (gdb) b taehdf5.f90:1936 (gdb) c (gdb) c (gdb) b H5FL_reg_calloc (gdb) c Continuing. Breakpoint 2, 0x00000000009a7da0 in H5FL_reg_calloc () (gdb) monitor v.info scheduler [...] Thread 1: status = VgTs_Runnable ==4881== at 0x9A7DA0: H5FL_reg_calloc (in /mnt/nfs-home/nrath/Q2D/LamyRidge/src/model/build/LR_model) ==4881== by 0x93DB39: H5A_create (in /mnt/nfs-home/nrath/Q2D/LamyRidge/src/model/build/LR_model) ==4881== by 0x937C60: H5Acreate2 (in /mnt/nfs-home/nrath/Q2D/LamyRidge/src/model/build/LR_model) ==4881== by 0x926A0D: h5acreate_c_ (in /mnt/nfs-home/nrath/Q2D/LamyRidge/src/model/build/LR_model) ==4881== by 0x920E06: h5a_mp_h5acreate_f_ (in /mnt/nfs-home/nrath/Q2D/LamyRidge/src/model/build/LR_model) ==4881== by 0x6CC1E0: taehdf5_mp_h5dump_attr_int_ (taehdf5.f90:1936) ==4881== by 0x6D2EAB: taehdf5_mp_h5append_data_double_0d_ (taehdf5.f90:4193) ==4881== by 0x6A23F6: plot_m_mp_plots_ (plot_hdf5.f:144) ==4881== by 0x6AC10F: lr_mod_m_mp_check_dt_ (LR_model.F:487) ==4881== by 0x6A4E96: lr_mod_m_mp_lr_step_ (LR_model.F:252) ==4881== by 0x6AC38F: MAIN__ (LR_model.F:544) ==4881== by 0x406F3D: main (in /mnt/nfs-home/nrath/Q2D/LamyRidge/src/model/build/LR_model) client stack range: [0xFFEBFE000 0xFFF000FFF] client SP: 0xFFEC2CF78 valgrind stack top usage: 12424 of 1048576 (gdb) bt #0 0x00000000009a7da0 in H5FL_reg_calloc () #1 0x000000000093db3a in H5A_create () #2 0x0000000000937c61 in H5Acreate2 () #3 0x0000000000926a0e in h5acreate_c_ () #4 0x0000000000920e07 in h5a_mp_h5acreate_f_ () #5 0x00000000006cc1e1 in taehdf5::h5dump_attr_int (loc_id=1, [..hangs for a while...] f=<error reading variable: Cannot access memory at address 0xa000008>, name=<error reading variable: Cannot access memory at address 0x832f5f9>, .tmp.NAME.len_V$1086=272) at /home/nrath/Q2D/utils/src/taehdf5.f90:1936 #6 0x00000000006d2eac in taehdf5::h5append_data_double_0d (group_id=1, f=<error reading variable: Cannot access memory at address 0xa000008>, name=<error reading variable: Cannot access memory at address 0x832f5f9>, .tmp.NAME.len_V$1cd8=272) at /home/nrath/Q2D/utils/src/taehdf5.f90:4193 #7 0x00000000006a23f7 in plot_m::plots (idt=1) at /home/nrath/Q2D/LamyRidge/src/model/plot_hdf5.f:144 #8 0x00000000006ac110 in lr_mod_m::check_dt (idt=1) at /home/nrath/Q2D/LamyRidge/src/model/LR_model.F:487 #9 0x00000000006a4e97 in lr_mod_m::lr_step (idt=1, dt_r=<error reading variable: Cannot access memory at address 0xa000008>, t_r=0) at /home/nrath/Q2D/LamyRidge/src/model/LR_model.F:252 #10 0x00000000006ac390 in lr_model () at /home/nrath/Q2D/LamyRidge/src/model/LR_model.F:544 So as far as I can tell, valgrind is getting the backtrace right. Is this correct? If so, I guess the only explanation is that I am not setting the breakpoint at the time where massif takes the snapshot? Best, -Nikolaus ------------------------------------------------------------------------------ _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users