32位Qt应用程序在Windows 7 x64上随机崩溃

时间:2015-07-28 08:52:34

标签: c++ windows qt crash

我们有一个旧的代码库,我们使用Windows XP SP3下的C ++ Qt框架(v4.6.3)开发。使用该代码库构建的应用程序在Windows XP下无需解决问题。

根据客户要求,我们将应用程序部署到Windows 7 x64计算机上。之后,当我们尝试启动应用程序时,我们在发布版本中遇到了随机崩溃问题。崩溃时,应用程序消耗近2GB的内存。如果我们将应用程序兼容性更改为Windows XP SP3,则崩溃问题就会消失。在调试模式下也不会发生崩溃。

我们收集了一些关于崩溃问题的日志。下面给出了日志:
1.应用程序崩溃后的Windows日志。

Problem signature:
  Problem Event Name: APPCRASH
  Application Name: kmclient3.exe
  Application Version: 0.0.0.0
  Application Timestamp: 55b72d4f
  Fault Module Name: KERNELBASE.dll
  Fault Module Version: 6.1.7601.18409
  Fault Module Timestamp: 53159a86
  Exception Code: e06d7363
  Exception Offset: 0000c42d
  OS Version: 6.1.7601.2.1.0.256.48
  Locale ID: 1055
  Additional Information 1: 9c29
  Additional Information 2: 9c2952f45ffd526b51f7caf2e8b92e02
  Additional Information 3: e72c
  Additional Information 4: e72c8eab1d594c6991d297d4615a53d6

2.在应用程序崩溃后附加调试程序时的.WinDbg日志。

** wait with pending attach

Symbol search path is: E:\Symbols  
Executable search path is:   
ModLoad: 01220000 014f7000     E:\YERLISINYAL09\YAZILIM\build\TKM_crash_test\kmclient3.exe  
ModLoad: 76dd0000 76f79000   C:\Windows\SYSTEM32\ntdll.dll  
ModLoad: 76fb0000 77130000   ntdll.dll  
ModLoad: 00000000`748f0000 00000000`7492f000   C:\Windows\SYSTEM32\wow64.dll  
ModLoad: 00000000`74890000 00000000`748ec000   C:\Windows\SYSTEM32\wow64win.dll  
ModLoad: 00000000`74880000 00000000`74888000   C:\Windows\SYSTEM32\wow64cpu.dll
ModLoad: 00000000`769f0000 00000000`76b00000   KERNEL32.dll  
ModLoad: 00000000`74c30000 00000000`74c77000   KERNELBASE.dll  
ModLoad: 00000000`596e0000 00000000`5971e000   UMEngx86.dll  
ModLoad: 00000000`67000000 00000000`67211000   QtCore4.dll  
ModLoad: 00000000`74ad0000 00000000`74bd0000   USER32.dll  
ModLoad: 00000000`75310000 00000000`753a0000   GDI32.dll  
ModLoad: 00000000`75100000 00000000`7510a000   LPK.dll   
ModLoad: 00000000`75a60000 00000000`75afd000   USP10.dll  
ModLoad: 00000000`76920000 00000000`769cc000   msvcrt.dll  
ModLoad: 00000000`74c90000 00000000`74d30000   ADVAPI32.dll  
ModLoad: 00000000`76760000 00000000`76779000   SECHOST.dll  
ModLoad: 00000000`75220000 00000000`75310000   RPCRT4.dll  
ModLoad: 00000000`74950000 00000000`749b0000   SspiCli.dll  
ModLoad: 00000000`74940000 00000000`7494c000   CRYPTBASE.dll  
ModLoad: 00000000`754c0000 00000000`7561c000   ole32.dll  
ModLoad: 00000000`757b0000 00000000`757e5000   WS2_32.dll  
ModLoad: 00000000`74c80000 00000000`74c86000   NSI.dll   
ModLoad: 00000000`5a5a0000 00000000`5a62e000   MSVCP90.dll  
ModLoad: 00000000`737f0000 00000000`73893000   MSVCR90.dll  
ModLoad: 00000000`65000000 00000000`657a7000   QtGui4.dll  
ModLoad: 00000000`749b0000 00000000`74a2b000   COMDLG32.dll  
ModLoad: 00000000`757f0000 00000000`75847000   SHLWAPI.dll  
ModLoad: 00000000`5ce00000 00000000`5ce84000   COMCTL32.dll  
ModLoad: 00000000`75b00000 00000000`7674a000   SHELL32.dll  
ModLoad: 00000000`76b10000 00000000`76b9f000   OLEAUT32.dll  
ModLoad: 00000000`74bd0000 00000000`74c30000   IMM32.dll  
ModLoad: 00000000`75120000 00000000`751ec000   MSCTF.dll  
ModLoad: 00000000`5a560000 00000000`5a592000   WINMM.dll  
ModLoad: 00000000`74810000 00000000`74861000   WINSPOOL.DRV  
ModLoad: 00000000`61000000 00000000`61055000   QtXml4.dll  
ModLoad: 00000000`66000000 00000000`66045000   QtSvg4.dll  
ModLoad: 00000000`64000000 00000000`640ea000   QtNetwork4.dll  
ModLoad: 00000000`62000000 00000000`62031000   QtSql4.dll  
ModLoad: 00000000`70c40000 00000000`70cc0000   UxTheme.dll  
ModLoad: 00000000`70c20000 00000000`70c33000   dwmapi.dll  
ModLoad: 00000000`753a0000 00000000`75423000   CLBCatQ.DLL  
ModLoad: 00000000`59540000 00000000`5969d000   inkobj.dll  
ModLoad: 00000000`72110000 00000000`72124000   ATL.DLL  
ModLoad: 00000000`00e90000 00000000`01020000   gdiplus.dll  
ModLoad: 00000000`732c0000 00000000`732d6000   CRYPTSP.dll  
ModLoad: 00000000`73270000 00000000`732ab000   RSAENH.dll  
ModLoad: 00000000`72f30000 00000000`72f3e000   RpcRtRemote.dll  
ModLoad: 00000000`59530000 00000000`5953d000   TpcPS.DLL  
ModLoad: 00000000`10000000 00000000`10011000   qsqlmysql4.dll  
ModLoad: 00000000`550e0000 00000000`55677000   libmysql.dll  
ModLoad: 00000000`735f0000 00000000`735f8000   Secur32.dll  
ModLoad: 00000000`72f90000 00000000`72fa0000   nlaapi.dll  
ModLoad: 00000000`72f60000 00000000`72f70000   NAPINSP.dll  
ModLoad: 00000000`72f40000 00000000`72f52000   PNRPNSP.dll  
ModLoad: 00000000`734c0000 00000000`734fc000   MSWSOCK.dll  
ModLoad: 00000000`72ee0000 00000000`72f24000   DNSAPI.dll  
ModLoad: 00000000`72ed0000 00000000`72ed8000   WINRNR.dll  
ModLoad: 00000000`6de50000 00000000`6de56000   rasadhlp.dll  
ModLoad: 00000000`734b0000 00000000`734b5000   WSHTCPIP.dll  
Break-in sent, waiting 30 seconds...  
WARNING: Break-in timed out, suspending.  
         This is usually caused by another thread holding the loader lock  
