History log of /external/valgrind/memcheck/mc_malloc_wrappers.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
09a4c794458cdb9dea743fa40e450150a2725257 18-Oct-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Change the definition of VgHashTable to not have pointer type.
This is (a) consistent with how the other containers are defined
and, more importantly, (b) allows the constification of the hash table API.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14639 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
021e6b676376a6654204ebf107876c5145c22222 22-Aug-2014 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Memcheck: add a new flag, --show-mismatched-frees=no|yes [yes], to
optionally disable allocator/deallocator mismatch checking.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14336 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
7b6899dd211aafa1e0d3e3a0dc0cf798ea882768 13-Jul-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Provide a back trace when a function argument of a known allocation
function is presumably negative. Fixes BZ 79311.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14157 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
0f157ddb404bcde7815a1c5bf2d7e41c114f3d73 18-Oct-2013 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates (20XY-2012 ==> 20XY-2013)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
8617b5b8f16570c9003379464d60e8572a801a8c 12-Jan-2013 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Implement --keep-stacktraces=alloc|free|alloc-and-free|alloc-then-free|none

The option --keep-stacktraces controls which stack trace(s) to keep for
malloc'd and/or free'd blocks. This can be used to obtain more information
for 'use after free' errors or to decrease Valgrind memory and/or cpu usage
by recording less information for heap blocks.

This fixes 312913 Dangling pointers error should also report the alloc
stack trace.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13223 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
3e7986312a0ffc7646b0552d4c4ea3744a870e73 24-Nov-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix some casts that removed const-ness as pointed out by
GCC's -Wcast-qual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13138 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
6bd9dc18c043927c1196caba20a327238a179c42 23-Nov-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Changes to allow compilation with -Wwrite-strings. That compiler option
is not used for testcases, just for valgrind proper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13137 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
a5f894c271248c13e0bb387e5ca33fa122b4819c 21-Oct-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> First round of Char/HChar fixes for memcheck.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13071 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
03f8d3fc25f5a45c5826259d1b33b7f310117279 05-Aug-2012 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates to include 2012.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
d99c26a4bc18fd3b17c4626c9c1fbd1583388660 01-Aug-2012 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Implement --redzone-size and --core-redzone-size

* For tools replacing the malloc library (e.g. Memcheck, Helgrind, ...),
the option --redzone-size=<number> allows to control the padding
blocks (redzones) added before and after each client allocated block.
Smaller redzones decrease the memory needed by Valgrind. Bigger
redzones increase the chance to detect blocks overrun or underrun.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12807 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
e529b8775429fc661a0f4c0b773199987601442b 05-Jul-2012 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Improve behaviour of mempool redzone checking if user does not follow the manual (297911)
User is supposed to mark the superblock(s) of a mempool as noaccess.
As Valgrind objective is to find bugs for users which are doing bugs, let's even
find (some) bugs if the user has a bug in the bug detection code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12714 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
a2cc0c0496f861d469cf2e7435bb322c17c35534 12-May-2012 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> fix 299756 (for symmetry, --free-fill must be ignored for MEMPOOL_FREE and FREELIKE client requests).

Test program from goodell@mcs.anl.gov



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12560 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
a22f59db02284784a1e5e51587e2ce09db3a2a18 27-Jan-2012 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> (fixes bug 289939 wish: complete monitor cmd 'leak_check' with details
about leaked or reachable blocks)

This patch implements two new memcheck gdbserver monitor commands:
block_list <loss_record_nr>
after a leak search, shows the list of blocks of <loss_record_nr>
who_points_at <addr> [<len>]
shows places pointing inside <len> (default 1) bytes at <addr>
(with len 1, only shows "start pointers" pointing exactly to <addr>,
with len > 1, will also show "interior pointers")


Compiled and reg-tested on f12/x86, deb5/amd64, f16/ppc64.

The 'block_list' command is implemented on top of the
lr_array/lc_chunks/lc_extras arrays used during the last leak search.
NB: no impact on the memory for the typical Valgrind usage where a leak
search is only done at the end of the run.
Printing the block_list of a loss record simply consists in scanning the
lc_chunks to find back the chunks corresponding to the loss record for which
block lists is requested.

The 'who_points_at' command is implemented by doing a scan similar to
(but simpler than) the leak search scan.
lc_scan_memory has been enhanced to have a mode to search for a specific
address, rather than to search for all allocated blocks.
VG_(apply_to_GP_regs) has been enhanced to also provide the ThreadId and
register name in the callback function.

The patch touches multiple files (but most changes are easy/trivial or factorise
existing code).

