How to continue run after error with Address Sanitizer in visual studio 2019?

RODEB 1 Reputation point
2022-04-05T15:58:23.287+00:00

Hello,

I want to use address sanitizer for a C/C++ project in Microsoft Visual Studio Enterprise 2019 (2)
Version 16.11.11, I have gone through the following link: https://github.com/google/sanitizers/wiki/AddressSanitizer and tried to compile with -fsanitize-recover=address but during compilation, this flag is ignored, hence does not work.

Is there any other way to make it work so that the memory leaks can be found in a single iteration of the run?

Thanks.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,041 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
986 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 30,346 Reputation points Microsoft Vendor
    2022-04-06T08:11:02.363+00:00

    Hello @RODEB ,

    Welcome to Microsoft Q&A forum.

    I checked the link that you shared, I see that

    The tool works on x86, ARM… The supported operation systems are Linux, Darwin… Other OS/arch combinations may work as well, but aren’t actively developed/tested.

    But I’m not sure if this tool supports Windows OS and can be used well in Visual Studio. Perhaps you can consider using Visual Studio Diagnostic Tools. Here is the related doc: Collect memory usage data.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.