美文网首页
错误整理

错误整理

作者: YuWenHaiBo | 来源:发表于2018-06-20 09:35 被阅读6次

question 1:

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function pointer declared with a different calling convention.

Answers:

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 _stdcallwhere 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.

相关文章

  • 错误整理

    question 1: Run-Time Check Failure #0 - The value of ESP ...

  • 错误整理

    1.报错: Could not automatically select an Xcode workspace.....

  • 错误整理

    1.添加RecylcerView出现无法找到该类,在build.gradle最后添加一句:(注意版本号变化)com...

  • Realm错误整理

    一.错误信息:Attempting to modify object outside of a write tra...

  • comsol错误整理

    定义变量时,黄色的错误都是单位不符合 定义坐标作为自变量的函数时,一般要勾选使用坐标为自变量选项;单位一栏中,自变...

  • cocoapods 错误整理

    Invalid `Podfile` file: syntax error, unexpected end-of-i...

  • 🔴202整理错误

    今天妈妈让我检查一下作业,整理一个错题登记本。 我把最近做的作业打开看了一下,很多都是A+,但是也...

  • MLeaksFinder错误整理

    多数报错跟block有关,也容易排查,有些不容易排查,每解决一个也要消耗很长时间。 2019.1.28 1.从提示...

  • Mybatis错误整理

    1、Parameter '**' not found. Available parameters are [0, ...

  • Nginx错误整理

    1. 缺少ssl模块 当nginx.conf中使用了ssl相关指令时,报如下错误 那是因为安装nginx时未安装n...

网友评论

      本文标题:错误整理

      本文链接:https://www.haomeiwen.com/subject/vletyftx.html