9 Commits

Author SHA1 Message Date
Philippe Waroquiers
bc758374a2 Add a test for the new gdbserver adddress[length] syntax. 2019-05-18 12:10:40 +02:00
Petar Jovanovic
33a203f1cb force old implementation of std::string for leak_cpp_interior test
This patch forces leak_cpp_interior to be compiled using old implementation
of std::string.

Related issue #373069

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16217
2017-01-31 18:22:20 +00:00
Philippe Waroquiers
e97d5ed3eb Unbreak the build on several setups :
It looks like the standard says that
   #define __STDC_FORMAT_MACROS
is needed in c++ in order to have PRIxPTR defined.

At least on gcc110 g++ 4.7.2, leak_cpp_interior.cpp
was not compiling.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15435
2015-07-22 21:37:06 +00:00
Julian Seward
ac60633d65 Bug 345248 - add support for Solaris OS in valgrind
Authors of this port:
    Petr Pavlu         setup@dagobah.cz
    Ivo Raisr          ivosh@ivosh.net
    Theo Schlossnagle  theo@omniti.com
            


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426
2015-07-21 14:44:28 +00:00
Philippe Waroquiers
6629c56543 Add a new heuristic 'length64' to detect interior pointers
pointing at offset 64bit of a block, when the first 8 bytes contains
the block size - 8. This is e.g. used by sqlite3MemMalloc.

Patch by Matthias Schwarzott (with small modif)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14179
2014-07-21 19:55:11 +00:00
Philippe Waroquiers
fa45410976 Fix assert for who_points_at monitor cmd for an interiorly pointed block
* fix the assert
* some better comments
* update test to verify who_points_at behaviour with an interiorly pointed block



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13609
2013-10-02 20:59:05 +00:00
Florian Krohm
3bd1597a41 Silence clang warnings about uninitialised and unused values in
memcheck testcases.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13599
2013-10-01 22:38:43 +00:00
Philippe Waroquiers
0925d04c4e Use global vars to point at possibly leaked
Depending on the compiler or optimisation level, the blocks that
are supposed to be possibly leaked are still reachable.
=> change the pointers to be global variables,
and do the allocation in a function, not in main.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13591
2013-09-30 21:17:09 +00:00
Philippe Waroquiers
e2ba2f3671 add heuristics decreasing false possible "possible leaks" in c++ code.
The option --leak-check-heuristics=heur1,heur2,... can activate
various heuristics to decrease the number of false positive
"possible leaks" for C++ code. The available heuristics are
detecting valid interior pointers to std::stdstring, to new[] allocated
arrays with elements having destructors and to interior pointers pointing
to an inner part of a C++ object using multiple inheritance.

This fixes 280271 Valgrind reports possible memory leaks on still-reachable
std::string 

This has been tested on x86/amd64/ppc32/ppc64.

First performance measurements seems to show a neglectible impact on
the leak search.

More feedback welcome both on performance and functional aspects
(false positive 'possibly leaked' rate decrease and/or 
false negative 'possibly leaked' rate increase).

Note that the heuristic is not checking that the memory has been
allocated with "new" or "new[]", as it is expected that in some cases,
specific alloc fn are used for c++ objects instead of the standard new/new[].
If needed, we might add an option to check the alloc functions
to be new/new[].



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13582
2013-09-29 13:47:32 +00:00