Address Sanitizer Reports

BugSplat integrates with the Windows Address Sanitizer (Asan) complier option allowing you to capture memory error reports and send them to your BugSplat database. Here are some instructions for modifying myConsoleCrasher (or your application) so that it captures Address Sanitizer exceptions.

Modify Visual Studio Compiler Options

Enable the Address Sanitizer by choosing the Enable Address Sanitizer (/fsanitize=address) C/C++ General option:

Visual Studio Enable Address Sanitizer

Modify the Visual Studio Include Directories so that the Address Sanitizer header files can be located:

Modify Initialization Code

To hook into the Address Sanitizer you will call __asan_set_error_report_callback with the BugSplat createAssanReport method. To do this, we'll need a global instance of the BugSplat MiniDmpSender object and a new asanCallback function. See below for how you would modify our myConsoleCrasher sample program:

Create Memory Corruption Test

The only step left is to generate a memory corruption that Address Sanitizer will catch. Here's one way to do that:

Calling HeapCorruption (or your own memory error code) will generate the Address Sanitizer report and send a crash report to BugSplat.

Crash Report Result

You'll see the crash report show up just like other crash exceptions. Here's what our modified version of the myConsoleCrasher sample program produced:

Last updated

Was this helpful?