zoukankan      html  css  js  c++  java
  • Run-Time Check Failure #0

    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.

    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.
  • 相关阅读:
    商品详情的图片添加水印
    ElasticSearch 简单的crud查询
    java产生随机数的三种方式
    springboot+mybatis集成分页功能
    springboot集成swagger文档
    springboot项目根据不同的环境启动不同的配置,如开发环境dev,测试环境sit,生产环境application
    解释器模式
    中介者模式
    访问者模式
    x01.FileProcessor: 文件处理
  • 原文地址:https://www.cnblogs.com/hongjiumu/p/3525512.html
Copyright © 2011-2022 走看看