Identify Heap Contention Errors
Learn to identify heap contention wait chains, synchronization issues, and advanced techniques for disassembling and dumping arrays.
Application source code
We’ll be analyzing the core dump generated from the following file:
We can see that several threads are allocating and freeing memory using a shared array of pointers. If you execute this application, you’ll get the double free error:
Double free errors occur when the free() function is called twice on a pointer. In this lesson, we’ll learn how to identify such errors in a multithreaded environment.
Loading the core dump
Let’s begin by loading the generated core dump:
gdb -c core.App10 -se App10
The above command will output the following to the terminal:
Listing all threads
Let’s take a look at the list of threads and identify the top frames at the time of the crash:
info threads
The above command will output the following to the terminal:
We ...