Run-Time Check Failure #0
This debug error means that the stack pointer register is not returned to its original value after the function call, i.e. that the number of pushes before the function call were not followed by the equal number of pops after the call.
There are 2 reasons for this that I know (both with dynamically loaded libraries). #1 is what VC++ is describing in the error message, but I don't think this is the most often cause of the error (see #2).
1) Mismatched calling conventions:
The caller and the callee do not have a proper agreement on who is going to do what. For example, if you're calling a DLL function that is _stdcall, but you for some reason have it declared as a _cdecl (default in VC++) in your call. This would happen a lot if you're using different languages in different modules etc.
You would have to inspect the declaration of the offending function, and make sure it is not declared twice, and differently.
2) Mismatched types:
The caller and the callee are not compiled with the same types. For example, a common header defines the types in the API and has recently changed, and one module was recompiled, but the other was not--i.e. some types may have a different size in the caller and in the callee.
In that case, the caller pushes the arguments of one size, but the callee (if you're using _stdcall where the callee cleans the stack) pops the different size. The ESP is not, thus, returned to the correct value.
(Of course, these arguments, and others below them, would seem garbled in the called function, but sometimes you can survive that without a visible crash.)
If you have access to all the code, simply recompile it.
Run-Time Check Failure #0的更多相关文章
- C++程序在debug模式下遇到Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call问题。
今天遇到一个Access Violation的crash,只看crash call stack没有找到更多的线索,于是在debug模式下又跑了一遍,遇到了如下的一个debug的错误提示框: 这个是什么 ...
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. 调用函数约定不同
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is ...
- Run-Time Check Failure #0,The value of ESP was not properly saved 错误解决
调用DLL函数,出现错误 Run-Time Check Failure #0 - The value of ESP was not properly saved across a function c ...
- 【Dll】Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call
[问题说明]调试动态库导出的函数时遇到的问题 [解决方法]要么加上__stdcall,对应__stdcall:要么去掉__stdcall,对应_cdecl
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call错误
我这边新增的接口之后编译,启动debug后提示这个问题, 在网上找了一段时间,感觉各大神说的都好有道理,但是没有作用 so,尝试对整个工程重新编译(理论上只要重新编译修改的文件影响到的地方)
- Run-Time Check Failure #2 - Stack around the variable 'ucPriKey' was corrupt
Run-Time Check Failure #2 一般是栈被破坏,你的代码可能有缓冲区溢出一类的问题. Run-Time Check Failure #2 - Sta ...
- VS2008中Run-Time Check Failure #2 - Stack around the variable 'xxx' was corrupted 错误解决方法
问题 : 在用VS2008写一段代码,算法都没有问题,但是调试的时候发现出了main之后就报 Stack around the variable 'xxx' was corrupted 的错误,后来发 ...
- 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]; //此处如果索引值 ...
- 解决Matlab启动时 " Can't check 9.0 VCRTs The application has failed to start because……" 的错误
注:转载或引用请注明出处 今天在winserver 2012 r2 上安装matlab 2016b , 安装完成运行时提示: ERROR: Cnn't check 9.0 VCRTs <star ...
随机推荐
- 用pyperclip 模块拷贝粘贴字符串
>>> import pyperclip>>> pyperclip.copy('Hello world!')>>> pyperclip.paste ...
- Smarty模板快速入门
文件下载 1.下载地址:http://www.smarty.net/ 2.我下载的版本是3.1.27 ,将下载的文件smarty-3.1.27.zip解压出来,然后将libs文件夹的所有文件复制到你的 ...
- Linux操作系统中内存buffer和cache的区别--从free命令说起(转)
原文链接:http://os.51cto.com/art/200709/56603.htm 我们一开始,先从Free命令说起. Free free 命令相对于top 提供了更简洁的查看系统内存使用情况 ...
- Jmeter性能测试示例
这次成功做了一个jmeter借口性能测试的简单测试示例,分享一下给大家. jmeter作为一个简单的开源工具,基于java的性能测试工具,使用起来很简单. 也可以作为二次开发,复杂的情形可以自己写代码 ...
- jdbc简单小登陆demo
package com.test; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultS ...
- shell读取nginx配置文件中nginx的端口
#!/bin/shport=`nl /usr/local/openresty/nginx/conf/nginx.conf | sed -n '/listen/p' | awk 'NR==1{print ...
- elasticsearch更新license
Elasticsearch更新license: 初次安装Marvel,有30天的使用时间,当到期后,只保存7天的数据,所以需要注册申请一个license: 注册申请地址: https://regist ...
- Understanding Optional and Compulsory Parameters
If the MVC Framework cannot find a value for a reference type parameter (such as a string or object) ...
- C语言数据类型64位和32机器的区别
C语言编程需要注意的64位和32机器的区别 .数据类型特别是int相关的类型在不同位数机器的平台下长度不同.C99标准并不规定具体数据类型的长度大小,只规定级别.作下比较: 32位平台 char:1字 ...
- 堆管理之malloc和free分析
在win7 64环境下分析 1.malloc代码 int main(){ void *p = malloc(0xa8); memset(p, 'a', 0xa8); free(p); return 0 ...