本文介绍了堆栈损坏在C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C ++中,堆栈可能被破坏的方式。我想一种方法是通过访问数组超出其边界来覆盖堆栈变量。
In C++, in which way the stack may get corrupted. One way I guess is to overwriting the stack variables by accessing an array beyond its boundaries. Is there any other way that it can get corrupted?
推荐答案
- 你可以有一个随机/未定义的
- 装配功能可能会错误地设置/修改/恢复堆栈
- 宇宙波
- 内核中的任何东西都可能出错,堆栈内存。
- You could have a random/undefined pointer that ends up pointing to the stack, and write though that.
- An assembly function could incorrectly setup/modify/restore the stack
- Cosmic waves could flips bits in the stack.
- Radioactive elements in the chip's casing could flip bits.
- Anything in the kernel could go wrong and accidentally change your stack memory.
但这些不是特定的C ++,它不知道堆栈。
But those are not particular to C++, which doesn't have any idea of the stack.
这篇关于堆栈损坏在C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!