rtems exception handling

Rosimildo daSilva rdasilva at connecttel.com
Thu Jan 10 21:12:47 UTC 2002


From: Joel Sherrill <joel.sherrill at OARcorp.com>
To: Hennenfent, Nick {AVL~Roswell} <NICK.HENNENFENT at ROCHE.COM>
Cc: rtems-users at OARcorp.com <rtems-users at OARcorp.com>
Date: Thursday, January 10, 2002 3:02 PM
Subject: Re: rtems exception handling


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


Hi,

You did not say which platform is being used. But, i386 requires quite
a lot of "free stack" to handle one exception. IIRC, you need around 2.5K
to safely handle one exception.

Rosimildo.







More information about the users mailing list