Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6692187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:50:20+00:00 2026-05-26T05:50:20+00:00

Most sources I come across define segmentation faults as something along the lines of

  • 0

Most sources I come across define segmentation faults as something along the lines of this: that they occur when a program references an undefined area of virtual memory

But since I haven’t yet taken a class on Operating Systems, I usually have no idea what this means that it’s an “undefined area” of virtual memory…

Also, a lot of my C programs tend to run into the segmentation fault, and unfortunately I have no idea how to fix them. Are there any good tips for how to avoid these faults, and what to do when one has been encountered when all the logic of the program seems alright?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:50:21+00:00Added an answer on May 26, 2026 at 5:50 am

    To put this more simply a segmentation fault is that you are reading or writing memory that you are not allowed access to because you do not own it.

    A simple example is using a variable on the stack followed by some code. Say we have

    char a[4];
    int i=0;
    for(i=0; i<1000; ++0)
         a[i]='a';
    printf("Hi this line will never get printed because last line killed it\n");
    

    So on the stack we have 4 bytes allocated for ‘a’, another 4 for int ‘i’ and now we have the code that is the function. Thing is the for statement writes a 1000 bytes into ‘a’ which overwrites ‘i’, and also kill the code following it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've come across, in passing, several suites of functions, widgets, frameworks, etc. that seek
This is sort of a general question that has come up in several contexts,
There are a lot of great open-source projects on github. Most of them come
Most my sources are in subversion and I use '$Id$' to add revision information
I have a project folder with sources, headers, resources, etc. Most files are subject
Most of time, the source of file uploading errors are that we forget to
Most program languages have some kind of exception handling; some languages have return codes,
Whenever I come across a cute website, I am always curious to know which
i have been using System.Timer to run a windows service but have come across
I've been studying Python 3 recently and I have come across a conundrum: I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.