Intel® Inspector User Guide for Windows* OS

ID 767798
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Unhandled Application Exception

Occurs when the application undergoing analysis crashes because of an unhandled exception thrown by the application.

ID

Code Location

Description

1

Exception

Represents the instruction that threw the exception.

C Example

The following C example is overly simplified to provide possible scenarios where these types of errors may occur.

void problem1 (int *y)
{
   *y = 5; 
}
void problem2()
{
   int *x = new int;
}

Two exceptions are possible in this example:

  • y may not reference a valid memory address; therefore the write instruction may cause an exception. If that exception is not properly handled, the Intel Inspector shows an unhandled exception pointing to the write instruction at y.

  • If the application is out of memory, the allocation throws an exception. If the exception is unhandled by the application, the Intel Inspector shows an unhandled exception associated with the allocation.

Fortran Example

The following Fortran example is also overly simplified to provide possible scenarios where this type of error may occur.

function problem1(a)
    integer, allocatable :: a(:)
        
    a(5) = 1
    problem1 = 1
end function problem1
    
function problem2(a)
    integer, allocatable :: a(:)
        
    allocate(a(1000))
    problem2 = 1000
end function problem2

Possible Correction Strategies

This problem usually indicates an existing bug in your application that manifests during analysis. In general, it is good programming practice to ensure allocations succeed and references are valid before using them.