Machine-translated by Google. Questions are authored in English.
Top

Discussion

A stack overflow in a task is best detected by

  • A.a known pattern written at the end of the stack and checked periodically
  • B.the compiler
  • C.counting the number of context switches the task has suffered since it started
  • D.measuring the task's execution time against its budget

Answer: A

Filling the stack with a sentinel value and having the kernel look at the last words on every switch catches the overrun soon after it happens. A memory protection unit does better still, faulting at the moment of the overrun rather than afterwards.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.