【问题标题】:Qt app fails to start in Release mode when launched from QtCreator ( Qt5widgets.dll error #c0000005 )从 QtCreator 启动时,Qt 应用程序无法以发布模式启动(Qt5widgets.dll 错误 #c0000005)
【发布时间】:2016-08-27 08:27:36
【问题描述】:

我基于 Qt 5.7.0(MSVC 2013,32 位)使用 Qt Creator 4.0.3 开发了一个小型 Qt 应用程序。它具有一些 GUI 功能、2 个 UI 表单,并执行一些计算。我在 Windows 7 SP1(64 位)上工作。

无论如何,它在调试模式下工作正常(从 Qt Creator 编译和执行)。在 Release 模式下编译也可以,但是当我在 Release 模式下启动它时,应用程序从一开始就崩溃并且我收到以下错误消息:

问题名称:APPRCASH
指定默认模块名称:Qt5Widgets.dll
异常代码:c0000005
例外情况:00000000000443f6
系统版本:6.1.7601.2.1.0.768.3
地区参数标识:1036
信息补充 n° 1: 8ea0
信息补充 n° 2:8ea0c4174e0822e8b28dbc57f24bae2b
信息补充 n° 3:3b5a
信息补充 n° 4:3b5acddea433ec4f225b96ef9c334a03

我真的无法猜测问题是如何解决的,它阻止了我跳到部署过程的下一步(顺便说一下,当我尝试双击直接执行应用程序时,我得到了同样的错误它,即使在使用 windeployqt 并添加所需的 DLL 之后...)。

这是我的 .pro 文件:

QT += xml widgets network
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport

HEADERS += \
    fenprincipale.h \
    quandldatadomdoc.h \
    historique.h \
    portfoliohistorique.h \
    portfolio.h \
    security.h \
    portfoliomodel.h \
    portfolioitem.h \
    portfoliodelegate.h \
    historicmanager.h \
    dialogvarhisto.h \
    qcustomplot.h \
    fengraphvar.h

SOURCES += \
    fenprincipale.cpp \
    main.cpp \
    quandldatadomdoc.cpp \
    historique.cpp \
    portfoliohistorique.cpp \
    portfolio.cpp \
    security.cpp \
    portfoliomodel.cpp \
    portfolioitem.cpp \
    portfoliodelegate.cpp \
    historicmanager.cpp \
    dialogvarhisto.cpp \
    qcustomplot.cpp \
    fengraphvar.cpp

RESOURCES += \
    resourcesro.qrc

FORMS += \
    dialogvarhisto.ui \
    fengraphvar.ui

编辑:

查看 JIT Visual Studio 调试器窗口,我得到以下输出:

调用栈:

Qt5Widgets.dll!00000000506843f6()   Unknown
    RiskOffice.exe!000000013f9f3c60()   Unknown
    RiskOffice.exe!000000013f9f16d1()   Unknown
    RiskOffice.exe!000000013f9f7795()   Unknown
    RiskOffice.exe!000000013fa34465()   Unknown
    RiskOffice.exe!000000013fa33dfd()   Unknown
    [External Code] 

--------------------------------------------OUTPUT----------------------

'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\bin\Qt5Widgets.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\lpk.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\usp10.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\bin\Qt5Gui.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\bin\Qt5Core.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\nsi.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\mpr.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\msvcp120.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\msvcr120.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\bin\Qt5Xml.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\bin\Qt5Network.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\dnsapi.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\IPHLPAPI.DLL'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\winnsi.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\nvinitx.dll'. Cannot find or open the PDB file.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\platforms\qwindows.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\bearer\qgenericbearer.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\dhcpcsvc.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\dhcpcsvc6.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\bearer\qnativewifibearer.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\wlanapi.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Windows\System32\wlanutil.dll'. Symbols loaded.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qdds.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qgif.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qicns.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qico.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qjpeg.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qsvg.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\bin\Qt5Svg.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qtga.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qtiff.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qwbmp.dll'. Module was built without symbols.
'RiskOffice.exe' (Win32): Loaded 'C:\Qt\5.7\msvc2013_64\plugins\imageformats\qwebp.dll'. Module was built without symbols.
The thread 0x1edc has exited with code 0 (0x0).
Unhandled exception at 0x00000000506843F6 (Qt5Widgets.dll) in RiskOffice.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

...基本上说某些模块(包括 Qt5Widgets.dll )是“无符号构建的”,但我不知道如何解释...

【问题讨论】:

  • 当您在 Qt Creator 中运行 Release 构建(但仍在调试器下)时,当它崩溃时您会得到一个调用堆栈吗?
  • 一个疯狂的猜测:一个未初始化的变量。如果您无法从调试器中获得任何有意义的信息,您始终可以通过注释掉应用程序的某些部分直到它不再崩溃来确定问题所在,然后逐个恢复直到找出确切的问题部分是罪魁祸首。
  • 嗨,mike,jpnurmi,我已经用 MSVC JIT 调试器的一些输出编辑了我的问题...谢谢

标签: qt dll widget qt5 release


【解决方案1】:

好的,我刚刚忘记在我的 MainWindow 实例化时删除未初始化的 QAction 对象。将它添加到 QMenuBar 并没有让应用程序在调试模式下崩溃,但它确实在发布模式下崩溃了!太棒了!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-23
    • 1970-01-01
    • 2018-02-14
    • 1970-01-01
    相关资源
    最近更新 更多