Skip to content

Instantly share code, notes, and snippets.

@GermanAizek
Last active April 12, 2024 15:37
Show Gist options
  • Save GermanAizek/dcc1e95f7fa84bbe66f88f5cb81a5006 to your computer and use it in GitHub Desktop.
Save GermanAizek/dcc1e95f7fa84bbe66f88f5cb81a5006 to your computer and use it in GitHub Desktop.
Enable Google Sanitizers in Visual Studio
  1. Address Sanitizer is integrated with Visual Studio IDE. To turn on AddressSanitizer for an MSBuild project, right-click on the project in Solution Explorer and choose Properties. In the Property Pages dialog, select Configuration Properties > C/C++ > General, then modify the Enable Address Sanitizer and Enable Fuzzer Support property.

  2. Choose OK to save your changes.

  3. To build from the IDE, opt out of any incompatible options. For an existing project compiled by using /Od (or Debug mode), you may need to turn off these options:

  • Turn off edit and continue (???)
  • Turn off /RTC1 (Basic Runtime Checks) (Clear field)
  • Turn off /INCREMENTAL (incremental linking) (Set Disable)
  1. Add define _DISABLE_VECTOR_ANNOTATION all projects

  2. To build and run the debugger, press F5. An Exception Thrown window appears in Visual Studio:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment