C++ Dynamic Sanitizers Review - Test Suite

Coverity Scan Build Status

Overview

This repository contains C++ test code and support scripts developed to easily compare Memory Sanitizer tools like Valgrind, ASAN, Dr.Memory, etc

Review Results

@ To be updated in the wiki

Licence

The MIT License (MIT)

Branch Model

This repository is following GitHub Flow branch model Read more @ GitHub Flow before you commit changes to this repository.

Requirements

The following are required for building this source code.

Building

Normal Build

/usr/local/gcc-4.9.3/bin/g++ -o MCTester -O -g -Wall main.cpp

ASAN Build

/usr/local/gcc-4.9.3/bin/g++ -o MCTester_ASAN -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer -Wall main.cpp

Running

e.g. Run only Test 1;

Valgrind

/mnt/ValgrindInstallations/SuSE-11-SP3/valgrind-3.11.0/vg-in-place --tool=memcheck  MCTester 1 1

ASAN

MCTester_ASAN 1 1

Dr.Memory

/mnt/DrMemory-Linux-1.10.0-2/bin>./drmemory -light -- MCTester 1 1

Additional Settings

Run Time flags of ASAN

export ASAN_OPTIONS=detect_leaks=1:verbose=1

detect_leaks will enable LeakSanitizer (LSAN) with ASAN

Options to enable when running Valgrind

with --keep-stacktraces=none --undef-value-errors=no options to be inline with ASAN features

Options to enable when running Dr.Memory

-light : This will not detect uninitialized read and memory leak errors (to be inline with ASAN features)

-light -count_leaks : This will not detect uninitialized read errors, but lists leak errors.

Results

Major features