Skip to content

mjsalerno/memguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Getting Pin

  • Download Pin from here

#Using MemGuard

  • extract the Pin tarball you downloaded from here
$ tar -xvzf pin-2.13-62141-gcc.4.4.7-linux.tar.gz
  • rename it to pin
$ mv pin-2.13-62141-gcc.4.4.7-linux pin
  • move it to the root of the MemGuard folder
$ mv pin memguard/pin
  • cd into src/
$ cd memguard/src/
  • Make and test the tool.
$ ./make.sh
  • The results will be in the obj-intel64 folder.

Or run it manually

  • make
$ make PIN_ROOT=../pin
  • Now run the MemGuard tool on a sample binary from the src directory
$ ../pin/pin.sh -t obj-intel64/memguard.so -- ./control
  • clean
$ make PIN_ROOT=../pin clean

or

$ ./make.sh clean

Errors

An error may occur when you run pin:

Killed
paul@paul-UX32VD:~/Git/cse409/pin/MyPinTool$ ./pin/pin -t obj-intel64/mallocmem.so -- test
Killed
E:Attach to pid 7725 failed.
E:  The Operating System configuration prevents Pin from using the default (parent) injection mode.
E:  To resolve this, either execute the following (as root):
E:  $ echo 0 > /proc/sys/kernel/yama/ptrace_scope
E:  Or use the "-injection child" option.
E:  For more information, regarding child injection, see Injection section in the Pin User Manual.
E:

If this happens do:

  1. sudo su
  2. echo 0 > /proc/sys/kernel/yama/ptrace_scope
  3. exit

Run the command again

#Building Pin Tools

  • Navagate to cd source/tools/ManualExamples and make all
$ cd pin/source/tools/ManualExamples
$ make all
  • or make just one tool
$ make malloctrace.test

#Using Pin

$ ./pin -t source/tools/ManualExamples/obj-intel64/<pin-tool>.so  -- <prgm-to-test>

example

$ ./pin -t source/tools/ManualExamples/obj-intel64/malloctrace.so -- ~/Desktop/test

Sources

  1. Detecting uninitialized memory read access bugs using pin
  2. Pintool tutorials
  3. Pinheads Discussion Group
  4. Pintool API Documentation

About

A utility that acts like valgrind

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •