Bug 98663 - How to increase the Stack size and Data size for C codes to run in gcc in LInux
Summary: How to increase the Stack size and Data size for C codes to run in gcc in LInux
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 9
Hardware: i686
OS: Linux
high
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-07-07 06:42 UTC by maheshsk
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-07-07 14:50:05 UTC
Embargoed:


Attachments (Terms of Use)

Description maheshsk 2003-07-07 06:42:45 UTC
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

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


How reproducible:
Always

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 14:50:05 UTC
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.