drmemory v2.3.18352 releases: Memory Debugger for Windows, Linux, Mac, and Android
Dr. Memory: the memory debugger
Dr. Memory is a memory monitoring tool capable of identifying memory-related programming errors such as accesses of uninitialized memory, accesses to unaddressable memory (including outside of allocated heap units and heap underflow and overflow), accesses to freed memory, double frees, memory leaks, and (on Windows) handle leaks, GDI API usage errors, and accesses to un-reserved thread-local storage slots.
Build for the initial implementation of the memory dumping feature:
#2266: Dump memory layout to json file on annotation
Adds a new annotation DRMEMORY_ANNOTATE_DUMP_MEMORY_LAYOUT() which triggers dumping the memory layout to a new file “memlayout.nnnn.json” in the log subdirectory, where “nnnn” is incremented on each successive dump. The file is in JSON format.
Exports annotation support by building the required .c file with custom flags as a library, and exports it and the two required header files drmemory_annotations.h and dr_annotations_asm.h.
A basic block whose tag matches the address of the symbol “main” in the executable is watched for. Heap allocations prior to that point are marked with a new flag MALLOC_BEFORE_MAIN. The stack pointer at that point is recorded.
At dump time, a heap iteration is done, skipping MALLOC_BEFORE_MAIN objects. Each object is placed into a tree. Each thread stack is also placed into a trace; fof the primary thread, only the stack region between the recorded main stack point and the TOS is considered. Both trees are then walked, with each memory region walked in pointer-sized chunks, printing out values and whether values look like pointers to the top or middle of other objects in either tree.
This feature and its annotation are disabled if asm-goto is not supported by the compiler (clang<9.0), determined by try-compile.
Dr. Memory has support for running within the Visual Studio IDE as an External Tool. The Windows installer automatically creates a new Tools menu entry for launching Dr. Memory for each version of Visual Studio detected at install time. If you are using a local install, or if you installed Visual Studio after installing Dr. Memory, or if you are using Visual Studio Express 2010 and it was in Basic mode at the time you installed Dr. Memory, you will need to follow the following instructions in order to add Dr. Memory as an External Tool.
Dr. Memory provides a fuzz testing mode that repeatedly executes one function in the target application, mutating the value of one argument before each iteration. Fuzz mode is configured using a set of runtime options that all share a
-fuzz_ prefix. For example,
-fuzz_function specifies the function name for fuzzing. The aggregate runtime option
-fuzz_target can also be used to configure the fuzz target. An overview of each option and descriptor format is provided in the Dr. Memory Runtime Option Reference (and the command line help text). Many of these options require a more complete explanation, which is provided in the following sections.
Copyright (c) 2015-2017 Google, Inc. licensed under the terms of the BSD. All other rights reserved.