This section is divided into the following subsections:
The Dr. Memory distribution contains the following:
- The front-end script to launch Dr. Memory:
drmemory.pl on Linux and Cygwin, drmemory.exe on Windows. - The back-end of Dr. Memory, contained in the
bin32 and dynamorio subdirectories. Dr. Memory runs on top of the DynamoRIO tool engine (see http://dynamorio.org for more information on DynamoRIO). - Documentation for Dr. Memory (you're looking at it).
The current version is 1.3.0.
The changes between version 1.3.0 and 1.2.1 include:
- Enabled -check_leaks and -possible_leaks by default (Issue 8)
- Improved suppression support: support for vertical wildcards "..."
- Locate target app on path on Linux (Issue 33)
- Various bug fixes
The changes between version 1.2.1 and 1.2.0 include:
- Fix bug in symbol lookup causing debug build asserts
The changes between version 1.2.0 and 1.1.0 include:
- Avoid false positives and false negatives when using debug versions of msvcrt, whose own debugging facilities conflicted with Dr. Memory's
- Added -perturb feature that uses random delays to attempt to trigger data races such as use-after-free accesses, which Dr. Memory will immediately detect
- Separate indirect leaks from direct leaks
- Added -version option to front end
- Generalized "invalid free" to "invalid heap argument"
- Improved performance of many instruction types including string instructions
- Improved performance of heap routines accessing heap headers
- Improved performance of stack adjustments
- Improved performance of shadow table accesses
- Improved performance of hashtables via dynamic resizing
- Display messages in cmd window, where DynamoRIO has trouble printing
- Switch to online symbol processing on Windows, greatly simplifying the Windows design and making it more robust by eliminating perl entirely
- Eliminate need for admin privileges to run on Windows
- Added wildcard support to suppressions
- Various bug fixes
The changes between version 1.1.0 and 1.0.1 include:
- Eliminated common C++ cases of false positives in possible leaks
- Report additional information on unaddressable errors: list the nearest malloc chunks above and below, and whether the access was to freed memory
- Report timestamp and thread id of reported errors
- Added -leaks_only feature for low-overhead leak checking
- Improved support for heaps used as stacks when such stacks are small and are adjacent to non-stack data
- Improved Linux system call parameter handling to reduce false positives
- Added default suppression file
- Added -aggregate option to combine error listings and eliminate duplicates among a set of processes
- Report the total number of leaked bytes
- Perform error duplication checks in the client
- Reduce memory usage of callstacks stored on each malloc
- Eliminate false positives from libc string routines by replacing them
- Switch to true reachability-based leak detection, trigger-able from a nudge at any time during a run
- Split possible leaks from certain leaks
- Improved documentation
- Improve performance of consecutive similar memory references
- Improve performance of 64K-boundary-crossing stack adjustments
- Many other performance improvements
- Many bug fixes
This is an Alpha version. It has some missing features and undoubtedly some bugs. The missing features include:
- This release runs a debug build by default, which contains asserts that if triggered will result in dialog boxes popping up and the death of the application. This is to aid in debugging this Alpha release. Please report any such asserts encountered. You can use the -release option to run the release build instead and disable asserts.
- Windows 7 is not yet supported (this is a limitation in the DynamoRIO engine used by Dr. Memory: http://code.google.com/p/dynamorio/issues/detail?id=218)
- Performance optimizations: we expect to noticeably improve Dr. Memory's performance in the future.
- The malloc in the Cygwin C library is not yet tracked separately from the Windows API malloc which can lead to false negatives.
- Definedness is tracked at the byte level, not at the bit level, which when bitfields are in use can lead to false positives.
- Windows graphical system call parameters are not all known, which can result in false positives and false negatives.
- System calls unique to Windows 2003 and Vista are missing, which can result in false positives and false negatives.
- 64-bit support: we plan to add this in the future.
- 32-bit applications on 64-bit Windows have some limitations (these are actually limitations of the current version of the underlying DynamoRIO engine): if the app creates threads prior to image entry (as cygwin apps often do) and does not link user32.dll, Dr. Memory will not take over early enough to avoid problems with the other thread(s). On 32-bit Windows this can be worked around by taking over from a parent process (e.g., cmd.exe). Instructions on how to do this will appear in an upcoming version (basically you need to use DynamoRIO's drdeploy to set up the child; in the future the drmemory front-end will support doing that for you).
- Detecting mixing of malloc/new/new[] vs free/delete/delete[]: though if the deleted class has its own allocated memory it should show up as a reported memory leak; and if it doesn't, and its destructor doesn't do anything else, then no harm done by not calling delete[].
- Multiple thread corner cases:
- Pathological races between mallocs and frees can result in Dr. Memory's shadow memory structures becoming mis-aligned with subsequent false positives. However, such a scenario will always be preceded by an invalid free error.
- General races between memory accesses and Dr. Memory's shadow memory can occur but errors will only occur with the presence of erroneous race conditions in the application.