1

I have program that compile with -g and -o0 , and I run this program with valgrind :

valgrind --leak-check=full \
         --show-leak-kinds=all \
         --track-origins=yes \
         --verbose \
         --log-file=valgrind-out.txt \
         ./executable exampleParam1

I have some error but valgrind doesn't present the file and line

==22544== Conditional jump or move depends on uninitialised value(s)
==22544==    at 0x8048654: memcpy (in /path_to_binary)
==22544==  Uninitialised value was created 
==22544==    at 0x80486DB: brk  (in /path_to_binary)

How to make valgrind present to line and file of errors?

Paul Floyd
  • 5,530
  • 5
  • 29
  • 43
parser1234
  • 111
  • 1
  • 7
  • 3
    Can we see the build output (in verbose mode, so we can see the actual flags used)? Can we see your exact build settings (`Makefile`, `CMakeLists.txt` or similar)? And you don't `strip` the executable once built? – Some programmer dude Jun 04 '20 at 12:31
  • 2
    Also note that those functions mentioned by Valgrind are system functions that one generally don't have the source to. Doesn't Valgrind say anything else? Please include the full output of Valgrind. – Some programmer dude Jun 04 '20 at 12:33
  • GCC command line options are case sensitive; `-o` and `-O` do completely different things. Try again with `-O0`. Also make sure there isn't another `-O` option later on the command line; the last one wins. – zwol Jun 04 '20 at 12:46
  • `arm-linux-gcc -static -O0 -g -Wall -c -fmessage-length=0 -MMD -MP...` I don't strip that binary ... – parser1234 Jun 04 '20 at 12:48
  • Related: https://stackoverflow.com/q/7506134/72178 – ks1322 Jun 04 '20 at 13:48
  • Does your executable have a `main()` and maybe other functions that you are expecting to see in the callstack? – Paul Floyd Jun 05 '20 at 08:22

0 Answers0