Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt6 application Crash on startup on Linux

Qt6 application Crash on startup on Linux

Scheduled Pinned Locked Moved Solved Qt 6
16 Posts 5 Posters 3.3k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nitingera
    wrote on last edited by
    #1

    We are porting an application from Qt 4.8.6 to Qt 6.2. The application is running fine on Windows and Mac but crashes on startup on Linux (CentOS 7)
    The call stack with gdb is as follows

    1 QMetaType::canConvert qmetatype.cpp 2415 0x7fc394f79754
    2 QVariant::canConvert qvariant.h 252 0x7fc394fe0916
    3 QVariant::convert qvariant.cpp 2054 0x7fc394fdf48c
    4 parseColorValue qcssparser.cpp 714 0x7fc396a7e58a
    5 parseBrushValue qcssparser.cpp 814 0x7fc396a7f0aa
    6 QCss::Declaration::brushValue qcssparser.cpp 1491 0x7fc396a82c9c
    7 QCss::ValueExtractor::extractBackground qcssparser.cpp 1073 0x7fc396a80e11
    8 QRenderRule::QRenderRule qstylesheetstyle.cpp 986 0x7fc3973d463c
    9 QStyleSheetStyle::renderRule qstylesheetstyle.cpp 1854 0x7fc3973d965c
    10 QStyleSheetStyle::setGeometry qstylesheetstyle.cpp 2571 0x7fc3973db69f
    11 QStyleSheetStyle::polish qstylesheetstyle.cpp 2884 0x7fc3973dd8db
    12 QWidget::event qwidget.cpp 8759 0x7fc39734a538
    13 QLineEdit::event qlineedit.cpp 1510 0x7fc3975111f1
    14 QApplicationPrivate::notify_helper qapplication.cpp 3396 0x7fc3972cc110
    15 QApplication::notify qapplication.cpp 3346 0x7fc3972cbf18
    16 ApplicationWithExceptionHandling::notify ApplicationWithExceptionHandling.cpp 66 0x1431971
    17 MyApplication::notify My_Application.cpp 276 0x94bacf
    18 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1061 0x7fc394f36944
    19 QCoreApplication::sendEvent qcoreapplication.cpp 1469 0x7fc394f372f0
    20 QWidget::ensurePolished qwidget.cpp 9907 0x7fc39734c152
    21 QWidgetPrivate::setVisible qwidget.cpp 8078 0x7fc39734891b
    22 QWidget::setVisible qwidget.cpp 8052 0x7fc3973487b2

    The last function call is setVisible() on a QLineEdit and the last event received by notify() method is QEvent::Polish

    There is also error printed on terminal on application startup before crash

    X Error: BadWindow (invalid Window parameter) 3
    Major opcode: 15
    Minor opcode: 0
    Resource id: 24

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Check if you can reproduce this with some minimal example - if yes please report it on Qt bug tracker.

      There have been important changes to QMetaType and QVariant, that may be the cause of this: https://doc-snapshots.qt.io/qt6-dev/qtcore-changes-qt6.html#the-qvariant-class

      (Z(:^

      N 1 Reply Last reply
      0
      • JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by
        #3

        @nitingera said in Qt6 application Crash on startup on Linux:

        from Qt 4.8.6 to Qt 6.2.

        from Qt 4.8.6 to Qt 6.2===> pretty big jump. 5.15.2 might be a better choice.

        N 1 Reply Last reply
        0
        • sierdzioS sierdzio

          Check if you can reproduce this with some minimal example - if yes please report it on Qt bug tracker.

          There have been important changes to QMetaType and QVariant, that may be the cause of this: https://doc-snapshots.qt.io/qt6-dev/qtcore-changes-qt6.html#the-qvariant-class

          N Offline
          N Offline
          nitingera
          wrote on last edited by
          #4

          @sierdzio It is crashing in setstylesheet function. Maybe some significant changes made to it

          1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @nitingera said in Qt6 application Crash on startup on Linux:

            from Qt 4.8.6 to Qt 6.2.

            from Qt 4.8.6 to Qt 6.2===> pretty big jump. 5.15.2 might be a better choice.

            N Offline
            N Offline
            nitingera
            wrote on last edited by
            #5

            @JoeCFD It is not by choice... More of driven by customer demands so no option :)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              The two steps port is not a bad idea. Follow the porting guide from Qt 4 to Qt 5 and then do the small adjustments for Qt 6.

              Depending on what you are using you should wait for 6.2 so it's still a good idea to go through 5.15

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              N 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                The two steps port is not a bad idea. Follow the porting guide from Qt 4 to Qt 5 and then do the small adjustments for Qt 6.

                Depending on what you are using you should wait for 6.2 so it's still a good idea to go through 5.15

                N Offline
                N Offline
                nitingera
                wrote on last edited by
                #7

                @SGaist agreed... but not much time... The application is successfully ported on Windows and MAC but only giving issues in Linux. Crashing in stylesheet functions

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Which version of Qt are you using on Linux ?

                  Did you try to start from an empty stylesheet and add back elements until it crashes ?

                  Which version of Linux are you using ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  N 1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    nitingera
                    wrote on last edited by
                    #9

                    Built the Qt6.2 branch on CentOS 7.6

                    The debug output gives this call stack

                    1 QMetaType::canConvert qmetatype.cpp 2415 0x7fffee147754
                    2 QVariant::canConvert qvariant.h 252 0x7fffee1ae916
                    3 QVariant::convert qvariant.cpp 2054 0x7fffee1ad48c
                    4 parseColorValue qcssparser.cpp 714 0x7fffefc4c58a
                    5 parseBrushValue qcssparser.cpp 814 0x7fffefc4d0aa
                    6 QCss::ValueExtractor::borderValue qcssparser.cpp 1009 0x7fffefc4e808
                    7 QCss::ValueExtractor::extractBorder qcssparser.cpp 631 0x7fffefc4bebc
                    8 QRenderRule::QRenderRule qstylesheetstyle.cpp 968 0x7ffff06b7469
                    9 QStyleSheetStyle::renderRule qstylesheetstyle.cpp 1854 0x7ffff06bc65c
                    10 QStyleSheetStyle::setGeometry qstylesheetstyle.cpp 2571 0x7ffff06be69f
                    11 QStyleSheetStyle::polish qstylesheetstyle.cpp 2884 0x7ffff06c08db
                    12 QWidget::event qwidget.cpp 8759 0x7ffff062d538
                    13 QApplicationPrivate::notify_helper qapplication.cpp 3396 0x7ffff05af110
                    14 QApplication::notify qapplication.cpp 3346 0x7ffff05aef18
                    15 My_Application::notify My_Application.cpp 490 0x7ffff7e46343
                    16 My_Application::notify My_Application.cpp 64 0x7ffff1bc190e
                    17 MyApplicationWithExceptionHandling::notify MyApplicationWithExceptionHandling.cpp 66 0x113d179
                    18 MyApplication::notify My_Application.cpp 301 0x96112a
                    19 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1061 0x7fffee104944
                    20 QCoreApplication::sendEvent qcoreapplication.cpp 1469 0x7fffee1052f0
                    21 QWidget::ensurePolished qwidget.cpp 9907 0x7ffff062f152
                    22 QWidget::ensurePolished qwidget.cpp 9916 0x7ffff062f1de
                    23 QWidget::ensurePolished qwidget.cpp 9916 0x7ffff062f1de
                    24 QWidgetPrivate::setVisible qwidget.cpp 8078 0x7ffff062b91b
                    25 QWidget::setVisible qwidget.cpp 8052 0x7ffff062b7b2
                    26 QWidget::show qwidget.cpp 7678 0x7ffff062a5c7
                    27 QStackedLayout::setCurrentIndex qstackedlayout.cpp 323 0x7ffff060cffa
                    28 QStackedLayout::insertWidget qstackedlayout.cpp 233 0x7ffff060cc0e
                    29 QStackedWidget::insertWidget qstackedwidget.cpp 181 0x7ffff089e88d
                    30 My_LayoutFrame::addTab myulayoutframe.cpp 459 0x7ffff4af0427
                    31 My_LayoutArea::add mylayoutarea.cpp 94 0x7ffff4ae8a25

                    1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Which version of Qt are you using on Linux ?

                      Did you try to start from an empty stylesheet and add back elements until it crashes ?

                      Which version of Linux are you using ?

                      N Offline
                      N Offline
                      nitingera
                      wrote on last edited by nitingera
                      #10

                      @SGaist Can it be due to missing style plugin on Linux?
                      As there are style plugins for Mac and Windows (qwindowsvistastyle.dll) in plugin/styles but nothing for Linux.
                      Maybe any missing dependency while building?

                      The Config summary states the following

                      Qt Widgets:
                      GTK+ ................................... yes
                      Styles ................................. Fusion Windows

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Sorry, I lost track of this thread.

                        No as in the case of style sheets there's a dedicated QStyle subclass for it.

                        Can you reproduce that with a minimal compilable example ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        N 1 Reply Last reply
                        0
                        • A.A.SEZENA Offline
                          A.A.SEZENA Offline
                          A.A.SEZEN
                          wrote on last edited by
                          #12

                          Although I think that you have cleaned the build directory of your project, I still wanted to go over the topic.

                          N 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            Sorry, I lost track of this thread.

                            No as in the case of style sheets there's a dedicated QStyle subclass for it.

                            Can you reproduce that with a minimal compilable example ?

                            N Offline
                            N Offline
                            nitingera
                            wrote on last edited by
                            #13

                            @SGaist
                            Although I can't produce a minimal compilable example as of now but I could find atleast one instance where it is crashing
                            This line crashes
                            framePoint->setStyleSheet(QString("border: 1px solid lightGray; background-color: rgb(%1, %2, %3 );")).arg(backgroundCol.red()).arg(backgroundCol.green()).arg(backgroundCol.blue());

                            But this one works fine
                            framePoint->setStyleSheet(QString("border: 1px; border-color: rgb(211, 211, 211); background-color: rgb(%1, %2, %3 );")).arg(backgroundCol.red()).arg(backgroundCol.green()).arg(backgroundCol.blue());

                            Maybe some issue with parsing in stylesheet

                            1 Reply Last reply
                            0
                            • A.A.SEZENA A.A.SEZEN

                              Although I think that you have cleaned the build directory of your project, I still wanted to go over the topic.

                              N Offline
                              N Offline
                              nitingera
                              wrote on last edited by
                              #14

                              @A-A-SEZEN Commenting some specific stylesheet statements works. Rebuilding the project doesn't solve my issue. Is there anything specific that I need to cleanup?

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                You may have found a bug.

                                Can you reproduce that on a dummy widget ?

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • N Offline
                                  N Offline
                                  nitingera
                                  wrote on last edited by
                                  #16

                                  Apologies for false alarm....
                                  It was crashing trying to set style sheet to a non existent plugin...
                                  Issue resolved..
                                  Thanks for the help :)

                                  1 Reply Last reply
                                  2

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved