473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Enlarge the stack size in gcc ?

Qoo


Is there any tools like "stubedit" can let me enlarge the stack size
under linux ?

And I was quite wondering what's the default stack size of the program
compiled with gcc without any parameter ?

Sorry for my poor english : (

Nov 14 '05 #1
3 31527
Qoo wrote:
Is there any tools like "stubedit" can let me enlarge the stack size
under linux ?

And I was quite wondering what's the default stack size of the program
compiled with gcc without any parameter ?

Sorry for my poor english : (


All off topic here, this is a newgroup about the "C" language rather
than on particular implementation. Give gnu.gcc.help a try. Followups
set there.

-David

Nov 14 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Qoo" <qp*****@gmail.com> writes:

[comp.os.linux.development.apps is a more appropriate place than
comp.lang.c. Followups set.]
Is there any tools like "stubedit" can let me enlarge the stack size
under linux ?
No. The stack size is not set in the ELF binary. It's a settable
user resource limit; see RLIMIT_STACK in setrlimit(2).

Have you run out of stack space? Unless you set some really tiny
limits, it should be able to grow *very* large.

On my system, it's set to 8 KiB:

$ ulimit -s
8192

Change it with the ulimit bash builtin, or setrlimit(), or at login
with PAM (pam_limits.so).
And I was quite wondering what's the default stack size of the program
compiled with gcc without any parameter ?


See above: there is *no such thing* as a "default stack size" of a
binary. GNU/Linux is not DOS (i.e. broken).
Regards,
Roger

- --
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
Debian GNU/Linux http://www.debian.org/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFCuISVVcFcaSW/uEgRAh2QAJ9aB6w0TGRHpfOMe7S+OlWFTkm4lgCfbYnT
bviq/0jiUbdaiBAw57h5t98=
=rlam
-----END PGP SIGNATURE-----
Nov 14 '05 #3
In article <11**********************@g14g2000cwa.googlegroups .com>,
Qoo <qp*****@gmail.com> wrote:

Is there any tools like "stubedit" can let me enlarge the stack size
under linux ?


You might want to ask that in a linux-related newsgroup.

The C-related advice is that if you're using so much stack
that you need more...you're probably abusing the stack.
Don't do that.

- Use iteration in preference to recursion when appropriate
- If the nature of what you're doing demands recursion, investigate
alternative algorithms that don't recurse as deeply
- Put large objects into the heap instead of on the stack
- Pass pointers to large things instead of copying them

Just a start.
--
7842++
Nov 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Kevin Grigorenko | last post by:
Hello, I couldn't find an obvious answer to this in the FAQ. My basic question, is: Is there any difference in allocating on the heap versus the stack? If heap or stack implementation is not...
1
by: chris | last post by:
Hi, I need to add a text or image link which when click on will enlarge the text on a web page to ither large or largest. How can I do this, if its possible. Chris
10
by: Shuo Xiang | last post by:
Greetings: I know that variables declared on a stack definitely does not reside in heap space so there is only a very limited amount of stuff that you can store in the stack of a function. But...
5
by: dovgani | last post by:
I have an unmanaged MFC project. The output is static lib. I would like to compile using /clr option. The native lib size is 64 megs and with /clr and /O1 options is 940 megs. Is it possibly...
1
by: Kwok | last post by:
Hello everyone, I am a newbie on this forum and I have some question about access. In my office, I am using MS access 2000 and the maximum length of a text column in the data table is 255 char. ...
1
by: alfie27 | last post by:
I currently have a working program that is a stack that stores integers. Now i have to convert it to store strings instead of integers. I have been working on this for hours and just keep getting...
4
by: Agnes | last post by:
MY application is designed based on 800 X600 screen size. However, some client use 1024 X768 , When they run the application, the form become smaller. I don't want to re-wrtie all the forms How...
9
by: Jensen Somers | last post by:
Hi, Is it possible to change the stack size of a DLL from within the source code? When using threads you can specify the size of the stack you want the thread to use, but since my application...
3
by: mark4asp | last post by:
Stack of limited size containing unique items? Hi guys, How would I implement a stack of limited size containing unique items? For example. Suppose my stack has . I add 2 to it and it is now...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.