Frank Meerkötter
Frank Meerkötter

Reputation: 2858

What is the result of compiling only a subset of code with ASAN?

I am using the address sanitizer for most of my development on Linux (via gcc).

I typically only instrument my own code via the address sanitizer. So my process contains a mix of instrumented libraries and non-instrumented libraries (3rd parties, code from other departments).

What are the consequences of doing so? Will the ASAN function correctly?

Upvotes: 1

Views: 327

Answers (1)

yugr
yugr

Reputation: 21878

Asan will function correctly when applied to subset of application but it may fail to detect some bugs in this case (it's covered in "Do I also need to build shared libraries?" and "Can I run it with unsanitized executable?" questions in Asan FAQ).

For example an overflow on stack/global buffer which is defined in unsanitized part of application will not be detected (because shadow memory for this buffer will not be instrumented). Similarly any overflow in unsanitized part will not be detected (because there's no instrumentation code to detect it).

Upvotes: 1

Related Questions