Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Segmentation fault when exiting when linked against Qt 6.9.1
Forum Updated to NodeBB v4.3 + New Features

Segmentation fault when exiting when linked against Qt 6.9.1

Scheduled Pinned Locked Moved Solved General and Desktop
32 Posts 6 Posters 2.1k 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.
  • l3u_L Offline
    l3u_L Offline
    l3u_
    wrote last edited by
    #19

    Thanks :-)

    1 Reply Last reply
    0
    • l3u_L Offline
      l3u_L Offline
      l3u_
      wrote last edited by l3u_
      #20

      Just to also leave this here: I meanwhile could strip it down to a minimal example producing the crash, cf. the sources attached to https://bugreports.qt.io/browse/QTBUG-137755

      Produces the crash reliably when linked against Qt 6.9.1. You have to run the program twice: The first time, it exits normally. The second time, when the window geometry and state are restored, it segfaults on exiting.

      No delete, no deleteLater, nothing special at all …

      1 Reply Last reply
      0
      • Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote last edited by Axel Spoerl
        #21

        Great reproducer!
        Someone decades ago felt like storing unused tab bars for later re-usage in QMainWindowLayout.
        Those were soft-leaked and taken care off, when QApplication got destroyed.
        Reading the state back from settings causes the original tab bar (created in the C++ part) to become unused, but not removed from its QMainWindow parent. That ultimately lead to a double delete and the crash.
        Let's see, if my thorough reviewers let me get away without writing an autotest ;-)

        Software Engineer
        The Qt Company, Oslo

        1 Reply Last reply
        3
        • l3u_L Offline
          l3u_L Offline
          l3u_
          wrote last edited by
          #22

          Wow, that was fast :-) Thanks for the immediate fix! Nice to see my stuff helped here!

          That was quite deep inside Qt apparently … where will this land? Qt 6.10.0? Or will it be backported?

          I tried to cherry-pick it to a 6.9.1 checkout to test it, but it seems that's no trivial task …

          jsulmJ 1 Reply Last reply
          0
          • l3u_L l3u_

            Wow, that was fast :-) Thanks for the immediate fix! Nice to see my stuff helped here!

            That was quite deep inside Qt apparently … where will this land? Qt 6.10.0? Or will it be backported?

            I tried to cherry-pick it to a 6.9.1 checkout to test it, but it seems that's no trivial task …

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote last edited by
            #23

            @l3u_ You can see in the bug report:
            Fix Version/s: 6.10.0 Beta2, 6.11.0 FF

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • l3u_L Offline
              l3u_L Offline
              l3u_
              wrote last edited by l3u_
              #24

              Ah okay. So no 6.9 backport? I just wondered, because in the respective "Change ID" https://codereview.qt-project.org/c/qt/qtbase/+/653727, it's listed: "Fixes: QTBUG-137755 Pick-to: 6.10 6.9"

              jsulmJ 1 Reply Last reply
              0
              • l3u_L l3u_

                Ah okay. So no 6.9 backport? I just wondered, because in the respective "Change ID" https://codereview.qt-project.org/c/qt/qtbase/+/653727, it's listed: "Fixes: QTBUG-137755 Pick-to: 6.10 6.9"

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote last edited by
                #25

                @l3u_ Yes, it looks like it was cherry picked to 6.9 branch, so may end up in some 6.9.x version :-)

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • Axel SpoerlA Offline
                  Axel SpoerlA Offline
                  Axel Spoerl
                  Moderators
                  wrote last edited by
                  #26

                  The fix will land in 6.9.2, which we plan to release on August 14th.

                  If you want to cherry pick and compile locally, please make sure to pick the following 5 commits in the right order:

                  1. https://codereview.qt-project.org/c/qt/qtbase/+/653890
                  2. https://codereview.qt-project.org/c/qt/qtbase/+/653891
                  3. https://codereview.qt-project.org/c/qt/qtbase/+/653892
                  4. https://codereview.qt-project.org/c/qt/qtbase/+/653893
                  5. https://codereview.qt-project.org/c/qt/qtbase/+/653894

                  Software Engineer
                  The Qt Company, Oslo

                  1 Reply Last reply
                  3
                  • l3u_L Offline
                    l3u_L Offline
                    l3u_
                    wrote last edited by
                    #27

                    Nice :-)

                    I just tried it locally, cherry-picking the exact comments you linked. Worked without a collision on a v6.9.1 checkout.

                    And – you may already have thought that – I can confirm the segfault is gone now, also for my quite complex use-case :-)

                    1 Reply Last reply
                    3
                    • Axel SpoerlA Offline
                      Axel SpoerlA Offline
                      Axel Spoerl
                      Moderators
                      wrote last edited by
                      #28

                      Great that you are using dock widgets! As you may have suspected: QDockWidget is slightly closer to my heart than other creatures in the widget zoo ;-)

                      Software Engineer
                      The Qt Company, Oslo

                      S 1 Reply Last reply
                      1
                      • l3u_L Offline
                        l3u_L Offline
                        l3u_
                        wrote last edited by
                        #29

                        First, it was just a QTabBar interface. But over the years, it got more and more complex, and at some point, I learned about QDockWidgets – and I loved them at first sight ;-) The same as the tab bar if you want – but way more if you need it. The possibility to arrange them as you like and need is really nice. This is actually a powerful tool, with a great user experience. QDockWidgets really rock! They do, from time to time, cause some headache (this is actually not the first bug I filed about them ;-) – but they are really cool.

                        1 Reply Last reply
                        2
                        • Axel SpoerlA Offline
                          Axel SpoerlA Offline
                          Axel Spoerl
                          Moderators
                          wrote last edited by
                          #30

                          @l3u_
                          Could you mark this thread as solved, please?

                          Software Engineer
                          The Qt Company, Oslo

                          1 Reply Last reply
                          0
                          • Axel SpoerlA Axel Spoerl

                            Great that you are using dock widgets! As you may have suspected: QDockWidget is slightly closer to my heart than other creatures in the widget zoo ;-)

                            S Offline
                            S Offline
                            StudentScripter
                            wrote last edited by
                            #31

                            @Axel-Spoerl Love QDockwidget too, great work <3

                            I always miss them in QML ( i know that QML is mainly mobile focused but nevertheless). :D

                            1 Reply Last reply
                            1
                            • Axel SpoerlA Offline
                              Axel SpoerlA Offline
                              Axel Spoerl
                              Moderators
                              wrote last edited by
                              #32

                              @StudentScripter Not as an immediate priority, but we are planning to implement something like dock widgets also in Quick Controls.

                              Software Engineer
                              The Qt Company, Oslo

                              1 Reply Last reply
                              0
                              • l3u_L l3u_ has marked this topic as solved

                              • Login

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