"Nested" context switch

Thanks for the detailed reply. While I agree with you that if the processor enters SVC mode to handle such exception there is no way another exception of the same type can be handled, that was not what my initial problem. My program was servicing the SysTick interrupt within FreeRTOS_SWI_Handler and I couldn’t understand why. After looking through some of the ARMv7-A documentation I discovered that when an exception is taken the I bit of the CPSR is automatically set. Apparently, I was mistakenly enabling interrupts by calling ulPortSetInterruptMask and vPortClearInterruptMask inside taskCHECK_FOR_STACK_OVERFLOW.