开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