(1a2c.106c): Wake debugger - code 80000007 (first chance)  
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for KERNELBASE.dll -   
KERNELBASE!RaiseException+0x58:  
74c3c42d c9              leave  
0:000:x86> g  
** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\SYSTEM32\ntdll.dll -   
ntdll!NtWaitForWorkViaWorkerFactory+0xa:  
00000000`76e22bba c3              ret  
0:004> g  
       ^ No runnable debuggees error in 'g'  

3.打开崩溃转储时的.WinDbg日志。

Loading Dump File [C:\Users\onur.ozcelik.BILISIM\Desktop\kmclient3.DMP]  
User Mini Dump File with Full Memory: Only application data is available  

Symbol search path is: E:\Symbols  
Executable search path is:   
Windows 7 Version 7601 (Service Pack 1) MP (12 procs) Free x86 compatible  
Product: WinNt, suite: SingleUserTS  
Machine Name:  
Debug session time: Tue Jul 28 10:46:30.000 2015 (GMT+3)  
System Uptime: 0 days 2:42:56.184  
Process Uptime: 0 days 0:02:46.000  
........................................................  
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -   
eax=00000002 ebx=0000000b ecx=00000000 edx=00000000 esi=00000002 edi=00407c58  
eip=76fd1f46 esp=036ffac4 ebp=036ffc24 iopl=0         nv up ei pl zr na pe nc  
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246  
ntdll!NtWaitForWorkViaWorkerFactory+0x12:  
76fd1f46 83c404          add     esp,4  
0:000> g  
       ^ No runnable debuggees error in 'g'

导致崩溃问题的原因是什么? 任何想法或建议?

1 个答案:

答案 0 :(得分:1)

这只是意味着您的程序中存在错误。没有看到代码很难分辨到哪里。我建议使用coutprintfqDebug()来检测代码运行良好的最后一行。这将为您提供发生错误的区域。这就是我在多线程程序中解决我的bug的方法。我还建议你阅读this