Statically Determine Maximum Stack Requirements (DYN06)
Level \(\rightarrow\) Required
- Category
- Safety:
\(\checkmark\)
- Cyber:
\(\checkmark\)
- Goal
- Maintainability:
\(\checkmark\)
- Reliability:
\(\checkmark\)
- Portability:
- Performance:
- Security:
Remediation \(\rightarrow\) Low
Verification Method \(\rightarrow\) Static analysis tools
Reference
N/A
Description
Each Ada application task has a stack, as does the "environment task" that elaborates library packages and calls the main subprogram. A tool to statically determine the maximum storage required for these stacks must be used, per task.
This guideline concerns another kind of dynamic memory utilization. The previous guidelines concerned the management of storage commonly referred to as the "heap." This guideline concerns the storage commonly referred to as the "stack." (Neither term is defined by the language, but both are commonly recognized and are artifacts of the underlying run-time library or operating system implementation.)
Applicable Vulnerability within ISO TR 24772-2
4.10 Storage Pool
Applicable Common Weakness Enumeration
Noncompliant Code Example
N/A
Compliant Code Example
N/A
Notes
The GNATstack tool can statically determine the maximum requirements per task.