Most significant changes are in memcheck/mc_leakcheck.c :
* changed the LC_Extra struct to remember the clique for indirect leaks
(size of structure not changed).
* made lr_array a static global
* changed lc_scan_memory:
to have a search mode for a specific address (for who_points_at)
(for leak search) to pass a 'current clique' in addition to the clique
leader
so as to have a proper clique hierarchy for indirectly leaked blocks.
* print_results: reset values at the beginning of the print_result of the
next leak search, rather than at the end of print_results of the previous
leak search.
This allows to continue showing the same info for loss records till a new
leak search is done.
* new function print_clique which recursively prints a group of leaked
blocks, starting from the clique leader.
* new function MC_(print_block_list) : calls print_clique for each clique
leader found for the given loss record.
* static void scan_memory_root_set : code extracted from
MC_(detect_memory_leaks) (no relevant change)
* void MC_(who_points_at) : calls scan_memory_root_set, lc_scan_memory
and VG_(apply_to_GP_regs)(search_address_in_GP_reg) to search
pointers to the given address.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12357 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
6643e96a72e8530a7c8830c02ffb2fb4aee74c88 17-Jan-2012 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fixes 282230 group allocator for small fixed size, use it for MC_Chunk/SEc vbit

* new files include/pub_tool_groupalloc.h and coregrind/m_groupalloc.c
implementing a group allocator (based on helgrind group alloc).
* include/Makefile.am coregrind/Makefile.am : added pub_tool_groupalloc.h
and m_groupalloc.c
* helgrind/libhb_core.c : use pub_tool_groupalloc.h/m_groupalloc.c
instead of the local implementation.
* include/pub_tool_oset.h coregrind/m_oset.c : new function
allowing to create an oset that will use a pool allocator.
new function allowing to clone an oset (so as to share the pool alloc)
* memcheck/tests/unit_oset.c drd/tests/unit_bitmap.c : modified
so that it compiles with the new m_oset.c
* memcheck/mc_main.c : use group alloc for MC_Chunk
memcheck/mc_include.h : declare the MC_Chunk group alloc
* memcheck/mc_main.c : use group alloc for the nodes of the secVBitTable OSet
* include/pub_tool_hashtable.h coregrind/m_hashtable.c : pass the free node
function in the VG_(HT_destruct).
(needed as the hashtable user can allocate a node with its own alloc,
the hash table destroy must be able to free the nodes with the user
own free).
* coregrind/m_gdbserver/m_gdbserver.c : pass free function to VG_(HT_destruct)
* memcheck/mc_replace_strmem.c memcheck/mc_machine.c
memcheck/mc_malloc_wrappers.c memcheck/mc_leakcheck.c
memcheck/mc_errors.c memcheck/mc_translate.c : new include needed
due to group alloc.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12341 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
5544d5b82b6900c9ea69dfd4e786b69b0751cf99 30-Dec-2011 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix accounting for MC_(realloc). It was inconsistent as compared to
other wrappers in that it took place before the silly-args check.
Testcase and patch by Yann Droneaud (yann@droneaud.fr).
Fixes #281482

Also included is a related fix to MC_(new_block). Incrementing the
alloc counter and updating the allocated memory amount should
occur under the same condition (allocation succeeded).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12324 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
ec062e8d96a361af9905b5447027819dfbfee01a 23-Oct-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update all copyright dates, from 20xy-2010 to 20xy-2011.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
403d8aada736841ca05764ffe12ca78435c01d3a 22-Oct-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Improvements in freelist handling for Memcheck. See #250065.

(Philippe Waroquiers, philippe.waroquiers@skynet.be)

This patch provides three improvements in the way the free list is
handled in memcheck.

First improvement: a new command line option --freelist-big-blocks
(default 1000000) specifies the size of "free list big blocks".
Such big blocks will be put on the free list, but will be re-cycled first
(i.e. in preference to block having a smaller size).
This fixes the bug https://bugs.kde.org/show_bug.cgi?id=250065.
Technically, the freed list is divided in two lists : small
and big blocks. Blocks are first released from the big block list.

Second improvement: the blocks of the freed list are re-cycled before
a new block is malloc-ed, not after a block is freed.
This gives better error messages for dangling pointer errors
when doing many frees without doing malloc between the frees.
(this does not uses more memory).

Third improvement: a block bigger than the free list volume will be
put in the free list (till a malloc is done, so as the needed memory
is not bigger than before) but will be put at the beginning of the
free list, rather than at the end. So, allocating then freeing such a
block does not cause any blocks in the free list to be released.

