C++ exception in ISR

Joel Sherrill joel.sherrill at OARcorp.com
Tue Oct 25 18:01:08 UTC 2011

On 10/25/2011 12:36 PM, Kirspel, Kevin wrote:
> I came across a little issue that I thought was interesting.  I have a 
> RTEMS timer that fires and pushes a value on a c++ vector.  After a 
> number of pushes, a c++ exception is generated (I assume an exception 
> is generated because GCC tries to lock one of its mutexes using 
> gxx_wrappers.c).  The exception never gets processed because GCC is 
> trying to lock a mutex within an ISR.  Of course RTEMS doesn’t like 
> this and a fatal error is generated.  Should RTEMS be able to handle a 
> C++ exception within an ISR?
The Timer Server was added specifically for this case.   If the run-time
does things which are not legal from an ISR, then you can't use
it for ISR based timers.  Both Ada and C++ use locks which could
(1) cause you to block and (2) may have priority inheritance or ceiling.

> Kevin Kirspel
> Senior Research Engineer
> Opti Medical
> 235 Hembree Park Drive
> Roswell GA 30076
> Tel: (770)-510-4444 ext. 81642
> Direct: (770)-688-1642
> Fax: (770)-510-4445

Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill 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