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 8914171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:39:22+00:00 2026-06-15T04:39:22+00:00

Will overstepping of array indices beyond an array size always result in a Segmentation

  • 0

Will overstepping of array indices beyond an array size always result in a Segmentation Fault on a reliable true POSIX system like GNU/Linux?

I think no, if the accessed location still lies in the same page, but want to be sure.

  • 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-06-15T04:39:22+00:00Added an answer on June 15, 2026 at 4:39 am

    No, it will not necessarily. Segmentation Violations SIGSEGV is handled by the Kernel and will only be invoked on an invalid memory access.

    Arrays are compile-time constructs as is POSIX. Segmentation Violation on the other hand is a run time error indicating that you tried to do something with a piece of virtual memory that you are either not allowed (read/write/execute) or that has not been mapped (the memory controller does not know what physical resource is supposed to back it). At that point the kernel will send your process a signal SiGSEGV and the default behavior is to exit, though that can be overridden.

    You will even often see C code like this, which instructs the compiler to access the memory behind the struct as a variable size array:

    struct s {
        // some other elements
        int id; // whatever other elements
    
        char appended_array[0];
    };
    
    // ....
    
    struct s* mystruct = malloc(sizeof(struct s) + length_of_array_i_need);
    
    // work with mystruct->appended_array[i]
    // at this point mystruct->appended_array[3] is valid C and the compiler will not even issue a warning,
    // though if it lies outside of your allowed VM then the kernel will issue a SIGSEGV
    

    Only because an array is not defined beyond a certain index, it does not necessarily mean that there is no valid memory following it.

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

Sidebar

Related Questions

will a fast enumeration of an array always go in index order? for (NSDictionary
Will Java 8 support pattern matching like Scala and other functional programs do? I'm
Will non-virtual properties to constant values be evaluated in compile time? (Like the constants
Will a double equal to an integer always cast to that integer (assuming the
Will following 2 code block achieve the same result. What is the difference better
Will the following code: while True: try: print(waiting for 10 seconds...) continue print(never show
will like to know if there are any plugins for iOS to download and
Will the Java Compiler optimize simple repeated math operations like: if (prevX / width
Will limiting a query to one result record, improve performance in a large(ish) MySQL
Will Backbone.Router.navigate set test to true : var test = false; var Router =

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.