Patent ID: 8099636

Claim:
A method for detecting a memory stack fault, the method comprising: reserving a first memory stack for executing software instructions; by a processor, performing write operations to the first memory stack; enabling a debug unit integrated on the processor; as the software instructions are executed, utilizing the debug unit to monitor a memory space adjacent to the first memory stack; detecting, using the debug unit, whether a write operation to the memory space adjacent to the first memory stack is attempted; when an attempted write operation to the memory space adjacent to the first memory stack is detected: identifying a memory stack fault; and interrupting the attempted write operation; utilizing the debug unit to monitor a range of memory in a second memory stack, wherein the second memory stack is not used for executing software instructions; detecting, using the debug unit, whether a write operation in the range of memory in the second memory stack is attempted; and when an attempted write operation to the range of memory in the second memory stack is detected: identifying a memory stack fault; and interrupting the attempted write operation to the range of memory in the second memory stack.