In the first recipe, we learned how to nail down the root cause of a crashing application using an interactive command-line debugger. However, there are situations when applications crash in the production environment, and it is impossible or impractical to reproduce the same issue running the application under the GDB on a test system.
Linux provides a mechanism to help with the analysis of crashing applications even when they are not run from the GDB directly. When an application is terminated abnormally, the operating system saves the image of its memory into a file named core. In this recipe, we will learn how to configure Linux to generate core dumps for crashing applications, and how to use the GDB for their analysis.