Visual studio 2008“调试断言失败”调用 QDomElement::text() 函数时的消息

发布于 2024-11-25 13:40:28 字数 1465 浏览 2 评论 0原文

我已经包含了源代码、错误和堆栈跟踪。我该如何解决这个问题?我需要有关如何继续处理此

源代码的指针(解释):

QFile xmlInputFile(".\\gatewayipmonitor.xml");  
xmlInputFile.open(QIODevice::ReadOnly);

QByteArray xmlData(xmlInputFile.readAll());

QDomDocument doc;
doc.setContent(xmlData);

QDomElement docEl(doc.documentElement());
const QString tagName(docEl.tagName());

docEl.text();

执行最后一行时 - 我收到消息

Windows 在tests.exe 中触发了断点。

这可能是由于堆损坏造成的,这表明存在错误 test.exe 或它加载的任何 DLL。

这也可能是由于用户在tests.exe执行时按了F12 重点。

输出窗口可能有更多诊断信息。 ”

当我点击继续时 - 我进一步收到消息 -

程序:...n\tests\Release\tests.exe 文件: f:\dd\vctools\crt_bld\self_x86\crt\dbgheap.c

表达式:_CrtIdValidHeapPointer(pUserData)

堆栈跟踪:

msvcr90d.dll!_free_dbg_nolock(void * pUserData=0x00a5f348, int nBlockUse=1)  Line 1317 + 0x30 bytes C++
msvcr90d.dll!_free_dbg(void * pUserData=0x00a5f348, int nBlockUse=1)  Line 1258 + 0xd bytes C++
msvcr90d.dll!free(void * pUserData=0x00a5f348)  Line 49 + 0xb bytes C++
QtCored4.dll!qFree(void * ptr=0x00a5f348)  Line 60 + 0xa bytes  C++
QtCored4.dll!QString::free(QString::Data * d=0x00a5f348)  Line 1185 + 0x9 bytes C++
QtCored4.dll!QString::~QString()  Line 883 + 0x23 bytes C++
tests.exe!test_GatewayIpMonitor()  Line 321 + 0xc bytes C++
tests.exe!main()  Line 343  C++
tests.exe!__tmainCRTStartup()  Line 586 + 0x17 bytes    C

I have included the source, the error and the stack trace. How do I resolve this issue? I need pointers(explanation) on how to proceed regarding this

Source Code :

QFile xmlInputFile(".\\gatewayipmonitor.xml");  
xmlInputFile.open(QIODevice::ReadOnly);

QByteArray xmlData(xmlInputFile.readAll());

QDomDocument doc;
doc.setContent(xmlData);

QDomElement docEl(doc.documentElement());
const QString tagName(docEl.tagName());

docEl.text();

When the last line is executed - I get the message

Windows has triggered a breakpoint in tests.exe.

This may be due to a corruption of the heap, which indicates a bug in
tests.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while tests.exe has
focus.

The output window may have more diagnostic information.
"

When I click continue - I further get the message -

Program: ...n\tests\Release\tests.exe File:
f:\dd\vctools\crt_bld\self_x86\crt\dbgheap.c

Expression:_CrtIdValidHeapPointer(pUserData)

Stack Trace:

msvcr90d.dll!_free_dbg_nolock(void * pUserData=0x00a5f348, int nBlockUse=1)  Line 1317 + 0x30 bytes C++
msvcr90d.dll!_free_dbg(void * pUserData=0x00a5f348, int nBlockUse=1)  Line 1258 + 0xd bytes C++
msvcr90d.dll!free(void * pUserData=0x00a5f348)  Line 49 + 0xb bytes C++
QtCored4.dll!qFree(void * ptr=0x00a5f348)  Line 60 + 0xa bytes  C++
QtCored4.dll!QString::free(QString::Data * d=0x00a5f348)  Line 1185 + 0x9 bytes C++
QtCored4.dll!QString::~QString()  Line 883 + 0x23 bytes C++
tests.exe!test_GatewayIpMonitor()  Line 321 + 0xc bytes C++
tests.exe!main()  Line 343  C++
tests.exe!__tmainCRTStartup()  Line 586 + 0x17 bytes    C

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

注定孤独终老 2024-12-02 13:40:28

我在发布版本中运行该程序,但链接到调试构建库(Qtcored.lib)。这就是问题所在。

I was running the program in the release build but linking against debug build libraries(Qtcored.lib). That was the issue.

坚持沉默 2024-12-02 13:40:28

这不是堆损坏。你正在删除一个坏的qstring。找出当 qstring 实例或指针(最有可能)实际上很糟糕时,它是如何使用的。

it's not heap corruption. you're deleting a bad qstring. find out how that qstring instance or pointer(most likely) was used when it was actuallly bad.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文