DynamoRIO
Dynamic Instrumentation Tool Platform
 
Home
Download
Source Code
Documentation
Tutorial
Discussion List
Issue Tracker
Publications
History
Dr. Memory
   Documentation
      Using
      Options
      Help
      RelNotes
      License
 
DynamoRIO

Dr. Memory Runtime Option Reference

Dr. Memory's behavior can be controlled through options passed to drmemory.exe prior to the "--" delimiter. Here is a list of options along with their default values and descriptions:

  • -version
    default:
    Display Dr. Memory version

  • -dr <path>
    default:
    The path to the DynamoRIO installation to use. Not needed when using a released Dr. Memory package.

  • -drmemory <path>
    default:
    The path to the base of the Dr. Memory installation. Not needed when invoking Dr. Memory from an unmodified installation tree.

  • -srcfilter <name>
    default:
    Do not show errors that do not reference the named source file somewhere in their callstacks.

  • -nudge <pid>
    default:
    Use this option to 'nudge' an already-running process in order to request leak checking and other Dr. Memory actions that normally only occur when the process exits.

  • -skip_results
    default: false
    Do not produce results while running the application. This can reduce resource usage if the symbol files for the application are large. To obtain the results, after the application run is finished, use the -results option in a separate step.

  • -results <logdir>
    default:
    Use this option as the second step in a -skip_results run. Pass the name of the log directory created by the -skip_results application run. The results.txt will then be filled in.

  • -results_app <path>
    default:
    Use this option when invoking -results on a different machine from where the application was run with -skip_results. When -results is invoked without this option also specified, the path to the application that was used to run it with -skip_results is assumed.

  • -aggregate <logdir list>
    default:
    Pass a list of log directories to produce an aggregate error report. Useful for applications that consist of a group of separate processes.

  • -v
    default:
    Display verbose information in the Dr. Memory front end

  • -[no_]check_leaks
    default: true
    Whether to store callstacks for each allocation in order to report them when leaks are detected. If this option is disabled, the count of leaks will be shown, but leaks will not be listed individually in the results file.

  • -[no_]ignore_early_leaks
    default: true
    Whether to ignore leaks from system code prior to Dr. Memory taking over.

  • -[no_]check_leaks_on_destroy
    default: true
    If enabled, when a heap is destroyed (HeapDestroy on Windows), report any live allocations inside it as possible leaks.

  • -[no_]possible_leaks
    default: true
    Whether to list possibly-reachable allocations when leak checking. Requires -check_leaks.

  • -[no_]midchunk_size_ok
    default: true
    Consider allocations reached by a mid-allocation pointer that points past a size field at the head of the allocation to be reachable instead of possibly leaked. Currently this option looks for a very specific pattern. If your application's header is slightly different please contact the authors about generalizing this check.

  • -[no_]midchunk_new_ok
    default: true
    Consider allocations reached by a mid-allocation pointer that points past a size field at the head of the allocation that looks like a new[] header to be reachable instead of possibly leaked. A heuristic is used for this identification that is not perfect.

  • -[no_]midchunk_inheritance_ok
    default: true
    Consider allocations reached by a mid-allocation pointer that points to a parent class instantiation to be reachable instead of possibly leaked. A heuristic is used for this identification that is not perfect.

  • -[no_]midchunk_string_ok
    default: true
    Consider allocations reached by a mid-allocation pointer that points to a char array inside an instance of a std::string representation to be reachable instead of possibly leaked. A heuristic is used for this identification that is not perfect.

  • -show_reachable
    default: false
    Whether to list reachable allocations when leak checking. Requires -check_leaks.

  • -[no_]default_suppress
    default:
    Use the set of default suppressions that come with Dr. Memory. See Suppressing Errors.

  • -callstack_max_frames <N>
    default: 20
    How many call stack frames to record for each error report. A larger maximum will ensure that no call stack is truncated, but can use more memory if many stacks are large, especially if -check_leaks is enabled.

  • -check_cmps
    default: true
    Report definedness errors on compares instead of waiting for conditional jmps.

  • -check_non_moves
    default: false
    Report definedness errors on any instruction that is not a move. Note: turning this option on may result in false positives, but can also help diagnose errors through earlier error reporting.

  • -logdir <path>
    default: <install>/logs
    Destination for log files and result files.

  • -resfile_out
    default: false
    Whether to write the result file path to <logdir>/resfile.<pid>

  • -stack_swap_threshold <size>
    default: 0x9000
    Stack change amount to consider a swap instead of an allocation or de-allocation on the same stack. Dr. Memory attempts to dynamically tune this value unless it is changed from its default.

  • -redzone_size <N>
    default: 8
    Buffer on either side of each malloc. This should be a multiple of 8.

  • -report_max <N>
    default: 20000
    Maximum non-leak errors to report (-1=no limit).

  • -report_leak_max <N>
    default: 10000
    Maximum leaks to report (-1=no limit).

  • -verbose <N>
    default: 1
    Verbosity level in log files. Primarily for debugging of Dr. Memory itself.

  • -quiet
    default: false
    Suppress stderr messages and, on Windows, popup messages.

  • -ignore_asserts
    default: false
    Display, but do not abort, on asserts in debug build (in release build asserts as automatically disabled).

  • -batch
    default: false
    Do not launch notepad with the results file at application exit.

  • -summary
    default: true
    Display a summary of errors to stderr at app exit.

  • -warn_null_ptr
    default: false
    Whether to warn when NULL is passed to free() or realloc().

  • -thread_logs
    default: false
    Use per-thread log files.

  • -delay_frees <N>
    default: 2000
    Frees to delay before committing. The larger this number, the greater the likelihood that Dr. Memory will identify use-after-free errors. However, the larger this number, the more memory will be used.

  • -pause_at_unaddressable
    default: false
    Dr. Memory pauses at the point of each unaddressable access error that is identified. On Windows, this pause is a popup window. On Linux, the pause involves waiting for a keystroke, which may not work well if the application reads from stdin. In that case consider -pause_via_loop as an additional option.

  • -pause_at_uninitialized
    default: false
    Identical to -pause_at_unaddressable, but applies to uninitialized access errors.

  • -pause_via_loop
    default: false
    Used in conjunction with -pause_at_uninitialized and -pause_at_uninitialized on Linux, this option causes Dr. Memory to pause via an infinite loop instead of waiting for stdin. Dr. Memory will not continue beyond the first such error found.

  • -leaks_only
    default: false
    Puts Dr. Memory into a leak-check-only mode that has lower overhead but does not detect other types of errors other than invalid frees.

  • -prctl_whitelist
    default: ''
    If this list is non-empty, when Dr. Memory sees prctl(PR_SET_NAME) and the name is not on the list, then Dr. Memory will disable its instrumentation for the rest of the process and for all of its child processes.

  • -perturb
    default: false
    Adds random delays to thread synchronization and other operations to try and increase the chances of catching race conditions.

  • -perturb_only
    default: false
    Adds random delays to thread synchronization and other operations to try and increase the chances of catching race conditions, but disables all memory checking to create a low-overhead tool that executes significantly faster. However, without memory checking race conditions will only be detected if they result in an actual crash or other externally visible change in behavior. When this option is enabled, Dr. Memory will not produce an error summary or results.txt.

  • -perturb_max
    default: 50
    This option sets the maximum delay added by -perturb, in milliseconds for thread operations and in custom units for instruction-level operations. Delays added will be randomly selected from 0 up to -perturb_max.

  • -perturb_seed
    default: 0
    To reproduce the random delays added by -perturb, pass the seed from the logfile from the target run to this option. There may still be non-determinism in the rest of the system, however.

 

  Dr. Memory version 1.3.0 --- Sun Aug 29 15:12:59 2010