Error Codes Wiki

Linux Segmentation Fault (Signal 11)

Errorcommand

About Linux Segmentation Fault (Signal 11)

Linux Segmentation Fault (SIGSEGV, signal 11) means a program tried to access memory outside its allowed address space. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.

Here are the key things to understand: Segfault — invalid memory access detected by MMU. Process terminated with exit code 139 (128 + 11). Core dump may be generated for debugging. Common in C/C++ programs with pointer bugs. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.

The most common reasons this occurs include: Null pointer dereference in the program. Buffer overflow accessing beyond array bounds. Use-after-free memory bug. Stack overflow from deep recursion. Identifying the root cause is the first step toward finding the right solution.

To resolve this, follow these recommended steps: Enable core dumps: ulimit -c unlimited. Analyze core dump: gdb ./program core. Run with AddressSanitizer: gcc -fsanitize=address. Check for recent updates to the crashing program. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.

This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.

Quick Answer

Is this a hardware or software problem?

Almost always software — a bug in the program. Very rarely, bad RAM can cause random segfaults.

Overview

Linux Segmentation Fault (SIGSEGV, signal 11) means a program tried to access memory outside its allowed address space.

Key Details

  • Segfault — invalid memory access detected by MMU
  • Process terminated with exit code 139 (128 + 11)
  • Core dump may be generated for debugging
  • Common in C/C++ programs with pointer bugs

Common Causes

  • Null pointer dereference in the program
  • Buffer overflow accessing beyond array bounds
  • Use-after-free memory bug
  • Stack overflow from deep recursion

Steps

  1. 1Enable core dumps: ulimit -c unlimited
  2. 2Analyze core dump: gdb ./program core
  3. 3Run with AddressSanitizer: gcc -fsanitize=address
  4. 4Check for recent updates to the crashing program

Tags

linuxcommandsegmentation faulttroubleshootingfix

More in Command

Frequently Asked Questions

Almost always software — a bug in the program. Very rarely, bad RAM can cause random segfaults.