加载时_CrtIsValidHeapPointer(块)异常 [英] _CrtIsValidHeapPointer(block) exception on load

查看:138
本文介绍了加载时_CrtIsValidHeapPointer(块)异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将VS2012 WinForm应用程序迁移到VS2015,因为一旦应用程序开始加载就会出现异常。 我希望能帮助找出问题所在。


基本应用程序使用VS2012 C ++ / CLI与OpenCV,CUDA和其他两个库 在调试模式下运行时,情况正常。


现在,我正在将应用程序迁移到VS2015。 我升级了项目并在调试模式下使用VS2015重新编译了每个库。 现在,只要应用程序尝试加载,我就会收到以下错误:


我见过这样的说法,这些错误可能来自于在Release和Debug模式下编译的混合代码。 我不认为是这种情况,因为所有内容都是在调试模式下编译的,指定"多线程调试dll"。其中
合适。  以下是其中一个库属性的屏幕截图:



所以,我的问题是如何弄清楚问题是什么? 我也看到过提及混合托管和非托管代码的内容。 但是,我不认为这是因为相同的代码使用VS2012运行良好。


任何帮助表示感谢。


解决方案

James Pistorino,


感谢您在此发帖。


>>我的问题是如何找出问题所在? 


表达式:_CrtIsValidHeapPointer(块)表示内存已损坏,可能是由于写入缓冲区末尾或写入类结束因为编写者认为类比分配的大(比如当它期望
a派生类并获得基类或不同类的对象时)。

请打开Debug-> Windows->异常设置,将异常设置更改为在最初抛出0xC0000005错误时停止,以便您可以看到初始问题。


有关如何管理例外的更多信息,请参阅以下文档。


https://msdn.microsoft.com/en-us/library/x85tt0dd.aspx?f=255&MSPPError=-2147217396


希望这可以帮到你。


最好的问候,


Sera Yu



I am trying to migrate a VS2012 WinForm application to VS2015 as am getting an exception as soon as the the application starts to load.  I am hoping for some help in figuring out what the issue is.

The basic application uses VS2012 C++/CLI with OpenCV, CUDA, and two other libraries.  When run in debug mode, things worked fine.

Now, I am migrating the app to VS2015.  I upgraded the project and recompiled each library using VS2015 in debug mode.  Now, I get the following error as soon as the app tries to load:

I have seen stuff saying that these kinds of errors can come about from mixing code compiled in Release and Debug modes.  I do not think that is the case because everything was compiled in debug mode specifying "multi-threaded debug dll" where appropriate.   Here is a screen shot of one of the library properties:

So, my question is how can I figure out what the problem is?  I have also seen stuff mentioning mixing managed and unmanaged code.  However, I do not think that is it because the same code ran fine using VS2012.

Any help appreciated.

解决方案

Hi James Pistorino,

thanks for posting here.

>>my question is how can I figure out what the problem is? 

The Expression: _CrtIsValidHeapPointer(block) indicates that memory has corrupted, possibly due to writing past the end of a buffer or writing past the end of a class because the writer assumes the class is larger than was allocated (like when it is expecting a derived class and gets a base class, or object of a different class).
Please open Debug->Windows->Exception Settings, change the exception settings to stop when the 0xC0000005 error is initially thrown so you could see the initial problem.

For more information about how to manage exceptions, please refer to this document below.

https://msdn.microsoft.com/en-us/library/x85tt0dd.aspx?f=255&MSPPError=-2147217396

Hope this could be help of you.

Best Regards,

Sera Yu


这篇关于加载时_CrtIsValidHeapPointer(块)异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