Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtCreator crashing in designer mode



  • Hello,

    I wanted to learn Qt, so I have installed QtCreator 4.12.0 from the ArchLinux repos. However, when I want to add (or manipulate) elements in a QML file in the design mode, QtCreator crashes on a null pointer dereference. Would you kindly help me determine if this is a Qt bug or a misconfiguration on my side?

    Thanks!

    The steps to reproduce are simple:

    1. Create a new project - QtQuick application, scroll templateScreenshot_20200430_164612.png
      Choose Qt version (I tried both 5.12 and 5.14), leave the rest of the options to their defaults
    2. Switch to the design mode and try to drag and drop a QtQuick positioner in between the ApplicationWindow and the ScrollView: Screenshot_20200430_164845.png
    3. QtCreator crashes every single time on a null pointer dereference. The positioner can sometimes be added elsewhere into the hierarchy but when changing the hierarchy order later on, QtCreator crashes.

    GDB log:

    $ gdb qtcreator
    GNU gdb (GDB) 9.1
    Copyright (C) 2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "x86_64-pc-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
    
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from qtcreator...
    (No debugging symbols found in qtcreator)
    (gdb) run
    Starting program: /usr/bin/qtcreator 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/usr/lib/libthread_db.so.1".
    [New Thread 0x7ffff1b51700 (LWP 233044)]
    [New Thread 0x7fffea381700 (LWP 233045)]
    [New Thread 0x7fffe9b80700 (LWP 233046)]
    [New Thread 0x7fffe937f700 (LWP 233047)]
    [New Thread 0x7fffe8b7e700 (LWP 233048)]
    [New Thread 0x7fffdaf3a700 (LWP 233049)]
    [New Thread 0x7fff845c1700 (LWP 233050)]
    [Detaching after fork from child process 233051]
    [Thread 0x7fff845c1700 (LWP 233050) exited]
    [New Thread 0x7fff83dc0700 (LWP 233052)]
    [Detaching after fork from child process 233053]
    [New Thread 0x7fff835bf700 (LWP 233054)]
    [New Thread 0x7fff82dbe700 (LWP 233055)]
    [Detaching after fork from child process 233056]
    [Detaching after fork from child process 233058]
    [Detaching after fork from child process 233059]
    [Detaching after fork from child process 233060]
    [Detaching after fork from child process 233062]
    [Detaching after fork from child process 233063]
    [Detaching after fork from child process 233064]
    [Detaching after fork from child process 233066]
    [Detaching after fork from child process 233067]
    [Detaching after fork from child process 233068]
    [Detaching after fork from child process 233070]
    [Detaching after fork from child process 233071]
    [Detaching after fork from child process 233072]
    [Detaching after fork from child process 233074]
    [Detaching after fork from child process 233075]
    [Detaching after fork from child process 233076]
    [Detaching after fork from child process 233078]
    [Detaching after fork from child process 233079]
    [Detaching after fork from child process 233080]
    [Detaching after fork from child process 233082]
    [Detaching after fork from child process 233083]
    [Detaching after fork from child process 233084]
    [Detaching after fork from child process 233086]
    [Detaching after fork from child process 233087]
    [Detaching after fork from child process 233088]
    [Detaching after fork from child process 233089]
    [Detaching after fork from child process 233090]
    [Detaching after fork from child process 233091]
    [Detaching after fork from child process 233093]
    [Detaching after fork from child process 233096]
    [Detaching after fork from child process 233099]
    [Detaching after fork from child process 233102]
    [Detaching after fork from child process 233105]
    [Detaching after fork from child process 233108]
    [Detaching after fork from child process 233112]
    [Detaching after fork from child process 233115]
    [Detaching after fork from child process 233118]
    [Detaching after fork from child process 233120]
    [Detaching after fork from child process 233123]
    [Detaching after fork from child process 233126]
    [Detaching after fork from child process 233129]
    [Detaching after fork from child process 233132]
    [Detaching after fork from child process 233135]
    [Detaching after fork from child process 233138]
    [Detaching after fork from child process 233141]
    [Detaching after fork from child process 233144]
    [Detaching after fork from child process 233149]
    [New Thread 0x7fff845c1700 (LWP 233154)]
    [Thread 0x7fff845c1700 (LWP 233154) exited]
    [Detaching after fork from child process 233248]
    [New Thread 0x7fff845c1700 (LWP 233289)]
    [New Thread 0x7fff81170700 (LWP 233290)]
    [Thread 0x7fff81170700 (LWP 233290) exited]
    [Thread 0x7fff845c1700 (LWP 233289) exited]
    SOFT ASSERT: "node" in file ../../../../qt-creator-opensource-src-4.12.0/src/plugins/android/androidextralibrarylistmodel.cpp, line 90
    [New Thread 0x7fff845c1700 (LWP 233291)]
    [New Thread 0x7fff81170700 (LWP 233292)]
    [Thread 0x7fff81170700 (LWP 233292) exited]
    [New Thread 0x7fff81170700 (LWP 233293)]
    [New Thread 0x7fff808b6700 (LWP 233294)]
    [Thread 0x7fff808b6700 (LWP 233294) exited]
    [Thread 0x7fff81170700 (LWP 233293) exited]
    SOFT ASSERT: "node" in file ../../../../qt-creator-opensource-src-4.12.0/src/plugins/android/androidextralibrarylistmodel.cpp, line 90
    [New Thread 0x7fff81170700 (LWP 233298)]
    [New Thread 0x7fff808b6700 (LWP 233299)]
    [New Thread 0x7fff81bfe700 (LWP 233300)]
    [New Thread 0x7fff63fff700 (LWP 233301)]
    [New Thread 0x7fff637fe700 (LWP 233302)]
    [Thread 0x7fff808b6700 (LWP 233299) exited]
    [Thread 0x7fff81bfe700 (LWP 233300) exited]
    [Detaching after fork from child process 233303]
    Info: creating stash file /home/mike/Data/Projects/Qt5/build-TEST4-Android_for_armeabi_v7a_Clang_Qt_5_12_8_qt5-Debug/.qmake.stash
    [New Thread 0x7fff81bfe700 (LWP 233306)]
    [Thread 0x7fff81bfe700 (LWP 233306) exited]
    [Detaching after fork from child process 233307]
    [Detaching after fork from child process 233310]
    [New Thread 0x7fff81bfe700 (LWP 233311)]
    [Thread 0x7fff81bfe700 (LWP 233311) exited]
    [Detaching after fork from child process 233312]
    [Detaching after fork from child process 233315]
    [Detaching after fork from child process 233318]
    [New Thread 0x7fff81bfe700 (LWP 233319)]
    [Detaching after fork from child process 233320]
    [Detaching after fork from child process 233321]
    [New Thread 0x7fff808b6700 (LWP 233322)]
    [Detaching after fork from child process 233323]
    [New Thread 0x7fff62ffd700 (LWP 233325)]
    [Thread 0x7fff62ffd700 (LWP 233325) exited]
    [Detaching after fork from child process 233326]
    SOFT ASSERT: "node" in file ../../../../qt-creator-opensource-src-4.12.0/src/plugins/android/androidextralibrarylistmodel.cpp, line 90
    [New Thread 0x7fff62ffd700 (LWP 233328)]
    [Thread 0x7fff62ffd700 (LWP 233328) exited]
    [Thread 0x7fff808b6700 (LWP 233322) exited]
    [New Thread 0x7fff808b6700 (LWP 233329)]
    [New Thread 0x7fff62ffd700 (LWP 233330)]
    [Thread 0x7fff62ffd700 (LWP 233330) exited]
    [New Thread 0x7fff62ffd700 (LWP 233331)]
    [Thread 0x7fff62ffd700 (LWP 233331) exited]
    [New Thread 0x7fff62ffd700 (LWP 233332)]
    [Thread 0x7fff62ffd700 (LWP 233332) exited]
    [New Thread 0x7fff62ffd700 (LWP 233333)]
    [Thread 0x7fff62ffd700 (LWP 233333) exited]
    [New Thread 0x7fff62ffd700 (LWP 233334)]
    [Thread 0x7fff62ffd700 (LWP 233334) exited]
    [New Thread 0x7fff62ffd700 (LWP 233335)]
    [Thread 0x7fff62ffd700 (LWP 233335) exited]
    [New Thread 0x7fff62ffd700 (LWP 233336)]
    [New Thread 0x7fff627fc700 (LWP 233337)]
    [New Thread 0x7fff617bb700 (LWP 233338)]
    [New Thread 0x7fff60d7b700 (LWP 233341)]
    [Detaching after fork from child process 233342]
    [Detaching after fork from child process 233343]
    [Detaching after fork from child process 233344]
    [New Thread 0x7fff4b9ff700 (LWP 233351)]
    PropertyEditor: invalid node for setup
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    [New Thread 0x7fff49dbe700 (LWP 233354)]
    [New Thread 0x7fff48b7d700 (LWP 233355)]
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    [Thread 0x7fff4b9ff700 (LWP 233351) exited]
    [Thread 0x7fff49dbe700 (LWP 233354) exited]
    [Thread 0x7fff48b7d700 (LWP 233355) exited]
    [New Thread 0x7fff48b7d700 (LWP 233366)]
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    void QmlDesigner::readSharedMemory(qint32, QmlDesigner::ImageContainer&) Not able to create image: 0 0 0
    [New Thread 0x7fff49dbe700 (LWP 233375)]
    [New Thread 0x7fff4b9ff700 (LWP 233384)]
    PropertyEditor: invalid node for setup
    Both point size and pixel size set. Using pixel size.
    Both point size and pixel size set. Using pixel size.
    [Thread 0x7fff81bfe700 (LWP 233319) exited]
    [Thread 0x7fff81170700 (LWP 233298) exited]
    [Thread 0x7fff808b6700 (LWP 233329) exited]
    [Thread 0x7fff63fff700 (LWP 233301) exited]
    [Thread 0x7fff637fe700 (LWP 233302) exited]
    [Thread 0x7fff49dbe700 (LWP 233375) exited]
    PropertyEditor: invalid node for setup
    --Type <RET> for more, q to quit, c to continue without paging--c
    
    Thread 1 "qtcreator" received signal SIGSEGV, Segmentation fault.
    0x00007ffff7779e00 in QWidget::window() const () from /usr/lib/libQt5Widgets.so.5
    (gdb) i s
    #0  0x00007ffff7779e00 in QWidget::window() const () from /usr/lib/libQt5Widgets.so.5
    #1  0x00007fffb9c6812a in ?? () from /usr/lib/qtcreator/plugins/libQmlDesigner.so
    #2  0x00007ffff7a349ea in QTreeView::drawRow(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const () from /usr/lib/libQt5Widgets.so.5
    #3  0x00007ffff7a3a95b in QTreeView::drawTree(QPainter*, QRegion const&) const ()
       from /usr/lib/libQt5Widgets.so.5
    #4  0x00007ffff7a3aec9 in QTreeViewPrivate::renderTreeToPixmapForAnimation(QRect const&) const ()
       from /usr/lib/libQt5Widgets.so.5
    #5  0x00007ffff7a3c7fd in QTreeViewPrivate::prepareAnimatedOperation(int, QAbstractAnimation::Direction) () from /usr/lib/libQt5Widgets.so.5
    #6  0x00007ffff7a3ccab in QTreeViewPrivate::expand(int, bool) () from /usr/lib/libQt5Widgets.so.5
    #7  0x00007ffff7a3cea1 in QTreeView::expand(QModelIndex const&) () from /usr/lib/libQt5Widgets.so.5
    #8  0x00007fffb9c5cf04 in ?? () from /usr/lib/qtcreator/plugins/libQmlDesigner.so
    #9  0x00007fffb9c5ddf9 in ?? () from /usr/lib/qtcreator/plugins/libQmlDesigner.so
    #10 0x00007ffff6b27ada in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
    #11 0x00007ffff774f352 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
       from /usr/lib/libQt5Widgets.so.5
    #12 0x00007ffff7758829 in QApplication::notify(QObject*, QEvent*) ()
       from /usr/lib/libQt5Widgets.so.5
    #13 0x00007ffff6afa4f2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
       from /usr/lib/libQt5Core.so.5
    #14 0x00007ffff6afcd56 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
       from /usr/lib/libQt5Core.so.5
    #15 0x00007ffff6b53244 in ?? () from /usr/lib/libQt5Core.so.5
    #16 0x00007ffff511e6be in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
    --Type <RET> for more, q to quit, c to continue without paging--
    #17 0x00007ffff5120531 in ?? () from /usr/lib/libglib-2.0.so.0
    #18 0x00007ffff5120571 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
    #19 0x00007ffff6b52890 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
    #20 0x00007ffff6af905c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
       from /usr/lib/libQt5Core.so.5
    #21 0x00007ffff6b01066 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
    #22 0x000055555555e8d3 in ?? ()
    #23 0x00007ffff648f023 in __libc_start_main () from /usr/lib/libc.so.6
    #24 0x000055555555ed7e in ?? ()
    (gdb) disass
    Dump of assembler code for function _ZNK7QWidget6windowEv:
    => 0x00007ffff7779e00 <+0>:     mov    0x8(%rdi),%rax
       0x00007ffff7779e04 <+4>:     mov    0x10(%rax),%rdx
       0x00007ffff7779e08 <+8>:     mov    0x28(%rdi),%rax
       0x00007ffff7779e0c <+12>:    testb  $0x1,0xc(%rax)
       0x00007ffff7779e10 <+16>:    jne    0x7ffff7779e48 <_ZNK7QWidget6windowEv+72>
       0x00007ffff7779e12 <+18>:    test   %rdx,%rdx
       0x00007ffff7779e15 <+21>:    jne    0x7ffff7779e25 <_ZNK7QWidget6windowEv+37>
       0x00007ffff7779e17 <+23>:    jmp    0x7ffff7779e48 <_ZNK7QWidget6windowEv+72>
       0x00007ffff7779e19 <+25>:    nopl   0x0(%rax)
       0x00007ffff7779e20 <+32>:    test   %rdx,%rdx
       0x00007ffff7779e23 <+35>:    je     0x7ffff7779e40 <_ZNK7QWidget6windowEv+64>
       0x00007ffff7779e25 <+37>:    mov    %rdx,%rax
       0x00007ffff7779e28 <+40>:    mov    0x8(%rdx),%rdx
       0x00007ffff7779e2c <+44>:    mov    0x28(%rax),%rcx
       0x00007ffff7779e30 <+48>:    mov    0x10(%rdx),%rdx
       0x00007ffff7779e34 <+52>:    testb  $0x1,0xc(%rcx)
       0x00007ffff7779e38 <+56>:    je     0x7ffff7779e20 <_ZNK7QWidget6windowEv+32>
       0x00007ffff7779e3a <+58>:    retq   
       0x00007ffff7779e3b <+59>:    nopl   0x0(%rax,%rax,1)
       0x00007ffff7779e40 <+64>:    retq   
       0x00007ffff7779e41 <+65>:    nopl   0x0(%rax)
       0x00007ffff7779e48 <+72>:    mov    %rdi,%rax
       0x00007ffff7779e4b <+75>:    retq   
    End of assembler dump.
    (gdb) i r
    rax            0x0                 0
    rbx            0x7fffffffd630      140737488344624
    rcx            0x7fffffffda90      140737488345744
    rdx            0x0                 0
    rsi            0x7fffffffd340      140737488343872
    rdi            0x0                 0
    rbp            0x7fffffffd3e0      0x7fffffffd3e0
    rsp            0x7fffffffd388      0x7fffffffd388
    r8             0x7fffffffda90      140737488345744
    r9             0x7ffff75dcd58      140737343507800
    r10            0x7fffffffd290      140737488343696
    r11            0x7ffff65fbcf0      140737326857456
    r12            0x7fffffffd5d0      140737488344528
    r13            0x7fffffffd3b0      140737488343984
    r14            0x7fffffffd930      140737488345392
    r15            0x0                 0
    rip            0x7ffff7779e00      0x7ffff7779e00 <QWidget::window() const>
    eflags         0x10202             [ IF RF ]
    cs             0x33                51
    ss             0x2b                43
    ds             0x0                 0
    es             0x0                 0
    fs             0x0                 0
    gs             0x0                 0
    (gdb) 
    
    

  • Lifetime Qt Champion

    Hi @MikeD,

    I tried to reproduce your problem on Ubuntu 18.04, with Creator 4.12.0 from the Qt online installer.

    I didn't manage to reproduce the crash. But I used a Desktop kit, maybe that's part of the problem?

    Anyway, crashes are worth to be reported on bugreports.qt.io/QTCREATORBUG (please add a link to the report here so others can follow later).

    Thanks!



  • Done as you suggested. https://bugreports.qt.io/browse/QTCREATORBUG-23976

    What do you mean by Desktop kit?


  • Lifetime Qt Champion

    @MikeD said in QtCreator crashing in designer mode:

    What do you mean by Desktop kit?

    A compiler and Qt version to compile your app to directly run on a PC, in contrast to cross compiling for an embedded device or smartphone.

    From your path build-TEST4-Android_for_armeabi_v7a_Clang_Qt_5_12_8_qt5-Debug/ I guess you're doing Android development.

    Regards



  • Oh, right, thanks. No, it crashes with a desktop kit too.



  • Does not happen to me (KDE Neon, QtCreator 4.12.0 from online installer). However the QML designer is very buggy in general. I get crashes several times a day when using it since forever. And the preview doesn't work very well anyway.. Try writing QML by hand and use QML Live for preview:
    https://doc.qt.io/QMLLive/index.html


Log in to reply