GCC 11

Detecting memory management bugs with GCC 11, Part 2: Deallocation functions

Detecting memory management bugs with GCC 11, Part 2: Deallocation functions

The first half of this article described dynamic memory allocation in C and C++, along with some of the new GNU Compiler Collection (GCC) 11 features that help you detect errors in dynamic allocation. This second half completes the tour of GCC 11 features in this area and explains where the detection mechanism might report false positives or false negatives.

Continue reading Detecting memory management bugs with GCC 11, Part 2: Deallocation functions

Share
Detecting memory management bugs with GCC 11, Part 1: Understanding dynamic allocation

Detecting memory management bugs with GCC 11, Part 1: Understanding dynamic allocation

Memory management bugs are among the hardest to find in C and C++ programs, and are a favorite target of exploits. These errors are difficult to debug because they involve three distinct sites in a program that are often far apart and obscured by the use of pointers: memory allocation, the use of the allocated memory, and the release of memory back to the system by deallocation. In this two-part article, we’ll look at GNU Compiler Collection (GCC) 11 enhancements that help detect the subset of these bugs that affect dynamically allocated memory. The enhancements discussed here have been made to the GCC core. Related improvements to the GCC static analyzer are covered by David Malcolm in his article Static analysis updates in GCC 11.

Continue reading Detecting memory management bugs with GCC 11, Part 1: Understanding dynamic allocation

Share