What are the issues that Xcode sanitizer actually warns about?

Xcode 7 introduces a new feature called address sanitizer, which is presented in the release notes using this short description:

  • The sanitizer address indicates a code that may be corrupted at runtime, even if you cannot reproduce yourself

In addition to the ironic wording, I believe that it is implied here that the targeted disinfectant should detect (irreproducible) problems that could lead to access violations or other fatal application errors.

The Apple developer adds additional information, making it clear that this is a diagnostic tool (not a compiler function) designed to fix memory corruption problems during debugging time.

I did some tests myself, but could not collect the part of the code that would launch the disinfectant at startup. Can someone provide me an example? I was looking for a sample in C, but objective C would be nice too.

+4
source share
1 answer

Here is more detailed information about the disinfectant address and here is a simple test:

char test()
{
    char buffer[4] = { 9, 8, 7, 6 };
    unsigned index = 4;
    return buffer[index];
}
+4
source

Source: https://habr.com/ru/post/1607765/


All Articles