Patent ID: 9513911
Filing Date: 2016-12-06
CPC Classification: G06F

Claim Text:
1. A method of detecting stack overflows, comprising the following steps: A. storing, in at least one dedicated register, at least one of: a first data item indicating a maximum permitted value for a stack pointer, and a second data item indicating a minimum permitted value for said stack pointer; B. effecting a comparison between a current value or a past value of said stack pointer and at least one of said first data item and said second data item; C. generating a stack overflow exception if said comparison indicates that said current or past value of said stack pointer is greater than said maximum permitted value or less than said minimum permitted value; A1: storing in at least one other dedicated register at least one of: a third data item indicating a maximum value assumed by a stack pointer during an execution of a thread or process and a fourth data item indicating a minimum value assumed by said stack pointer during execution of said thread or process; and B1: continuously updating at least one of said third and fourth data items during an execution of said thread or process; wherein said step A1 is implemented by an operating system at an activation time of said thread or process and said step B1 is implemented by a hardware processor module during an execution of said thread or process, and wherein said step A is implemented by the operating system at the activation time of said thread or process and said steps B and C are implemented by said operating system at a context switching time for a suspension of said thread or process and an activation of another thread or process and comprise at least one comparison chosen from: a comparison between said first data item indicating the maximum permitted value for the stack pointer and said third data item indicating the maximum value assumed by said stack pointer at the execution time of the thread or process currently suspended and a comparison between said second data item indicating the minimum permitted value for the stack pointer and said fourth data item indicating the minimum value assumed by said stack pointer at the execution time of said thread or process currently suspended.