Skip to Main Content
Linux Application Development, Second Edition
book

Linux Application Development, Second Edition

by Michael K. Johnson, Erik W. Troan
November 2004
Intermediate to advanced content levelIntermediate to advanced
736 pages
14h 4m
English
Addison-Wesley Professional
Content preview from Linux Application Development, Second Edition

Chapter 7. Memory Debugging Tools

Although C is undisputedly the standard programming language on Linux systems, C has a number of features that lead programmers into writing code with subtle bugs that can be very hard to debug. Memory leaks (in which malloc() ed memory is never free() ed) and buffer overflows (writing past the end of an array, for example) are two of the most common and difficult-to-detect program bugs; buffer underruns (writing before the beginning of an array, for example) are much less common but usually even harder to track down. This chapter presents a few debugging tools that greatly simplify the detection and isolation of such problems.

Buggy Code

 1: /* broken.c */ 2: 3: #include <stdlib.h> 4: #include <stdio.h> 5: #include ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux System Programming, 2nd Edition

Linux System Programming, 2nd Edition

Robert Love

Publisher Resources

ISBN: 0321219147Purchase book