* [ECOS] ARM startup stack & C++
@ 2001-08-08 8:16 Robin Farine
2001-08-08 8:32 ` Andrew Lunn
0 siblings, 1 reply; 5+ messages in thread
From: Robin Farine @ 2001-08-08 8:16 UTC (permalink / raw)
To: ecos-discuss
Hi gang,
I have got some stack overflow during execution of non-trivial static
initializers with C++ programs. The file vectors.S for ARM declares a startup
stack of 512 bytes when configured for separate interrupt stack. What do you
think I should do to get a big stack for initializers/finalizers?
1) Change the hardcoded 512 into 8192 ;-)
2) Add a configuration option for the startup stack size but nothing will use
this "big" area afterwards, correct?
3) Disable the separate interrupt stack but this probably has annoying
implications.
4) A completely different and wonderful solution?
Number 2 seems not too bad to me, what's your opinion?
Robin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] ARM startup stack & C++
2001-08-08 8:16 [ECOS] ARM startup stack & C++ Robin Farine
@ 2001-08-08 8:32 ` Andrew Lunn
2001-08-08 9:13 ` Jonathan Larmour
2001-08-09 0:17 ` Robin Farine
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Lunn @ 2001-08-08 8:32 UTC (permalink / raw)
To: Robin Farine; +Cc: ecos-discuss
On Wed, Aug 08, 2001 at 05:15:31PM +0200, Robin Farine wrote:
> Hi gang,
>
> I have got some stack overflow during execution of non-trivial static
> initializers with C++ programs. The file vectors.S for ARM declares a startup
> stack of 512 bytes when configured for separate interrupt stack. What do you
> think I should do to get a big stack for initializers/finalizers?
>
> 1) Change the hardcoded 512 into 8192 ;-)
Not a good idea. The patch will get lost/forgotten when you hand the
completed code over the industrilisation team of intergration.
>
> 2) Add a configuration option for the startup stack size but nothing will use
> this "big" area afterwards, correct?
Sounds reasonable. Anyone with a non-trivial static initialiser
probably has enough MB of memory that 8K is will not be missed.
> 4) A completely different and wonderful solution?
Change your static to dynamic initialisationm so it can be done in the
context of a thread you can control the size of the stack.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] ARM startup stack & C++
2001-08-08 8:32 ` Andrew Lunn
@ 2001-08-08 9:13 ` Jonathan Larmour
2001-08-09 0:07 ` Robin Farine
2001-08-09 0:17 ` Robin Farine
1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Larmour @ 2001-08-08 9:13 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Robin Farine, ecos-discuss
Andrew Lunn wrote:
> > 4) A completely different and wonderful solution?
>
> Change your static to dynamic initialisationm so it can be done in the
> context of a thread you can control the size of the stack.
5) Enable CYGSEM_LIBC_INVOKE_DEFAULT_STATIC_CONSTRUCTORS and then they are
run from the context of the thread that runs main().
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] ARM startup stack & C++
2001-08-08 9:13 ` Jonathan Larmour
@ 2001-08-09 0:07 ` Robin Farine
0 siblings, 0 replies; 5+ messages in thread
From: Robin Farine @ 2001-08-09 0:07 UTC (permalink / raw)
To: Jonathan Larmour; +Cc: Andrew Lunn, Robin Farine, ecos-discuss
Jonathan Larmour <jlarmour@redhat.com> writes:
[...]
> 5) Enable CYGSEM_LIBC_INVOKE_DEFAULT_STATIC_CONSTRUCTORS and then they are
> run from the context of the thread that runs main().
Et voila, so simple that I can't believe it :-)
Thanks Jonathan,
Robin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] ARM startup stack & C++
2001-08-08 8:32 ` Andrew Lunn
2001-08-08 9:13 ` Jonathan Larmour
@ 2001-08-09 0:17 ` Robin Farine
1 sibling, 0 replies; 5+ messages in thread
From: Robin Farine @ 2001-08-09 0:17 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Robin Farine, ecos-discuss
Andrew Lunn <andrew.lunn@ascom.ch> writes:
[...]
>
> Sounds reasonable. Anyone with a non-trivial static initialiser
> probably has enough MB of memory that 8K is will not be missed.
Agreed.
> > 4) A completely different and wonderful solution?
>
> Change your static to dynamic initialisationm so it can be done in the
> context of a thread you can control the size of the stack.
I'm already doing something like this but even the C++ runtime support pulled
from libgcc causes a stack overflow.
Thanks,
Robin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-08-09 0:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-08 8:16 [ECOS] ARM startup stack & C++ Robin Farine
2001-08-08 8:32 ` Andrew Lunn
2001-08-08 9:13 ` Jonathan Larmour
2001-08-09 0:07 ` Robin Farine
2001-08-09 0:17 ` Robin Farine
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).