[Q-e-developers] Using Valgrind and GDB with QE

Thomas Markovich thomasmarkovich at gmail.com
Thu May 5 15:48:00 CEST 2016


Hi,

I'm preparing to push my module that implements the Many Body Dispersion
van der Waals correction, and all associated forces. As a last thing, I ran
my code through valgrind, and it seems to have popped up a couple of
remaining things that I would like to fix before release[1]. Unfortunately,
the valgrind output below is less than clear on where exactly the error is,
and it doesn't give any important line numbers. Beyond this, addr2line
gives thoroughly unhelpful output:
▶ gaddr2line -e pw.x 0x100520518
??:0.

I have compiled QE given the following flags with gfortran 4.9:
FFLAGS         = -Og -g -pg -fopenmp -fbacktrace -fcheck=all
-finit-real=nan -ffpe-trap=zero,invalid,zero,overflow

Is there any way to compile QE such that it generates all the debugging
symbols, so that I can get more readable and informative output from
valgrind? I thought all I needed was the -g flag, but it appears that I
might need more?

Best,
Thomas Markovich

[1]
==10233== Invalid write of size 8
==10233==    at 0x100520518: __mbdvdw_module_MOD_mbdvdw_tgg_complex (in
/Users/tmarkovich/bin/pw.x)
==10233==    by 0x100555A88: __mbdvdw_module_MOD_mbdvdw_check_quantity_dh
(in /Users/tmarkovich/bin/pw.x)
==10233==  Address 0x103131248 is 8 bytes after a block of size 1,728
alloc'd
==10233==    at 0x1011814AB: malloc (in
/usr/local/Cellar/valgrind/HEAD/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==10233==    by 0x1005547B0: __mbdvdw_module_MOD_mbdvdw_check_quantity_dh
(in /Users/tmarkovich/bin/pw.x)
==10233==    by 0x1003D56E4: v_of_rho_ (in /Users/tmarkovich/bin/pw.x)
==10233==    by 0x1000F540B: electrons_scf_ (in /Users/tmarkovich/bin/pw.x)
==10233==    by 0x1000F6E18: electrons_ (in /Users/tmarkovich/bin/pw.x)
==10233==    by 0x10032AA28: run_pwscf_ (in /Users/tmarkovich/bin/pw.x)
==10233==    by 0x1000010BB: MAIN__ (pwscf.f90:30)
==10233==    by 0x100B67C1F: main (pwscf.f90:14)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20160505/17ebcd69/attachment.html>


More information about the developers mailing list