public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* adjusting stack size of executable compiled by gcc
@ 2004-09-27 15:27 tony vong
  2004-09-27 19:15 ` tm_gccmail
  2004-09-27 22:17 ` Mike Stump
  0 siblings, 2 replies; 3+ messages in thread
From: tony vong @ 2004-09-27 15:27 UTC (permalink / raw)
  To: gcc-help-help, gcc

Hi,

I am writing a simulator using c++. I am suspecting my
program is hitting some kind of stack limit because:
1. it crashes at some point that does not make sense
2. when I add some 'unused' variable to some class,
the 
crash point change. Since those newly added variables
are NEVER used, the crash point should be the same.

Therefore, I suspect my program is hitting some sort
of stack limit. I am using gcc 3.4.1 on redhat 9. 

I WOULD LIKE TO KNOW:

1. how to find out the stack size of my executable
2. how do I increase the stack size when I compiled it
with gcc ???

thank you.


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: adjusting stack size of executable compiled by gcc
  2004-09-27 15:27 adjusting stack size of executable compiled by gcc tony vong
@ 2004-09-27 19:15 ` tm_gccmail
  2004-09-27 22:17 ` Mike Stump
  1 sibling, 0 replies; 3+ messages in thread
From: tm_gccmail @ 2004-09-27 19:15 UTC (permalink / raw)
  To: tony vong; +Cc: gcc-help-help, gcc

On Mon, 27 Sep 2004, tony vong wrote:

> Hi,
> 
> I am writing a simulator using c++. I am suspecting my
> program is hitting some kind of stack limit because:
> 1. it crashes at some point that does not make sense
> 2. when I add some 'unused' variable to some class,
> the 
> crash point change. Since those newly added variables
> are NEVER used, the crash point should be the same.
> 
> Therefore, I suspect my program is hitting some sort
> of stack limit. I am using gcc 3.4.1 on redhat 9. 
> 
> I WOULD LIKE TO KNOW:
> 
> 1. how to find out the stack size of my executable
> 2. how do I increase the stack size when I compiled it
> with gcc ???
> 
> thank you.
> 
> 
> 		
> _______________________________
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com

This is the wrong list for asking such questions.

This list is for the discussion of gcc internals.

You are asking a question about the stack size for an operating system,
which needs to be asked on an OPERATING SYSTEM mailing list.

Toshi


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: adjusting stack size of executable compiled by gcc
  2004-09-27 15:27 adjusting stack size of executable compiled by gcc tony vong
  2004-09-27 19:15 ` tm_gccmail
@ 2004-09-27 22:17 ` Mike Stump
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Stump @ 2004-09-27 22:17 UTC (permalink / raw)
  To: tony vong; +Cc: gcc-help-help, gcc

On Monday, September 27, 2004, at 06:12  AM, tony vong wrote:
> I am writing a simulator using c++. I am suspecting my
> program is hitting some kind of stack limit because:

> 2. how do I increase the stack size when I compiled it
> with gcc ???

Please don't use the gcc list, it isn't for what you think it is for.

See ulimit -a (ulimit -s) from bash, if you must

In portable code, pretend the stack is 1MB large and each frame takes 
128 bytes + whatever variables you need, you won't go wrong.  For 
things larger, use malloc/new.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-27 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-27 15:27 adjusting stack size of executable compiled by gcc tony vong
2004-09-27 19:15 ` tm_gccmail
2004-09-27 22:17 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).