process handling stack overflow
I have a doubt which goes like this -
Assume that a process detects and handles stack overflow by protecting its stack region boundary with a write protected page. Thus any write to this page due to stack overflow will result in a SIGSEGV signal being generated.
But since the process stack has already overflowed how can the signal handler for the SIGSEGV be executed????
It's a conc开发者_开发百科eptual question. Hope I'll find some answers. Thanks in advance.
Typically, you switch to a separate stack to run the signal/exception handler. Most run in kernel mode anyway, and (at least normally) nothing in kernel mode runs off a user-mode stack in any case.
精彩评论