Results of the improvements above, with the new regression test
memcheck/test/big_blocks_freed_list: with the patch, 7 errors
are detected, 6 are giving the (correct) allocation stack.
Without the patch, only 6 errors are detected, 5 errors without
allocation stack, 1 with a (wrong) allocation stack.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12202 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
913473803432ee37d6edaf232e21978d4f426125 25-Mar-2011 bart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9> Add VALGRIND_RESIZEINPLACE_BLOCK() and hence close #267819.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11666 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
7e30be47622c76b25cf4715d854237247f330298 28-Jan-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Somewhat reduce the amount of mempool sanity checking, so as to avoid
rendering the mempool machinery impossibly slow for pools containing
many blocks. Fixes #255966.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11513 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
62b9104a05dede4b9cabfaa483da76480131127e 23-Jan-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Improve error reports for addressing errors in the presence of
mempools: try and relate an invalid address to known mempool
allocated blocks, and if that fails, to malloc'd blocks that
back the mempool. See #254420.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11509 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
c1fc1333c8a093657031a0369b1e38d7e8749470 02-Sep-2010 bart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9> Improved support for VALGRIND_MALLOCLIKE_BLOCK in memcheck: error
messages printed for client-annotated blocks do now include a correct
address description. Closes #237371.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11320 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
9eecbbb9a9cbbd30b903c09a9e04d8efc20bda33 03-May-2010 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates to 2010.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
b6267bd61a3802bb2a16ef993c94bf834d0e2d2e 12-Aug-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Output tweaks:
- Always print a blank line after significant messages (eg. errors). This
makes the handling of blank lines much simpler.

- Don't print full stops at the end of messages. We mostly don't do it, so
I got rid of all the remaining ones I could find for consistency.

- Use --leak-check=full rather than --leak-check=yes, for consistency with
docs and other messages.

- Update partiallydefinedeq.stderr.exp2 for older changes.

