Common memory issues

If one were to categorize to fine-granularity memory errors (typically caused via programming in C or C++), one would have a difficult time of ithundreds of types exist! Instead, let's keep the discussion manageable and check out what would be considered the typical or common memory errors that befall us poor C programmers:

  • Incorrect memory accesses
    • Using uninitialized variables
    • Out-of-bounds memory accesses (read/write underflow/overflow bugs)
    • Use-after-free/use-after-return (out-of-scope) bugs
    • Double-free
  • Leakage
  • Undefined behavior (UB)
  • Data Races
  • Fragmentation (internal implementation) issues
    • Internal
    • External
All these common memory issues (except fragmentation) are classified as UB; still, we keep UB as ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.