summaryrefslogtreecommitdiff
path: root/tools/drmemory/README
blob: 1db5410e430ca871ebf48344204b6b643a09f3d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

# Dr. Memory

Dr. Memory (www.drmemory.org) is an open-source dynamic memory
monitoring tool for Windows, Linux, and Mac.

## About Dr. Memory

Dr. Memory operates on unmodified application binaries running on
Windows, Linux, or Mac on commodity x86 and ARM32 (forthcoming) hardware.
It is capable of identifying memory-related programming errors including:
  * accesses of uninitialized memory
  * accesses to unaddressable memory (heap underflow and overflow)
  * accesses to freed memory
  * double frees
  * memory leaks
  * handle leaks (on Windows)
  * GDI API usage errors (on Windows)
  * accesses to un-reserved thread local storage slots (on Windows)

## Using Dr. Memory (Windows only)

Build your application with debug information and then run it under
Dr. Memory.  Errors found are printed to the screen, and a summary is
shown at the end of the run.

### Obtain Dr. Memory

The Dr. Memory package is provided as a self-extracting archive
(DrMemory-Windows-sfx.exe) in tools/drmemory directory, which can be
extracted by running command 'DrMemory-Windows-sfx.exe -ounpacked -y'.

The Dr. Memory release package can be downloaded from
https://github.com/DynamoRIO/drmemory/wiki/Downloads.

Nightly builds can be downloaded from
https://build.chromium.org/p/client.drmemory/builds/.

The Dr. Memory source code can be found at
https://github.com/DynamoRIO/drmemory.

### Run your application with Dr. Memory

To run your application with Dr. Memory, simply put 'drmemory.exe --'
before the command that invokes the application.

  * Running pdfium_unittests with Dr. Memory:
    tools\drmemory\unpaced\bin\drmemory.exe -- out\Debug\pdfium_unittests.exe

  * Running pdfium_tests with Dr. Memory:
    tools\drmemory\unpaced\bin\drmemory.exe -- out\Debug\pdfium_tests.exe --png YourInputPDF.pdf

### Run test suite with Dr. Memory

A set of scripts are provided to run PDFium test suite with Dr. Memory
on buildbots, which can also be used for running test suite locally.

  * Running pdfium_unittests with Dr. Memory:
    tools\drmemory\scripts\pdfium_tests.bat -t pdfium_unittests

  * Running pixel test suite with Dr. Memory:
    tools\drmemory\scripts\pdfium_tests.bat -t pdfium_pixel

## Documentation

Command 'drmemory.exe -help' prints a list of Dr. Memory runtime
options with short description.

To view the full documention, point your web browser at
http://drmemory.org/docs/.


## Contact

This project is provided as-is, with no official support.
Use the Dr. Memory Users group at
http://groups.google.com/group/drmemory-users/ to ask questions and
seek help on using Dr. Memory.

Dr. Memory's source code and issue tracker live at
https://github.com/DynamoRIO/drmemory

If you would like to submit a patch, you will need to first sign a
Contributor License Agreement.
See https://github.com/DynamoRIO/drmemory/wiki/Contributing for more
information.