https://blog.csdn.net/hou09tian/article/details/75042206

  1. 把 project->配置属性->c/c++->代码生成->基本运行时检查 为 默认值 就不会报本异常。具体原因正在研究中。。。
  2. 如果改为其他就有exception。
  3. exception有时是有道理的
  4. // step 1
  5. STRINGC2& STRINGC2::operator += (const char x)
  6. {
  7. // if (x == 0) return *this;
  8. char ptr[1]; // max is 1 digit
  9. ptr[0] = x;
  10. ptr[1] = '/0';
  11. *this += ptr; // off to step 2 and back
  12. return *this; // step 4 crash
  13. }
  14. 这个也会导致上述exception。
  15. 问题描述:
  16. Problem
  17. The following error message occurs when building on Test RealTIme environment with the cvisual7 TDP?
  18. Run-Time Check Failure #2 - Stack around the variable 'xxx' was corrupted.
  19. Cause
  20. Stack pointer corruption is caused writing outside the allocated buffer in stack memeory.
  21. Solution
  22. This kind of error is detected by setting /RTC1 compiler option from menu Project -> Settings -> Configuration properties -> Build -> Compiler -> Compiler flags when using TDP cvisual7 in IBM® Rational® Test RealTime environment.. This enables stack frame run-time error checking. For example, the following code may cause the above error messge.
  23. #include <stdio.h>
  24. #include <string.h>
  25. #define BUFF_LEN 11 // 12 may fix the Run-Time Check Failure #2
  26. int rtc_option_test(char * pStr);
  27. int main()
  28. {
  29. char * myStr = "hello world";
  30. rtc_option_test(myStr);
  31. return 0;
  32. }
  33. int rtc_option_test(char * pStr)
  34. {
  35. char buff[BUFF_LEN];
  36. strcpy(buff, pStr); //cause Run-Time Check Failure #2 - Stack around
  37. //the variable 'buff' was corrupted.
  38. return 0;
  39. }

vs中 Stack around the variable 'XXX' was corrupted.的更多相关文章

  1. VS2008中Run-Time Check Failure #2 - Stack around the variable 'xxx' was corrupted 错误解决方法

    问题 : 在用VS2008写一段代码,算法都没有问题,但是调试的时候发现出了main之后就报 Stack around the variable 'xxx' was corrupted 的错误,后来发 ...

  2. Run-Time Check Failure #2 Stack around the variable ‘xxx’ was corrupted

    在改别人代码时,运行报错: Run-Time Check Failure #2 Stack around the variable 'buffer' was corrupted 这表明你对某变量的赋值 ...

  3. vs中“Stack around the variable was corrupted”的解决方案

    把 project->配置属性->c/c++->代码生成->基本运行时检查 为 默认值 就不会报本异常.具体原因正在研究中... 如果改为其他就有exception. exce ...

  4. Stack around the variable 'szStr' was corrupted.

    错误:stack around the variable “XX” was corrupted.,中文翻译就是“在变量XX周围的堆栈已损坏”. 把 project->配置属性->c/c++ ...

  5. c++. Run-Time Check Failure #2 - Stack around the variable 'cc' was corrupted.

    Run-Time Check Failure #2 - Stack around the variable 'cc' was corrupted. char cc[1024];   //此处如果索引值 ...

  6. Run-Time Check Failure #2 - Stack around the variable 's' was corrupted. 出现了 。

    程序中存在内存越界,注意数组大小和数据大小.

  7. stack around the variable “XX” was corrupted

    晚上花了几个小时fix了这个恼人的BUG!“在变量XX周围的堆栈已损坏” 在网上找到的解释是: 把“project->配置属性->c/c++->代码生成->基本运行时检查 设置 ...

  8. Run-Time Check Failure #2 - Stack around the variable 'ucPriKey' was corrupt

    Run-Time    Check    Failure    #2        一般是栈被破坏,你的代码可能有缓冲区溢出一类的问题. Run-Time Check Failure #2 - Sta ...

  9. 运行时错误:“stack around the variable…was corrupted”

    造冰箱的大熊猫@cnblogs 2018/11/1 引发问题的代码片段如下 WORD var; scanf ( "%d", &var ); 包含上述代码的程序,编译正常,运 ...

随机推荐

  1. 《细说PHP》第四版 样章 第23章 自定义PHP接口规范 10

    23.5.4  客户端访问API 按RESTful规范开发API,又有详细的帮助文档,客户端的应用就相对容易一些.下面,以PHP作为访问接口的客户端,演示API的应用.在PHP中请求接口需要使用CUR ...

  2. Java Tomcat 使用(IDEA)

    Tomcat 服务器软件的使用 (配置文件,  部署项目 ); 基本的 web 知识回顾: 1. web 服务器 软件:  Tomcat  (常见的, 主流的, 开源的, 免费的,软件)   1. 软 ...

  3. oracle 关联更新

    不多说了,我们来做实验吧. 创建如下表数据 select * from t1 ; select * from t2; 现需求:参照T2表,修改T1表,修改条件为两表的fname列内容一致. 方式1,u ...

  4. Xshell的一些使用方法和注意事项

    xshell 本文就是想记录下最近遇到的一些问题,以及一些 xshell 能帮助我们提升效率的方面. xshell 编码问题 我们连接服务器,是通过本地登录到 跳板机,然后通过跳板机登录到 我们的服务 ...

  5. Flask笔记:上下文

    线程隔离Thread Local: 如果一个对象具有线程隔离的特性,就可以称之为“Thread Local”,线程隔离是指该对象在不同的线程中都是独立的,在一个线程中对该对象的操作不会影响另一个线程对 ...

  6. 微软在Build 2019大会上发布Fluid Framework协作平台

    在今年年度开发者大会上,微软已经为开发人员宣布了一个新的Fluid Framework.该框架基本上是一个新的基于Web的平台,允许团队在自由流动的流程上工作.微软已经分享了一些新功能,可以帮助团队在 ...

  7. /cygdrive/c/MinGW/bin/autoconf-2.68: line 501: /mingw/bin/autom4te-2.68: No such file or directory

    出现如下错误 编译openssh的时候 # autoconf /cygdrive/c/MinGW/bin/autoconf-2.68: line 501: /mingw/bin/autom4te-2. ...

  8. nRF24L01+不能接收或接收偶尔异常等问题实战分享

    nRF24L01+接收异常问题综述 在调试nRF24L01+无线收发模块的时候,最具标志性的环节就是在接收端可以收到数据.在实际应用调试中,会出现很多意想不到的情况,造成nRF24L01+模块接收端无 ...

  9. 安装quickLook插件以及解决如何不能读取offic问题

    目录 @(安装quickLook插件) quickLook插件是Mac上的快速浏览的一个功能,现在win10系统上也能安装插件,这个插件可以快速浏览txt,doc,图片,表格等文件如下图: 我认为最方 ...

  10. linux环境下的Oracle部署

    一.  环境及相关软件 虚拟机:VMwore Workstation Linux系统:CentOS ORACLE:ORACLE_112030_Linux-x86-64 Xmanger软件 二.  安装 ...