How it works

In this recipe, we successfully reported memory bugs to the Dynamic Analysis section of the dashboard. We can gain further insights by browsing the defects (under Defect Count):

By clicking on the individual links, it is possible to browse the full output.

Note that it is also possible to generate the AddressSanitizer report locally. In this example, we need to set ENABLE_ASAN, as follows:

$ mkdir -p build$ cd build$ cmake -DENABLE_ASAN=ON ..$ cmake --build .$ cmake --build . --target test    Start 1: leaky1/2 Test #1: leaky ............................***Failed 0.07 sec    Start 2: use_after_free2/2 Test #2: use_after_free ...................***Failed ...

Get CMake Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.