
Find and Debug C++ Memory Errors with AddressSanitizer
Memory errors are among the most challenging bugs to diagnose in C++ applications. Problems such as buffer overflows, use-after-free, and memory corruption can cause unexpected behavior, application crashes, and unpredictable results. These bugs can be particularly difficult to track down using traditional debugging techniques.
AddressSanitizer (ASan) is a powerful runtime memory error detection tool that helps identify these problems while your application is running.
In this course, you'll learn how to use Microsoft's AddressSanitizer integration in Xcode to detect and investigate common C++ memory errors. We'll explore how AddressSanitizer works internally, how it identifies invalid memory accesses, and how you can control its behavior to suit different debugging scenarios.
What does the course cover?
Understanding AddressSanitizer
Get started with AddressSanitizer in Xcode, configure your C++ projects, and understand the concept of Shadow Memory, which plays a central role in detecting memory errors.
Detecting Heap Memory Errors
Learn to identify common heap-related problems, including heap buffer overflows, use-after-free errors, and allocation/deallocation mismatches. Understand how these issues occur and how AddressSanitizer helps expose them.
Detecting Stack and Global Memory Errors
Explore memory errors involving stack and global variables. Learn how AddressSanitizer detects invalid memory accesses in these memory regions.
Advanced AddressSanitizer Features
Go beyond basic error detection and explore features such as user-poisoned memory, conditional compilation, and selectively disabling instrumentation. You'll also learn about AddressSanitizer runtime options and how to configure them for different debugging requirements.
Throughout the course, practical examples will help you understand these features and see how they can be applied when debugging C++ applications.
AddressSanitizer can make difficult memory-related bugs much easier to identify. Learn to use it effectively and add another powerful tool to your C++ debugging workflow.