In FreeRTOS, the thread stacks are allocated blocks within the heap. Space isallocated within each stack by executing code (e.g. at procedure entry). Correct program execution requires that no stack ever grow beyond its allocated region. While there are runtime tests that can help detect such an unhappy event, it is difficult to guarantee that an overflow will never occur.