Tutorial: Analyzing Memory Errors With Intel® Inspector and a C++ Sample Application for Linux* OS

ID 762155
Date 3/31/2023
Public

Intel® Inspector Tutorial: Analyzing Memory Errors in a C++ Sample Application for Linux* OS

NOTE:

Sanitizers in Intel® oneAPI DPC++/C++ Compiler and Intel® Fortran Compiler help effectively pinpoint memory, address, threading, and undefined behavior related issues early in the development process. Sanitizers offer faster time to results, fewer false positives, and improved compiler integration compared to Intel Inspector. As a result, Intel Inspector will no longer be included in the Intel® HPC Toolkit. It continues to be downloadable as a standalone package and it will be discontinued in 2025 or later. Customers who have purchased Intel® Priority Support will continue to receive support. Please see Intel Inspector deprecation article for more information.

Intel® Inspector is a dynamic memory and threading error checking tool for users developing serial and multithreaded applications on Windows* and Linux* operating systems.

This tutorial - and C++ sample application you can use to follow along - show how to use the Intel inspector on a Linux* platform to analyze memory errors.

Intel® Inspector is available as a standalone product and as part of the following products:

  • Intel® HPC Toolkit

  • Intel® IoT Toolkit

About This Tutorial

This tutorial demonstrates an end-to-end workflow you can ultimately apply to your own applications:

  1. Build an application to produce an optimal inspection result.

  2. Inspect an application to find memory errors.

  3. Edit application code to fix the memory errors.

  4. Rebuild and reinspect the application.

It was last updated for the 2017 product release.

Estimated Duration

10-15 minutes.

Learning Objectives

After you complete this tutorial, you should be able to:

  • List the steps to find and fix memory errors using the Intel Inspector.

  • Define key Intel Inspector terms.

  • Identify compiler/linker options that produce the most accurate and complete analysis results.

  • Run memory error analyses.

  • Influence analysis scope and running time.

  • Navigate among windows in the Intel Inspector results.

  • Display a prioritized to-do list for fixing errors.

  • Access help for fixing specific errors.

  • Access source code to fix errors.

More Resources

The concepts and procedures in this tutorial apply regardless of programming language; however, a similar tutorial using a sample application in another programming language may be available at Intel® Software Documentation Library.

These sites also offer tutorials for other Intel products.

In addition, you can find more resources in: