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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.