Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects simply to a non-technical, business audience. Over…
A segmentation fault (segfault) is an error returned by hardware with memory protection that tells the operating system that a memory access violation has occurred. The operating system usually reacts by telling the offending process about the error through a signal and then the OS performs some sort of corrective action. This happens because a process or program tries to access memory that is not assigned to it.
A segmentation fault is also known as an access violation.
A segmentation fault is often caused by errors in the programming of a process or application in which the program is led to access memory that was not allocated for it but for other programs or for the system itself. A process is not allowed to touch memory not reserved for it, as it must always request memory before using it. Therefore, when it accidentally touches memory that is not assigned to it, an access violation occurs.
Segfaults can also be caused by a recursive function, which can use up all of the stack space it is assigned and quickly encroach on memory not assigned to it. In some systems, this is considered a stack overflow, but for others it is simply a kind of access violation.
A segmentation fault can be handled by a process through a custom signal handler, but often it is the OS’s default signal handler that is used, which usually results in the offending process being terminated abnormally, called a crash, or the OS forcing a core dump.
Techopedia’s editorial policy is centered on delivering thoroughly researched, accurate, and unbiased content. We uphold strict sourcing standards, and each page undergoes diligent review by our team of top technology experts and seasoned editors. This process ensures the integrity, relevance, and value of our content for our readers.
Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.
What is AI Ethics? The field of AI ethics is about the rules and values guiding how artificial intelligence (AI)...
Maria WebbTechnology journalist
What is AI TRiSM? AI TRiSM (Trust, Risk, and Security Management) is a market segment for AI governance products and...
Margaret RouseTechnology Expert
What is Know Your Customer (KYC)? Know Your Customer (KYC) is the process that financial institutions such as banks use...
Nicole WillingTechnology Journalist
Trending NewsLatest GuidesReviewsTerm of the Day