C and C++


LANG.STRUCT.CALLSTACK : Excessive Stack Depth

Summary

The size of the program call stack exceeds a previously-specified limit.

Properties

Class Name Excessive Stack Depth
Significance style
Mnemonic LANG.STRUCT.CALLSTACK
Categories
CWE CWE:400 Uncontrolled Resource Consumption
  CWE:410 Insufficient Resource Pool
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default. To enable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="Excessive Stack Depth"

Example

void bigbuf(void){
    char buf[1201329834]; 
    /* ... */
}

void lang_struct_callstack(void){  /* 'Excessive Stack Depth' warning issued here */
    bigbuf();
}

Notes

Excessive Stack Depth warnings are associated with the function call that causes stack depth to be exceeded.

Important configuration file parameters for this warning class are:

STACK_DEPTH_THRESHOLD The call stack size (in bytes) beyond which a warning will be issued.
STACK_DEPTH_UNDEFINED_FUNCTION_SIZE,
STACK_DEPTH_COMPILER_PADDING,
STACK_DEPTH_ACTIVATION_RECORD_CONSTANTS
Allow users to specify estimates of the amount of call stack space required for various program artifacts.

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.