PDA

View Full Version : Drag and drop causes Qt to crash everytime with same segmentation fault



Sajjmon
7th March 2013, 16:57
I got a really strange crash when going from qt4.8 to qt 5.0.1 with dragging and dropping. Everything worked fine with the old qt 4.8 but as soon as I went in to qt 5.0 it always seem to crash when dragging a file over the mainwindow.

So I started a totally clean project, created a layout within the centralwidget and then a widget inside the layout.
The widget tree like this:

Mainwindow - centralWidget - Layout - newWidget

Everytime I drag a file over the window/widgets Qt seems to load a lot of libraries to find a template, sure no problem with that (except that it takes some time). Now comes the strange part, when I drop the file (Note QWidget is totally clean, no special settings at all) the program crashes, this happens everytime and it happens when I drop the file in the window or drag the file outside the window.

It gives me a Segmantation Fault and this disassembler code everytime:


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

System is: Windows 7 x64
Qt version: Qt 5.0.1 with MinGW compiler

Anyone have any idea about this, seems like a Qt bug or I'm just doing something wrong?

Edit:
Tried to build my small project in Release mode and now the drag worked fine but when in Debug mode it crashes all the time, maybe I'm missing some plugin for debugger?
Actually I saw now that I got these messages in Application Output, could they be some kind of reason:

Temporarily disabling breakpoints for unloaded shared library "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\plugins\platforms\q minimald.dll"
Temporarily disabling breakpoints for unloaded shared library "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\plugins\platforms\q windowsd.dll"

amleto
7th March 2013, 22:02
show us code - not assembly!

and also make sure you rebuilt the app properly

Sajjmon
8th March 2013, 08:12
As I said there is no special code parts, I've created a Qt Application in Qt Creator and added a layout and a widget inside of it, everytime I drag a file in to the application it is fine but as soon as I drag it out or drop it everything crashes with that segmentation fault.

I haven't written a single line of code and I can reproduce this everytime with the Qt 5.0.1 MinGW SDK that is on the website.

As you can see nothing more than I've added a layout and a widget with Qt Creator:

mainwindow.ui

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>19</x>
<y>19</y>
<width>351</width>
<height>221</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="dropWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2"/>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>


mainwindow.h

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

private:
Ui::MainWindow *ui;
};

mainwindow.cpp

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}

MainWindow::~MainWindow()
{
delete ui;
}

I can change back to the last 4.8.4 (MinGW) version of Qt and there everything works fine so something is really strange with Qt 5.0.1 (MinGW)...

wysota
8th March 2013, 09:53
Run under a debugger and show us the backtrace. The assembly you posted looks like some part of your operating system or other low-level C code :)

Sajjmon
8th March 2013, 11:59
I've been testing alot with this issue and what I can conclude from the backtrace and my testing is that it has something to do with my ATI drivers. Especially the "../ATI Technologies\HydraVision\HydraDMH.dll" call to QPropertyAnimation, somewhere in there there's some comparison between integers that doesn't work...

When I run the same small test project on my laptop that doesn't have ATI it works as it should. The strange thing is that the program runs with drag and drop if I compile it with Qt 4.8.4 MinGW on both computers.

This is my backtrace:



Thread 6 (Thread 5000.0x4e0):
#0 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#2 0x77bc3352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#3 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#4 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#5 0x77ba9ec5 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 5000.0x5f8):
#0 0x77b8fd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x77274498 in Sleep () from C:\Windows\syswow64\KernelBase.dll
No symbol table info available.
#2 0x76dcd98d in ole32!CoIsOle1Class () from C:\Windows\syswow64\ole32.dll
No symbol table info available.
#3 0x76dcd87a in ole32!CoIsOle1Class () from C:\Windows\syswow64\ole32.dll
No symbol table info available.
#4 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#5 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#6 0x77ba9ec5 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 5000.0xc24):
#0 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#2 0x77bc3352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#3 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#4 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#5 0x77ba9ec5 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 5000.0x1dbc):
#0 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#2 0x77bc3352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#3 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#4 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#5 0x77ba9ec5 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 5000.0x1b04):
#0 0x77b9013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#1 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#2 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
No symbol table info available.
#3 0x77ba9ec5 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 5000.0x10dc):
#0 0x7726ad97 in lstrlenA () from C:\Windows\syswow64\KernelBase.dll
No symbol table info available.
#1 0xabb1fdc7 in ?? ()
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 0x51d63001 in ?? ()
No symbol table info available.
#4 0x7efdb800 in ?? ()
No symbol table info available.
#5 0x75d87a36 in wvsprintfW () from C:\Windows\syswow64\user32.dll
No symbol table info available.
#6 0x12ccd676 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.)

amleto
8th March 2013, 18:35
Have you got qt4 & qt5 on your system? how did you 'move your app' from 4 to 5?

Sajjmon
12th March 2013, 12:33
Have you got qt4 & qt5 on your system? how did you 'move your app' from 4 to 5?

As stated in my first post I have:

System is: Windows 7 x64
Qt version: Qt 5.0.1 with MinGW compiler

The App is a completely new app, created in Qt Creator that ships with Qt 5.0. A layout has been added and inside that a QWidget with the help of the design view of Qt Creator. No code written at all. It ONLY crashes in debug mode, in release mode everything works fine.

It seems to have something to do with my ATI graphic drivers as I don't have any problem with it on any other computer and it always show up in the stacktrace. But the strange thing is that it works with Qt 4.8 so something has to have been done with the drag/drop event functionality in Qt 5 that doesn't comply with the dll below.

This file is the one that crashes apparently: C:\Program Files (x86)\ATI Technologies\HydraVision\HydraDMH.dll

Don't know why though because I have the latest drivers so I don't know how to solve this.

Thanks for your replies.