Bug 98663 - How to increase the Stack size and Data size for C codes to run in gcc in LInux
How to increase the Stack size and Data size for C codes to run in gcc in LInux
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i686 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-07-07 02:42 EDT by maheshsk
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-07-07 10:50:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description maheshsk 2003-07-07 02:42:45 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:

I am using the LINUX 9  and gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
I am some C codes and linked these code to form a shared object as libqpt.so.
Now i use this SO file and run the main file which has large arrays declared for
the worspace and others etc. when i run the code i get segmentation fault due to
variables declared are cossing the data segment and the stack size. Hence i
modified my code and used the malloc for those arrays used. I got partial output
and segmentation fault occurs again.

Please anybody can hep me out to increase the stack size as we can do in the
Visual Studio. Note i have no IDE i am running the code in the terminal. Please
do giv me any possible solutions for the problem. My thanks in early.

Mail the solution to me at: maheshsk17@rediffmail.com

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.there are no special setups i just run the code using the command:

 gcc -rdynamic -L./ -lqpt -lm -o qpmain qpmain.c

output i get is:
Segmentation Fault.

Actual Results:  i obtained the partial output in the output file and later same
result segmentation fault is faced.

Expected Results:  an output file has to be generated.
Comment 1 Jakub Jelinek 2003-07-07 10:50:05 EDT
You can tweak the limits with ulimit(1) or setrlimit(2).
Sometimes if the allocations are really huge statically linking helps as well, or going for a 64-bit CPU.
But, bugzilla is certainly not a help forum, you should try mailing lists.

Note You need to log in before you can comment on or make changes to this bug.