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

  • Home
  • SEARCH
  • 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 7767991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:48:32+00:00 2026-06-01T15:48:32+00:00

One obvious way to cause a stack overflow and get Segmentation fault would be

  • 0

One obvious way to cause a stack overflow and get Segmentation fault would be to recursively push stack frames on top of each other until it booms. I’m wondering if stack overflow could happen without even pushing new stack frames.

Creating a large enough array could do it too from experience, but any other possible scenarios?

  • 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-01T15:48:33+00:00Added an answer on June 1, 2026 at 3:48 pm

    C99 uses a resizable array, which you could use and keep resizing it to a larger one. However this resizable array is implemented using alloca. Here’s a sample code in UNIX env:

    #include <stdio.h>
    #include <alloca.h>
    #include <stdlib.h>
    #include <stdbool.h>
    
    int
    main()
    {
        while (true)
        {
            void *p = alloca(32UL);
            printf("new memory allocated at %p \n", p);
        }
        exit(EXIT_SUCCESS);
    }
    

    And your output will look like this

    new memory allocated at 0xbf800a60 
    new memory allocated at 0xbf800a30 
    new memory allocated at 0xbf800a00 
    new memory allocated at 0xbf8009d0 
    new memory allocated at 0xbf8009a0 
    [1]    3977 segmentation fault  ./a.out
    

    alloca is in the malloc family of functions, except that it allocated memory on the stack by adjusting the stack pointer.

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

Sidebar

Related Questions

I am struggling with a way to combine two queries into one (obvious i
From this post . One obvious problem is scalability/performance. What are the other problems
I'll take away the obvious one here: mic and webcam support. Other than that,
Please forgive me if this is an obvious one. I have an unknown amount
I might be missing something obvious here, but I'm implementing NSCopying on one of
Having a heckuva time with this one, though I feel I'm missing something obvious.
Hey, so this is one of those questions that seems obvious, and I'm probably
One of my biggest typographical frustrations about HTML is the way that it mangles
It has been stated that the google plus-one button works it's way up the
Is there a way to make Response.Write work in an UpdatePanel and not cause

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.