简体   繁体   English

Debug Assertion Failed:C#应用程序中的C ++异常?

[英]Debug Assertion Failed: C++ exception in a C# application?

I have been managing and updating a particular application. 我一直在管理和更新特定的应用程序。 It is old and I am not the original developer. 它已经老了,我不是原来的开发者。 It's suffered through several debugging sessions over the years among other small patches. 多年来,它经历了多次调试,其中包括其他小补丁。

It has been running stable for the last couple of months, but then an exception occurred that seems odd to me. 它在过去几个月里一直运行稳定,但随后发生了一个例外,这对我来说似乎很奇怪。 Since this only happens on the server ( it is a server application. ) in release mode. 因为这只发生在发布模式的服务器上(它是服务器应用程序)。

The application is written in C#, is managed in Visual Studio 2012 Professional and is released to be explicitly 32-bit .NET 3.5 since the server is unfortunately running Windows 2003. (I have tried to convince them to update so I can update the application to .NET 4.5. But alas.) 该应用程序是用C#编写的,在Visual Studio 2012 Professional中管理,并且由于服务器不幸运行Windows 2003而被发布为显式32位.NET 3.5。(我试图说服他们更新,以便我可以更新应用程序到.NET 4.5。但是唉。)

So I am getting a C++ Debug message. 所以我得到一个C ++调试消息。 See the screenshot below. 请参见下面的截图。 It occurs in a file named vsprintf.c I am guessing on line 91. The only message that gives me any hint is format != NULL. 它出现在一个名为vsprintf.c的文件中。我在第91行猜测。唯一给我任何提示的消息是格式!= NULL。

This confuses me however. 然而,这让我很困惑。 What can possibly cause this? 什么可能导致这种情况? What steps can I best take to debug in a situation like this? 在这种情况下,我最好采取哪些步骤进行调试? What is "vsprintf.c"? 什么是“vsprintf.c”?

例外

Edit: I managed to find something in eventviewer. 编辑:我设法在eventviewer中找到了一些东西。 I will continue to research this in the meanwhile. 我将继续研究这个问题。

事件查看器

Sincerely, 此致

me. 我。

This is an assertion failure, ie an assumtion that a function you are calling makes is not met, in this case that a pointer is not null. 这是一个断言失败,即无法满足您正在调用的函数,在这种情况下指针不为null。 From the looks of it, its a format string. 从它的外观来看,它是一个格式字符串。 Are you using format strings directly? 你是直接使用格式字符串吗? If so, look there. 如果是这样,那就看看吧。 If not, this is probably a memory leak problem, followed by an out-of-memory malfunction. 如果没有,这可能是内存泄漏问题,其次是内存不足故障。

vsprintf calls can be caused by sprintf and other derivates, you should maybe check all these calls. vsprintf调用可能是由sprintf和其他派生引起的,你应该检查所有这些调用。 (This can also be methods of string classes, as I saw in the VCL). (这也可以是字符串类的方法,正如我在VCL中看到的那样)。

If the bug isn't caused by one of the libraries you use, then there should be a NULL (or 0 ) in the format string parameter , which is mostly the last before the ... in the prototype. 如果错误不是由您使用的某个库引起的,那么格式字符串参数中应该有一个NULL (或0 ),这通常是原型中...之前的最后一个。

If you are familiar with regular expressions , this may help a lot when looking for patterns. 如果您熟悉正则表达式 ,那么在查找模式时这可能会有很大帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM