从 qt4.8 拖放到 qt 5.0.1 时,我遇到了一个非常奇怪的崩溃。旧的 qt 4.8 一切正常,但是当我进入 qt 5.0 时,在主窗口上拖动文件时似乎总是崩溃。
所以我开始了一个完全干净的项目,在中央小部件中创建了一个布局,然后在布局中创建了一个小部件。像这样的小部件树:
主窗口 - centralWidget - 布局 - newWidget
每次我在窗口上拖动文件时,Qt 似乎都会加载很多库来查找模板,这肯定没有问题(除了需要一些时间)。现在出现了奇怪的部分,当我放下文件时(注意没有 QWidget 不可放置,根本没有特殊设置)程序崩溃,每次都会发生这种情况,当我将文件放在窗口中或将文件拖到窗口外时会发生这种情况.
它每次都给我一个分段错误和这个反汇编代码:
Function: lstrlenA
0x74dcad83 <+0x0006> jge 0x74dcad6d <lstrcpynA+112>
0x74dcad85 <+0x0008> sti
0x74dcad86 <+0x0009> roll $0x0,(%edx)
0x74dcad89 <+0x000c> mov 0x8(%ebp),%eax
0x74dcad8c <+0x000f> test %eax,%eax
0x74dcad8e <+0x0011> je 0x74dcadc7 <lstrlenA+74>
0x74dcad90 <+0x0013> andl $0x0,-0x4(%ebp)
0x74dcad94 <+0x0017> lea 0x1(%eax),%edx
0x74dcad97 <+0x001a> mov (%eax),%cl
0x74dcad99 <+0x001c> inc %eax
0x74dcad9a <+0x001d> test %cl,%cl
0x74dcad9c <+0x001f> jne 0x74dcad97 <lstrlenA+26>
0x74dcad9e <+0x0021> sub %edx,%eax
0x74dcada0 <+0x0023> movl $0xfffffffe,-0x4(%ebp)
0x74dcada7 <+0x002a> jmp 0x74dcadc9 <lstrlenA+76>
0x74dcada9 <+0x002c> mov -0x14(%ebp),%eax
0x74dcadac <+0x002f> mov (%eax),%eax
0x74dcadae <+0x0031> mov (%eax),%eax
0x74dcadb0 <+0x0033> xor %ecx,%ecx
0x74dcadb2 <+0x0035> cmp $0xc00000fd,%eax
0x74dcadb7 <+0x003a> setne %cl
0x74dcadba <+0x003d> mov %ecx,%eax
0x74dcadbc <+0x003f> ret
0x74dcadbd <+0x0040> mov -0x18(%ebp),%esp
0x74dcadc0 <+0x0043> movl $0xfffffffe,-0x4(%ebp)
0x74dcadc7 <+0x004a> xor %eax,%eax
0x74dcadc9 <+0x004c> call 0x74df6fc9 <KERNELBASE!IsNLSDefinedString+1209>
0x74dcadce <+0x0051> ret $0x4
0x74dcadd1 <+0x0054> int3
0x74dcadd2 <+0x0055> int3
0x74dcadd3 <+0x0056> int3
0x74dcadd4 <+0x0057> int3
0x74dcadd5 <+0x0058> int3
Function: lstrcmpW
0x74dcadd6 <+0x0000> mov %edi,%edi
0x74dcadd8 <+0x0002> push %ebp
0x74dcadd9 <+0x0003> mov %esp,%ebp
0x74dcaddb <+0x0005> push %esi
0x74dcaddc <+0x0006> mov 0xc(%ebp),%esi
0x74dcaddf <+0x0009> push %edi
0x74dcade0 <+0x000a> mov 0x8(%ebp),%edi
0x74dcade3 <+0x000d> push $0xffffffff
0x74dcade5 <+0x000f> push %esi
0x74dcade6 <+0x0010> push $0xffffffff
0x74dcade8 <+0x0012> push %edi
0x74dcade9 <+0x0013> push $0x0
0x74dcadeb <+0x0015> push $0x400
0x74dcadf0 <+0x001a> call 0x74de2e93 <KERNELBASE!CopySid>
0x74dcadf5 <+0x001f> test %eax,%eax
0x74dcadf7 <+0x0021> jne 0x74dcae54 <lstrcmpW+126>
0x74dcadf9 <+0x0023> push $0xffffffff
系统是:Windows 7 x64 Qt 版本:Qt 5.0.1 with MinGW compiler
任何人对此有任何想法,似乎是一个 Qt 错误或?
编辑:尝试在发布模式下构建小应用程序,它工作正常,所以它与编译器有关。这是完整的堆栈跟踪:
Thread 6 (Thread 5248.0x1d48):
#0 0x77121f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x77121f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#2 0x77153352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#3 0x75ea33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#4 0x77139ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#5 0x77139ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#6 0x00000000 in ?? ()
No symbol table info available.
Thread 5 (Thread 5248.0x1278):
#0 0x7711fd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x74dd4498 in Sleep () from C:\Windows\syswow64\KernelBase.dll
No symbol table info available.
#2 0x7620d98d in ole32!CoIsOle1Class () from C:\Windows\syswow64\ole32.dll
No symbol table info available.
#3 0x7620d87a in ole32!CoIsOle1Class () from C:\Windows\syswow64\ole32.dll
No symbol table info available.
#4 0x75ea33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#5 0x77139ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#6 0x77139ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#7 0x00000000 in ?? ()
No symbol table info available.
Thread 4 (Thread 5248.0x1978):
#0 0x77121f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x77121f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#2 0x77153352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#3 0x75ea33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#4 0x77139ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#5 0x77139ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#6 0x00000000 in ?? ()
No symbol table info available.
Thread 3 (Thread 5248.0x1d90):
#0 0x77121f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x77121f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#2 0x77153352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#3 0x75ea33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#4 0x77139ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#5 0x77139ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#6 0x00000000 in ?? ()
No symbol table info available.
Thread 2 (Thread 5248.0x84):
#0 0x7712013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x75ea33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#2 0x77139ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#3 0x77139ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#4 0x00000000 in ?? ()
No symbol table info available.
Thread 1 (Thread 5248.0x1a10):
#0 0x74dcad97 in lstrlenA () from C:\Windows\syswow64\KernelBase.dll
No symbol table info available.
#1 0x525bb9b9 in D3DStripShader () from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\D3DCompiler_43.dll
No symbol table info available.
#2 0x00000100 in ?? ()
qt_meta_stringdata_QPropertyAnimation = {data = {{ref = {atomic = {_q_value = -1}}, size = 18, alloc = 0, capacityReserved = 0, offset = 48, static shared_null = {{ref = {atomic = {_q_value = -1}}, size = 0, alloc = 0, capacityReserved = 0, offset = 16, static shared_null = <same as static member of an already seen type>}, {ref = {atomic = {_q_value = 0}}, size = 0, alloc = 0, capacityReserved = 0, offset = 0, static shared_null = <same as static member of an already seen type>}}}, {ref = {atomic = {_q_value = -1}}, size = 12, alloc = 0, capacityReserved = 0, offset = 51, static shared_null = {{ref = {atomic = {_q_value = -1}}, size = 0, alloc = 0, capacityReserved = 0, offset = 16, static shared_null = <same as static member of an already seen type>}, {ref = {atomic = {_q_value = 0}}, size = 0, alloc = 0, capacityReserved = 0, offset = 0, static shared_null = <same as static member of an already seen type>}}}, {ref = {atomic = {_q_value = -1}}, size = 12, alloc = 0, capacityReserved = 0, offset = 48, static shared_null = {{ref = {atomic = {_q_value = -1}}, size = 0, alloc = 0, capacityReserved = 0, offset = 16, static shared_null = <same as static member of an already seen type>}, {ref = {atomic = {_q_value = 0}}, size = 0, alloc = 0, capacityReserved = 0, offset = 0, static shared_null = <same as static member of an already seen type>}}}}, stringdata = "QPropertyAnimation\000propertyName\000targetObject\000"}
qt_meta_data_QPropertyAnimation = {7, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 0, 1, 12, 610563, 2, 39, 610563, 0}
QPropertyAnimation::staticMetaObject = {d = {superdata = 0x6bae8ff0, stringdata = 0x6bae9a80, data = 0x6bae9ae0, static_metacall = 0x6b788a4e <QPropertyAnimation::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}
#3 0x19fe0000 in ?? ()
No symbol table info available.
#4 0x7efdb800 in ?? ()
No symbol table info available.
#5 0x76457a36 in wvsprintfW () from C:\Windows\syswow64\user32.dll
No symbol table info available.
#6 0x003bd676 in HydraDMH!HookMessages () from C:\Program Files (x86)\ATI Technologies\HydraVision\HydraDMH.dll
No symbol table info available.
warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
编辑 2:经过大量测试后,我发现这似乎是我的 ATI 驱动程序的问题,当程序崩溃时,dll“ATI Technologies\HydraVision\HydraDMH.dll”总是在那里。我在没有 ATI 的笔记本电脑上测试了同一个小项目,它运行良好。只有在调试模式下才会发生崩溃。
真的不知道该去哪里,但拖放在 Qt 4.8.4 中有效,所以这可能是 Qt 5.0.1 中的一个问题。