堆栈损坏在C ++ [英] Stack corruption in C++

查看:222
本文介绍了堆栈损坏在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?

推荐答案


  1. 你可以有一个随机/未定义的

  2. 装配功能可能会错误地设置/修改/恢复堆栈

  3. 宇宙波


  4. 内核中的任何东西都可能出错,堆栈内存。

  1. You could have a random/undefined pointer that ends up pointing to the stack, and write though that.
  2. An assembly function could incorrectly setup/modify/restore the stack
  3. Cosmic waves could flips bits in the stack.
  4. Radioactive elements in the chip's casing could flip bits.
  5. 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 ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