开发者

process handling stack overflow

开发者 https://www.devze.com 2023-02-07 18:39 出处:网络
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

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

精彩评论

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