On my Debian/sid system, I get a large pile of errors when running my program through valgrind. Unfortunately, the errors do not tell me, where valgrind believes the problem is:
==24268== Use of uninitialised value of size 8
==24268== at 0x51CF257: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
==24268== by 0x18D4F9: ??? (in /path/to/app)
==24268== by 0x19A369: ??? (in /path/to/app)
==24268== by 0x19A6F0: ??? (in /path/to/app)
==24268== by 0x19A8C7: ??? (in /path/to/app)
==24268== by 0x19267A: ??? (in /path/to/app)
==24268== by 0x192857: ??? (in /path/to/app)
==24268== by 0x192A20: ??? (in /path/to/app)
==24268== by 0x19ABF6: ??? (in /path/to/app)
==24268== by 0x11E0B9: ??? (in /path/to/app)
==24268== by 0x5155B16: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
==24268== Uninitialised value was created by a stack allocation
==24268== at 0x19A2E0: ??? (in /path/to/app)
==24268==
==24268== Use of uninitialised value of size 8
==24268== at 0x51CF440: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
==24268== by 0x18D4F9: ??? (in /path/to/app)
==24268== by 0x19A369: ??? (in /path/to/app)
==24268== by 0x19A6F0: ??? (in /path/to/app)
==24268== by 0x19A8C7: ??? (in /path/to/app)
==24268== by 0x19267A: ??? (in /path/to/app)
==24268== by 0x192857: ??? (in /path/to/app)
==24268== by 0x192A20: ??? (in /path/to/app)
==24268== by 0x19ABF6: ??? (in /path/to/app)
==24268== by 0x11E0B9: ??? (in /path/to/app)
==24268== by 0x5155B16: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
==24268== Uninitialised value was created by a stack allocation
==24268== at 0x19A2E0: ??? (in /path/to/app)
==24268==
Intead of the ominous ???
I would have expected something like <filename>:<linenumber>
and/or <functionname>
.
Of course the program has been compiled with -g
, and no debug symbol have been stripped afterwards:
$ file app
app: ELF 64-bit LSB pie executable x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=6a2de5a8779ca1f745cb79999f6e24adc73def7d, with debug_info, not stripped
And some system info:
$ dpkg-query -W gcc libc6 valgrind
gcc 4:7.3.0-3
libc6:amd64 2.27-4
libc6:i386 2.27-4
valgrind 1:3.13.0-2+b1
$ valgrind --version
valgrind-3.13.0
So my question is: Why doesn't valgrind give me an indication of where the problem happens, and how can I fix it?
You might have hit https://bugs.kde.org/show_bug.cgi?id=395682, which contains some (not yet pushed) patches proposals.