This commit only updates the code. Test updates will follow shortly. (I'm
separating them so the code changes aren't swamped by the test changes in
the SVN logs.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10783 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
2d9e874b7a628ada216f09cc4f065798c65fffa4 07-Aug-2009 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Tidy up of messaging:

* For all tools and the core, don't show statistics when -v is in
effect. Instead, try to restrict -v to mostly user-useful
stuff.

* A new flag --stats=no|yes [no] produces statistics output instead.

* Fix longstanding problem in that Memcheck's leak checker ran after
the core's error manager module shut down, thereby not showing use
counts of leak suppressions. This fixes #186790.

* As a consequence, the leak checker text output of Memcheck has
changed a bit -- leak check is done before the final error
summary is done (much more logical), and the output has been
tidied up a bit.

* Helgrind, Drd and Ptrcheck now also print "For counts of
detected and suppressed errors, rerun with: -v", which makes
them consistent with Memcheck in this regard. These are
filtered out by the regtest filter scripts.

For all tools except Memcheck, the regtests are unchanged. On
Memcheck regtests still fail due to rearrangements of the leak
checker output. This will be fixed by a followup commit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10746 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
6b523cd2df025375e86b161de9995187edf2fcb6 15-Jul-2009 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge memcheck/ changes from branches/MESSAGING_TIDYUP r10464.
See trunk r10465 commit message for details.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10467 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
017d3770b1422714be2a85781e2ce12136864514 19-May-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> DARWIN sync wibble.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9929 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
9f207460d70d38c46c9e81996a3dcdf90961c6db 10-Mar-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Updated copyright years.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
1dcee097db02f9ef3ba355162c4373d90d0e895c 24-Feb-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Remove a number of unused parameters, found with -Wunused-parameter.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9248 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
8b140dee891a850c09d27f316df913acc7d7bae7 17-Feb-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> In the core, include malloc_usable_size() as one of the functions that must
be replaced if malloc() et al are replaced by a tool. This is because
different tools implement the function in different ways.

Add an appropriate malloc_usable_size() replacement to each of Memcheck,
Helgrind, DRD, Ptrcheck, Massif.

Update memcheck/tests/malloc_usable and add massif/tests/malloc_usable.

Merged from the DARWIN branch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9193 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
9c606bd8634cd6b67bb41fa645b5c639668cfa2d 18-Sep-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge all remaining changes from branches/PTRCHECK. These are some
relatively minor extensions to m_debuginfo, a major overhaul of
m_debuginfo/readdwarf3.c to get its space usage under control, and
changes throughout the system to enable heap-use profiling.

The majority of the merged changes were committed into
branches/PTRCHECK as the following revs: 8591 8595 8598 8599 8601 and
8161.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8621 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
b3238a58f44310b318879cfa644852831c859468 29-Jul-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Add a followup comment to the changes in r8454, which made memcheck's
client realloc function use an always-move strategy.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8469 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
8849a56b5f01adf3bac45037abe0bf1ed03c2e93 22-Jul-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Change memcheck's (client) realloc implementation so that it copies
and moves the block even when the new size is smaller or the same.
This increases the chance that it can detect buggy code which assumes
that realloc-smaller doesn't cause the block to move.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8454 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
a0b6b2cf9abc7b0d87be1215a245eaccc0452af9 07-Jul-2008 bart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merged FORMATCHECK branch (r8368) to trunk.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8369 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
7cf4e6b6aed533af53339f36099ed244dc4a5b7f 01-May-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge branches/OTRACK_BY_INSTRUMENTATION into the trunk. This adds
support to Memcheck for tracking the origin of uninitialised values,
if you use the --track-origins=yes flag.

This currently causes some Memcheck regression tests to fail, because
they now print an extra line of advisory text in their output. This
will be fixed.

The core-tool interface is slightly changed. The version number for
the interface needs to be incremented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7982 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
545380e43e6f1669af91e55bf9840a950db6469f 21-Apr-2008 bart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9> Refined mallinfo() implementation (contributed by Eugene Toder).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7901 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
b8b79addf04dd5d0b558916e26df0b1927cbd758 03-Mar-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge in the DATASYMS branch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7540 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
4d474d086188fd1f29fa97dbd84d8ea2e589a9b8 11-Feb-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates ("200X-2007" --> "200X-2008").


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
eb0fa9345010077e1e4852b238dde303b8f271b3 30-Nov-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> New options for Memcheck, --malloc-fill=<hexnumber> and
--fill-free=<hexnumber>, which cause malloc'd(etc) and free'd(etc)
blocks to be filled with the specified value. This can apparently be
useful for shaking out hard-to-track-down memory corruption. The
definedness/addressability of said areas is not affected -- only the
contents. Documentation to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7259 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
fa4ca3bd2c6ccbbe47adffc55c2b0f663f0b48e8 30-Nov-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Make the freed-block-queue volume metrics 64-bit throughout, to avoid
any wierdness on very large machines in the future. Also, double the
default size from 5MB to 10MB, on the basis that programs are now on
average twice as lardy as they were when it was set to 5MB, whenever
that was.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7256 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
39f3423cd68c385be301e6b44848b4c6276da7b5 10-Nov-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge (from branches/THRCHECK) the following amd64-linux stack unwind
kludges^H^H^H^H^H^H^Henhancements:

r6802: For VG_(record_ExeContext) et al, add a new parameter
(first_ip_delta) which is added to the initial IP value before the
stack is unwound. A safe value to pass is zero, which causes the
existing behaviour to be unchanged. This is a kludge needed to work
around the incomplete amd64 stack unwind info in glibc-2.5's clone()
routine.

r7059: Add a last-ditch heuristic-hack to the amd64-linux stack
unwinder, which is used when all other methods fail. Seems like GDB
has something similar.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7118 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
22faf7120ce48f1946caa68b01f4b8e450e1d06c 09-Nov-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Don't print warnings about silly args to malloc/calloc in XML mode.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7111 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
bf8c350bbaf032615c54255355ff3ff6bc7baa21 18-Sep-2007 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Change an Int to a SSizeT to avoid overflows. Fixed bug 148174.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6855 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
3f94a7d39676262e70c768e5a20a225f1ca36b29 25-Aug-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Changes to m_hashtable:

Allow hashtables to dynamically resize (patch from Christoph
Bartoschek). Results in the following interface changes:

* HT_construct: no need to supply an initial table size.
Instead, supply a text string used to "name" the table, so
that debugging messages ("resizing the table") can say which
one they are resizing.

* Remove VG_(HT_get_node). This exposes the chain structure to
callers (via the next_ptr parameter), which is a problem since
callers could get some info about the chain structure which then
changes when the table is resized. Fortunately is not used.

* Remove VG_(HT_first_match) and VG_(HT_apply_to_all_nodes) as
they are unused.

* Make the iteration mechanism more paranoid, so any adding or
deleting of nodes part way through an iteration causes VG_(HT_next)
to assert.

* Fix the comment on VG_(HT_to_array) so it no longer speaks
specifically about MC's leak detector.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6778 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
ea9c15e9e533224bec5f9759c8056b62957ac184 14-Mar-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Use a 64-bit counter to keep track of the total number of bytes
allocated, rather than SizeT which is word-sized. Your average C++
lardware can easily turn over more than 4G in total in a half hour run
on a 32-bit machine, in which case the counter wraps around.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6649 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
e265636a528e83d71d712d06ee655045a2cb8ee0 10-Mar-2007 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> wibble



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6639 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
9ebd6e0c607fa30301b1325874eb8de871c21cc5 08-Jan-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
718d3b11d1d3f2665c05b5670893baf1ad068401 16-Dec-2006 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Completely overhauled the internals of Memcheck's error handling. All the
different error kinds were reusing the same struct for storing their
details. Each one used some but not all the fields, and the AddrInfo was
similar, and it was very confusing.

So I changed MC_Error and AddrInfo to be tagged unions, like Vex's IRExpr and
IRStmt types. The resulting code is a little more verbose but much easier
to understand. I also split up several error kinds, which also made things
simpler. The user-visible behaviour is identical except for a couple of
very minor things that I've documented in the NEWS file for the 3.3.0
release.

Ideally I'd get rid of the Addr and Char* fields in the core Error type,
which are not always used, and do them similarly within tools. But that
would require changing the core/tool interface, so I'm leaving it for the
moment.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6402 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
c740d7660ad140b79e561e0d578ab8435a5a5289 05-Oct-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> A memory pool update from Graydon Hoare.

Here's an update to the mempool move / change client requests and sanity
checking. The following changes are present:

- Added one more (hopefully last) client request, a predicate to
test whether a mempool anchor address is currently tracked.
It turns out mozilla's arena-using code is sufficiently inconsistent
in its assumptions that it's very difficult to phrase the valgrind
client-request annotations without this request. Namely: sometime
arena-init and arena-free operations are assumed to be idempotent.

- Fixed a very rapid tool-memory leak in the mempool sanity check
routine. The previous version of the patch I posted would use all
memory even on my Very Beefy Test Machine within ~15 minutes of
browsing with firefox.

- Added a little logging code to print the counts of pools and chunks
active every ~10000 sanity checks, when running with -v.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6197 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
8aeeaa92ad5ecf7fabdeba2279b1d14bd974793e 16-Aug-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> A small fix to the "mempool trim" client request; the previous version
didn't cope with zero-sized chunks properly. (from Graydon Hoare).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6006 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
2c1c9dfe806d62d43768b23c29799dc6a100cb09 28-Jul-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Add a mempool-trimming client request (Graydon Hoare).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5992 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
e4b0bf07b0ee0a18eacc5aba91686ab5fc1d327b 06-Jun-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
dbf7ca71128c6787ba8a99cbd03c3773ff572d96 31-Mar-2006 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Terminology change: previously in Memcheck we had the four states:

noaccess, writable, readable, other

Now they are:

noaccess, undefined, defined, partdefined

As a result, the following names:

make_writable, make_readable,
check_writable, check_readable, check_defined

have become:

make_mem_undefined, make_mem_defined,
check_mem_is_addressable, check_mem_is_defined, check_value_is_defined

(and likewise for the upper-case versions for client request macros).
The old MAKE_* and CHECK_* macros still work for backwards compatibility.

This is much better, because the old names were subtly misleading. For
example:

- "readable" really meant "readable and writable".
- "writable" really meant "writable and maybe readable, depending on how
the read value is used".
- "check_writable" really meant "check writable or readable"

The new names avoid these problems.

The recently-added macro which was called MAKE_DEFINED is now
MAKE_MEM_DEFINED_IF_ADDRESSABLE.

I also corrected the spelling of "addressable" in numerous places in
memcheck.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5802 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c
1d0825ff46d57f0ce83c3fa88538a42f67022eee 27-Mar-2006 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge in the COMPVBITS branch to the trunk. This is a big change to
Memcheck, replacing the 9-bits-per-byte shadow memory representation to a
2-bits-per-byte representation (with possibly a little more on the side) by
taking advantage of the fact that extremely few memory bytes are partially
defined.

For the SPEC2k benchmarks with "test" inputs, this speeds up Memcheck by a
(geometric mean) factor of 1.20, and reduces the size of shadow memory by a
(geometric mean) factor of 4.26.

At the same time, Addrcheck is removed. It hadn't worked for quite some
time, and with these improvements in Memcheck its raisons-d'etre have
shrivelled so much that it's not worth the effort to keep around. Hooray!

Nb: this code hasn't been tested on PPC. If things go wrong, look first in
the fast stack-handling functions (eg. mc_new_mem_stack_160,
MC_(helperc_MAKE_STACK_UNINIT)).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5791 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/memcheck/mc_malloc_wrappers.c