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

QtCreator SIGSEGV in QString copy ctor



  • Hi,

    I am using MSYS2 environment, and after recent update I run into troubles opening qtcreator. I reported that as an issue in the MSYS2 repository on GitHub. However I decided to compile Qt5 (5.14.2)/QtCreator (4.12.1) on my own and as a result I have build with debug symbols which allows me to know exactly where SIGSEGV is occuring.

    I am really surprised that it changed location from some system library into QString copy ctor.

    Here is result of running gdb --args qtcreator -noload all

    Thread 1 received signal SIGSEGV, Segmentation fault.
    QString::QString (other=..., this=0x6df7d4)
        at ../../../../include/QtCore/../../src/corelib/text/qstring.h:1051
    1051    { Q_ASSERT(&other != this); d->ref.ref(); }
    (gdb) bt
    #0  QString::QString (other=..., this=0x6df7d4)
        at ../../../../include/QtCore/../../src/corelib/text/qstring.h:1051
    #1  QWindowsContext::createDummyWindow(QString const&, wchar_t const*, long ( stdcall*)(HWND__*, unsigned int, unsigned int, long), unsigned long) (
        this=0x885614, classNameIn=...,
        windowName=windowName@entry=0x6df88a44 <QWindowsComBaseDLL::init()::{lambda()#1}::operator()() const::qstring_literal+1252> L"OpenGLDummyWindow",
        wndProc=0x771c82e0 <ntdll!NtdllDefWindowProc_W>, wndProc@entry=0x0,
        style=style@entry=100663296) at qwindowscontext.cpp:881
    #2  0x6df1bd85 in createDummyGLWindow () at qwindowsglcontext.cpp:799
    #3  QWindowsGLContext::QWindowsGLContext (this=0x88ed80, staticContext=0x3,
        context=0x6df1ef47 <QOpenGLStaticContext::createContext(QOpenGLContext*)+39>) at qwindowsglcontext.cpp:1132
    #4  0x02066053 in cur_arrow_bits () from C:\msys2\mingw32\bin\Qt5Gui.dll
    #5  0x00000003 in ?? ()
    #6  0x6df1ef47 in QOpenGLStaticContext::createContext (this=0x88ea60,
        context=0x88ea60) at qwindowsglcontext.cpp:219
    #7  0x6ded17bd in QWindowsIntegration::createPlatformOpenGLContext (
        this=<optimized out>, context=0x88ea60) at qwindowsintegration.cpp:469
    #8  0x01b97fc6 in QOpenGLContext::create (this=0x88ea60)
        at C:/msys2/home/ADMIN/qt5/src/i686/qtbase/src/gui/kernel/qguiapplication_p.h:109
    #9  0x01b4f10b in QGuiApplicationPrivate::init (this=0x854510)
        at kernel/qguiapplication.cpp:1633
    #10 0x01062b8d in QApplicationPrivate::init (this=0x854510)
        at kernel/qapplication.cpp:539
    #11 0x01062d1c in QApplication::QApplication (this=0x6dfde0,
        argc=@0x6dfd48: 3, argv=0x873768, _internal=331266)
        at kernel/qapplication.cpp:527
    #12 0x00401b46 in ?? ()
    #13 0x00407b2c in ?? ()
    #14 0x0040bf84 in ?? ()
    #15 0x00000095 in ?? ()
    #16 0x00000000 in ?? ()
    

    I have some problems in the past but usually it was caused by missing library or wrong version of some dependency. This time I don't have a clue what is causing such problem. I am using GCC 10.1 to compile both QtC and Qt5. Any guides what should I do next? Thank you in advance.

    EDIT:
    If I run any other Qt5 based UI application there is no problem, only with QtCreator.



  • Cleaning PATH variable and MSYS2 Environment solve that. I think that it might be caused by different version of some library that was used (because I had a lot of paths in the PATH), but for now it is over and I am happy with that.


Log in to reply