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. 百度API车牌识别——Restful方式

    源码下载地址:https://download.csdn.net/download/redhat588/11798294 Delphi xe 10.3.2 for windows 7 环境编译通过! ...

  2. rxjava介绍

    Observable 在RxJava1.x中,最熟悉的莫过于Observable这个类了,笔者刚使用RxJava2.x时,创建一个Observable后,顿时是懵逼的.因为我们熟悉的Subscribe ...

  3. RabbitMQ的消息持久化处理

    1.RabbitMQ的消息持久化处理,消息的可靠性是 RabbitMQ 的一大特色,那么 RabbitMQ 是如何保证消息可靠性的呢——消息持久化. 2.autoDelete属性的理解. 1).@Qu ...

  4. RabbitMQ Node.js 示例

    RabbitQM 处理和管理消息队列的中间人(broker).可简单理解为邮局,你在程序中写好消息,指定好收件人,剩下的事件就是 RabbitMQ 的工作了,它会保证收件人正确收到邮件. 任何发送邮件 ...

  5. wpf listview images

    <ListView x:Name="lv"> <ListView.ItemsPanel> <ItemsPanelTemplate> <St ...

  6. 怎么将PDF转换成DWG?试试这两种方法

    在CAD中,PDF文件也是比较常见的.PDF文件可以更好的预览图纸.但是需要对图纸的内容进行编辑的时候,PDF文件就要进行格式的转换才能够编辑.那怎么将PDF文件转换为DWG格式呢?具体要怎么来进行转 ...

  7. 聚焦性能技术和实践, MTSC全面揭秘PerfDog演进之路

    商业转载请联系腾讯WeTest获得授权,非商业转载请注明出处. 12月14日,2019年度中国移动互联网测试开发大会(Mobile Testing Summit China,简称 MTSC)深圳站于深 ...

  8. webpack代码分离CommonsChunkPlugin插件的使用(防止重复)

    1.webpack.config.js中添加: const path = require('path'); + const webpack = require('webpack'); const HT ...

  9. IOS系统在Safari安装ipa文件

    配置点击下载的地址 itms-services://?action=download-manifest&url= "plist文件路径"plist文件配置 IIS网站配置要 ...

  10. 剑指offer 11:变态跳台阶

    题目描述 一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级.求该青蛙跳上一个n级的台阶总共有多少种跳法.   解法:使用数学归纳法可得,跳n级台阶的跳法一共有f(n)=2n-1中,即本 ...