进程处理堆栈溢出

发布于 2024-10-15 16:09:59 字数 223 浏览 6 评论 0原文

我有一个疑问,情况是这样的 -

假设进程通过使用写保护页保护其堆栈区域边界来检测和处理堆栈溢出。因此,由于堆栈溢出而对此页的任何写入都将导致生成 SIGSEGV 信号。

但是由于进程堆栈已经溢出,如何执行 SIGSEGV 的信号处理程序???

问题。希望我能找到一些答案。提前致谢。

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 conceptual question. Hope I'll find some answers. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巷雨优美回忆 2024-10-22 16:09:59

通常,您切换到单独的堆栈来运行信号/异常处理程序。无论如何,大多数都在内核模式下运行,并且(至少通常)内核模式中的任何内容在任何情况下都不会脱离用户模式堆栈。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文