Results 1 to 7 of 7

Thread: Drag and drop causes Qt to crash everytime with same segmentation fault

  1. #1
    Join Date
    Jun 2012
    Posts
    14

    Default Drag and drop causes Qt to crash everytime with same segmentation fault

    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:

    Qt Code:
    1. Function: lstrlenA
    2. 0x74dcad83 <+0x0006> jge 0x74dcad6d <lstrcpynA+112>
    3. 0x74dcad85 <+0x0008> sti
    4. 0x74dcad86 <+0x0009> roll $0x0,(%edx)
    5. 0x74dcad89 <+0x000c> mov 0x8(%ebp),%eax
    6. 0x74dcad8c <+0x000f> test %eax,%eax
    7. 0x74dcad8e <+0x0011> je 0x74dcadc7 <lstrlenA+74>
    8. 0x74dcad90 <+0x0013> andl $0x0,-0x4(%ebp)
    9. 0x74dcad94 <+0x0017> lea 0x1(%eax),%edx
    10. 0x74dcad97 <+0x001a> mov (%eax),%cl
    11. 0x74dcad99 <+0x001c> inc %eax
    12. 0x74dcad9a <+0x001d> test %cl,%cl
    13. 0x74dcad9c <+0x001f> jne 0x74dcad97 <lstrlenA+26>
    14. 0x74dcad9e <+0x0021> sub %edx,%eax
    15. 0x74dcada0 <+0x0023> movl $0xfffffffe,-0x4(%ebp)
    16. 0x74dcada7 <+0x002a> jmp 0x74dcadc9 <lstrlenA+76>
    17. 0x74dcada9 <+0x002c> mov -0x14(%ebp),%eax
    18. 0x74dcadac <+0x002f> mov (%eax),%eax
    19. 0x74dcadae <+0x0031> mov (%eax),%eax
    20. 0x74dcadb0 <+0x0033> xor %ecx,%ecx
    21. 0x74dcadb2 <+0x0035> cmp $0xc00000fd,%eax
    22. 0x74dcadb7 <+0x003a> setne %cl
    23. 0x74dcadba <+0x003d> mov %ecx,%eax
    24. 0x74dcadbc <+0x003f> ret
    25. 0x74dcadbd <+0x0040> mov -0x18(%ebp),%esp
    26. 0x74dcadc0 <+0x0043> movl $0xfffffffe,-0x4(%ebp)
    27. 0x74dcadc7 <+0x004a> xor %eax,%eax
    28. 0x74dcadc9 <+0x004c> call 0x74df6fc9 <KERNELBASE!IsNLSDefinedString+1209>
    29. 0x74dcadce <+0x0051> ret $0x4
    30. 0x74dcadd1 <+0x0054> int3
    31. 0x74dcadd2 <+0x0055> int3
    32. 0x74dcadd3 <+0x0056> int3
    33. 0x74dcadd4 <+0x0057> int3
    34. 0x74dcadd5 <+0x0058> int3
    35. Function: lstrcmpW
    36. 0x74dcadd6 <+0x0000> mov %edi,%edi
    37. 0x74dcadd8 <+0x0002> push %ebp
    38. 0x74dcadd9 <+0x0003> mov %esp,%ebp
    39. 0x74dcaddb <+0x0005> push %esi
    40. 0x74dcaddc <+0x0006> mov 0xc(%ebp),%esi
    41. 0x74dcaddf <+0x0009> push %edi
    42. 0x74dcade0 <+0x000a> mov 0x8(%ebp),%edi
    43. 0x74dcade3 <+0x000d> push $0xffffffff
    44. 0x74dcade5 <+0x000f> push %esi
    45. 0x74dcade6 <+0x0010> push $0xffffffff
    46. 0x74dcade8 <+0x0012> push %edi
    47. 0x74dcade9 <+0x0013> push $0x0
    48. 0x74dcadeb <+0x0015> push $0x400
    49. 0x74dcadf0 <+0x001a> call 0x74de2e93 <KERNELBASE!CopySid>
    50. 0x74dcadf5 <+0x001f> test %eax,%eax
    51. 0x74dcadf7 <+0x0021> jne 0x74dcae54 <lstrcmpW+126>
    52. 0x74dcadf9 <+0x0023> push $0xffffffff
    To copy to clipboard, switch view to plain text mode 

    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:
    Qt Code:
    1. Temporarily disabling breakpoints for unloaded shared library "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\plugins\platforms\qminimald.dll"
    2. Temporarily disabling breakpoints for unloaded shared library "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\plugins\platforms\qwindowsd.dll"
    To copy to clipboard, switch view to plain text mode 
    Last edited by Sajjmon; 7th March 2013 at 18:03. Reason: More testing

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Drag and drop causes Qt to crash everytime with same segmentation fault

    show us code - not assembly!

    and also make sure you rebuilt the app properly
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Jun 2012
    Posts
    14

    Default Re: Drag and drop causes Qt to crash everytime with same segmentation fault

    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
    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <ui version="4.0">
    3. <class>MainWindow</class>
    4. <widget class="QMainWindow" name="MainWindow">
    5. <property name="geometry">
    6. <rect>
    7. <x>0</x>
    8. <y>0</y>
    9. <width>400</width>
    10. <height>300</height>
    11. </rect>
    12. </property>
    13. <property name="windowTitle">
    14. <string>MainWindow</string>
    15. </property>
    16. <widget class="QWidget" name="centralWidget">
    17. <widget class="QWidget" name="verticalLayoutWidget">
    18. <property name="geometry">
    19. <rect>
    20. <x>19</x>
    21. <y>19</y>
    22. <width>351</width>
    23. <height>221</height>
    24. </rect>
    25. </property>
    26. <layout class="QVBoxLayout" name="verticalLayout">
    27. <item>
    28. <widget class="QWidget" name="dropWidget" native="true">
    29. <layout class="QVBoxLayout" name="verticalLayout_2"/>
    30. </widget>
    31. </item>
    32. </layout>
    33. </widget>
    34. </widget>
    35. <widget class="QMenuBar" name="menuBar">
    36. <property name="geometry">
    37. <rect>
    38. <x>0</x>
    39. <y>0</y>
    40. <width>400</width>
    41. <height>21</height>
    42. </rect>
    43. </property>
    44. </widget>
    45. <widget class="QToolBar" name="mainToolBar">
    46. <attribute name="toolBarArea">
    47. <enum>TopToolBarArea</enum>
    48. </attribute>
    49. <attribute name="toolBarBreak">
    50. <bool>false</bool>
    51. </attribute>
    52. </widget>
    53. <widget class="QStatusBar" name="statusBar"/>
    54. </widget>
    55. <layoutdefault spacing="6" margin="11"/>
    56. <resources/>
    57. <connections/>
    58. </ui>
    To copy to clipboard, switch view to plain text mode 

    mainwindow.h
    Qt Code:
    1. namespace Ui {
    2. class MainWindow;
    3. }
    4.  
    5. class MainWindow : public QMainWindow
    6. {
    7. Q_OBJECT
    8.  
    9. public:
    10. explicit MainWindow(QWidget *parent = 0);
    11. ~MainWindow();
    12.  
    13. private:
    14. Ui::MainWindow *ui;
    15. };
    To copy to clipboard, switch view to plain text mode 

    mainwindow.cpp
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::MainWindow)
    4. {
    5. ui->setupUi(this);
    6. }
    7.  
    8. MainWindow::~MainWindow()
    9. {
    10. delete ui;
    11. }
    To copy to clipboard, switch view to plain text mode 

    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)...

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Drag and drop causes Qt to crash everytime with same segmentation fault

    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
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jun 2012
    Posts
    14

    Default Re: Drag and drop causes Qt to crash everytime with same segmentation fault

    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:

    Qt Code:
    1. Thread 6 (Thread 5000.0x4e0):
    2. #0 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
    3. No symbol table info available.
    4. #1 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
    5. No symbol table info available.
    6. #2 0x77bc3352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
    7. No symbol table info available.
    8. #3 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
    9. No symbol table info available.
    10. #4 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    11. No symbol table info available.
    12. #5 0x77ba9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    13. No symbol table info available.
    14. #6 0x00000000 in ?? ()
    15. No symbol table info available.
    16.  
    17. Thread 5 (Thread 5000.0x5f8):
    18. #0 0x77b8fd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
    19. No symbol table info available.
    20. #1 0x77274498 in Sleep () from C:\Windows\syswow64\KernelBase.dll
    21. No symbol table info available.
    22. #2 0x76dcd98d in ole32!CoIsOle1Class () from C:\Windows\syswow64\ole32.dll
    23. No symbol table info available.
    24. #3 0x76dcd87a in ole32!CoIsOle1Class () from C:\Windows\syswow64\ole32.dll
    25. No symbol table info available.
    26. #4 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
    27. No symbol table info available.
    28. #5 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    29. No symbol table info available.
    30. #6 0x77ba9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    31. No symbol table info available.
    32. #7 0x00000000 in ?? ()
    33. No symbol table info available.
    34.  
    35. Thread 4 (Thread 5000.0xc24):
    36. #0 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
    37. No symbol table info available.
    38. #1 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
    39. No symbol table info available.
    40. #2 0x77bc3352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
    41. No symbol table info available.
    42. #3 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
    43. No symbol table info available.
    44. #4 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    45. No symbol table info available.
    46. #5 0x77ba9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    47. No symbol table info available.
    48. #6 0x00000000 in ?? ()
    49. No symbol table info available.
    50.  
    51. Thread 3 (Thread 5000.0x1dbc):
    52. #0 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
    53. No symbol table info available.
    54. #1 0x77b91f26 in ntdll!LdrQueryProcessModuleInformation () from C:\Windows\system32\ntdll.dll
    55. No symbol table info available.
    56. #2 0x77bc3352 in ntdll!RtlCreateTagHeap () from C:\Windows\system32\ntdll.dll
    57. No symbol table info available.
    58. #3 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
    59. No symbol table info available.
    60. #4 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    61. No symbol table info available.
    62. #5 0x77ba9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    63. No symbol table info available.
    64. #6 0x00000000 in ?? ()
    65. No symbol table info available.
    66.  
    67. Thread 2 (Thread 5000.0x1b04):
    68. #0 0x77b9013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation () from C:\Windows\system32\ntdll.dll
    69. No symbol table info available.
    70. #1 0x76fa33aa in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll
    71. No symbol table info available.
    72. #2 0x77ba9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    73. No symbol table info available.
    74. #3 0x77ba9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
    75. No symbol table info available.
    76. #4 0x00000000 in ?? ()
    77. No symbol table info available.
    78.  
    79. Thread 1 (Thread 5000.0x10dc):
    80. #0 0x7726ad97 in lstrlenA () from C:\Windows\syswow64\KernelBase.dll
    81. No symbol table info available.
    82. #1 0xabb1fdc7 in ?? ()
    83. No symbol table info available.
    84. #2 0x00000100 in ?? ()
    85. 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"}
    86. 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}
    87. 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}}
    88. #3 0x51d63001 in ?? ()
    89. No symbol table info available.
    90. #4 0x7efdb800 in ?? ()
    91. No symbol table info available.
    92. #5 0x75d87a36 in wvsprintfW () from C:\Windows\syswow64\user32.dll
    93. No symbol table info available.
    94. #6 0x12ccd676 in HydraDMH!HookMessages () from C:\Program Files (x86)\ATI Technologies\HydraVision\HydraDMH.dll
    95. No symbol table info available.
    96. warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
    97.  
    98. warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
    99.  
    100. warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
    101.  
    102. warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
    103.  
    104. warning: (Internal error: pc 0xff in read in psymtab, but not in symtab.)
    105.  
    106. warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Drag and drop causes Qt to crash everytime with same segmentation fault

    Have you got qt4 & qt5 on your system? how did you 'move your app' from 4 to 5?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  7. #7
    Join Date
    Jun 2012
    Posts
    14

    Default Re: Drag and drop causes Qt to crash everytime with same segmentation fault

    Quote Originally Posted by amleto View Post
    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.

Similar Threads

  1. Crash-Segmentation fault
    By poporacer in forum Newbie
    Replies: 4
    Last Post: 13th December 2010, 00:13
  2. QPainter crash when generating icon after drag-drop
    By craigTheBrit in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2010, 09:52
  3. Segmentation Fault
    By freekill in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2010, 16:31
  4. QListWidgetItem subclass - Crash program in drag/drop
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2009, 10:24
  5. (Another) segmentation fault
    By Lebowski in forum Qt Programming
    Replies: 27
    Last Post: 6th April 2006, 07:33

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.