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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:55:12+00:00 2026-05-11T09:55:12+00:00

I wrote a C program in which I did some pretty heavy stack allocation,

  • 0

I wrote a C program in which I did some pretty heavy stack allocation, around 2 MiB. Since I use the poor man’s IDE* I was automatically running the program via make in order to test it, each time I compiled.

I had pretty much wrapped everything up, but for some reason, during some of the final optimization, I ran it directly from the shell. Instant segfault! Running it with make still worked, and running it by hand always produced the same segfault.

I eventually reduced the amount of stack allocation I was doing to 256 KiB, which solved the problem. My rationale was that make was probably exec-ing the process, and thus it was inheriting some weird parameters that allowed it to use more stack space.

Although everything is fine now, I have no way of testing my theory. Can anyone confirm or deny, or suggest some way of testing?

* zsh, vim, gcc, gdb, and some nutty makefiles

  • 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. 2026-05-11T09:55:13+00:00Added an answer on May 11, 2026 at 9:55 am

    You can try setting the maximum stack size with ulimit(1) and see if it works:

    # Limit stack to 1024 KiB ulimit -s 1024; ./myprogram # Now no limit ulimit -s unlimited; ./myprogram 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 111k
  • Answers 111k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The wikipedia and geekpedia sites seem to be correct, the… May 11, 2026 at 9:43 pm
  • Editorial Team
    Editorial Team added an answer please test following code: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:TileList… May 11, 2026 at 9:43 pm
  • Editorial Team
    Editorial Team added an answer You basically have two options: use a SAFEARRAY of BYTEs… May 11, 2026 at 9:43 pm

Related Questions

I've got a C++ program that's likely to generate a HUGE amount of data
I am working on a group senior project for my university and I have
Have you ever been frustrated by Visual Studio not re-evaluating certain watch expressions when
fellow anthropoids and lily pads and paddlewheels! I'm developing a Windows desktop app in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.