[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More C++ Exceptions Issues - Problem Solved





On Sun, 2 May 1999, Rosimildo DaSilva wrote:

> >So in principle the RTEMS program should be shut down with a
> >reasonable amount of grace.
> >
> 
> 
> I have tried abort() and RTEMS shutdowns normally.
> 
> The problem with exceptions not caught is that the stack overflows( Init
> task ).
> 
> By default, RTEMS starts the init task( pthread task ) with a stack of 2K
> for the
> PC386 bsp. This is not enough when you have complex chains of try/catch
> blocks.
> EGCS seems to require around 2.5K minimal of stack to handle
> exceptions.  Can anyone confirm this ?
> I have got this number from my debug session using GDB. I could be wrong
> here.
> 
> I have changed the stack size of the initial task to 8K and everything
> works ok.
> 
> I had to re-compile RTEMS to get the stack size of the Init Task ( pthread )
> changed.
> 
> Joel,
> 
> Is there a way to change the size of stack of an Init Task ( pthread )
> without
> re-compiling RTEMS ?

There are limits to how much you can change on the default pthread init
task.  For GNAT, we tend to only use the pthread init task to create other
tasks.  This would likely be your best bet to avoid recompilation.  The
parameter you want to change is minimum stack size and that impacts all
tasks. 

For an RTEMS "task_create" style task, you can override nearly every
option on the tasks and have multiple ones.  With the posix threads, there
are no options and only a single thread.  Sorry.

It might be interesting to make the minimum task stack size a feature of
the configuration table.

--joel
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985