rtems exception handling

Joel Sherrill joel.sherrill at OARcorp.com
Thu Jan 10 20:51:42 UTC 2002


> "Hennenfent, Nick {AVL~Roswell}" wrote:
> 
> I have tried using
> 
> try
> {
>     // do something that throws an exception
> }
> catch (...)
> {
>     // report an error
> }
> 
> blocks but when an exception is thrown, I end up getting an
> rtems_fatal_error because the stack checker thinks the stack
> is corrupt.
> 
> Does anyone know if this is even supposed to work???
> Are exceptions incompatible with the rtems stack checker???

They shouldn't be.  The stack checker is very simple and 
probably really flagging a blown stack.  It writes a known pattern
into the stack and checks to see if the last N bytes of the
stack always have that pattern.  If they don't, you
have blown the stack.  Stack checking is only done
during a context switch so more than likely the exception
is just the first time you are switching since the actually
point of blowing up.

> Thanks.
> 
> Nick

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



More information about the users mailing list