Enlarge the stack size in gcc ?

Q

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 : (
 
D

David Resnick

Qoo said:
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
 
R

Roger Leigh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


[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-----
 
A

Anonymous 7843

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top