Invalid read optimized build false positive

Volker Weißmann <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>
Hello,

Valgrind reports "invalid read" in my program, but only if I compile it
with -O3 and not if I compile it with -O2, -O1 or -O0. The -g option
doesn't change this. Is it possible that valgrind reports false
positives if the -O3 option is used? If yes, how can I confirm this
message is indeed a false positive?

I couldn't find anything in the documentation except for this quote from
https://valgrind.org/docs/manual/quick-start.html:

Compile your program with |-g| to include debugging information so that
Memcheck's error messages include exact line numbers. Using |-O0| is
also a good idea, if you can tolerate the slowdown. With |-O1| line
numbers in error messages can be inaccurate, although generally speaking
running Memcheck on code compiled at |-O1| works fairly well, and the
speed improvement compared to running |-O0| is quite significant. Use of
|-O2| and above is not recommended as Memcheck occasionally reports
uninitialised-value errors which don't really exist.

But here, they only talk about uninitialised-value's and not about
invalid-reed's.


Greetings

Volker Weißmann

_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.