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. Qut of memory in QVector
QtWS25 Last Chance

Qut of memory in QVector

Scheduled Pinned Locked Moved Solved General and Desktop
runtime error
14 Posts 4 Posters 4.2k Views
  • 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.
  • J jsulm
    20 Jun 2018, 04:39

    @Tikani But it could help to see where in your app you are when the crash happens and in which state the app is (values of variables, ...). Bugs in frameworks are rare, so most probably it is something in your app, but actual crash happens inside Qt (but not because of a Qt bug).

    T Offline
    T Offline
    Tikani
    wrote on 20 Jun 2018, 04:44 last edited by Tikani
    #5

    @jsulm Ok, then I try to rebuild Qt with debug information and post here a link to GitHub with my project (it's opensource) as well, may be then things get clearer for true Jedis :D may be there is a need in a big picture to resolve the problem.

    J 2 Replies Last reply 20 Jun 2018, 04:47
    0
    • T Tikani
      20 Jun 2018, 04:44

      @jsulm Ok, then I try to rebuild Qt with debug information and post here a link to GitHub with my project (it's opensource) as well, may be then things get clearer for true Jedis :D may be there is a need in a big picture to resolve the problem.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 20 Jun 2018, 04:47 last edited by
      #6

      @Tikani No! There is no need to rebuild Qt at this stage! I don't ask you to debug Qt - it will most probably not help you. Simply run your app through debugger until it crashes and see where in your app you are at that time.
      In most cases (from my own experience) if your app crashes somewhere in Qt it is NOT Qt but your app which is doing something wrong.

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

      1 Reply Last reply
      2
      • T Tikani
        20 Jun 2018, 04:44

        @jsulm Ok, then I try to rebuild Qt with debug information and post here a link to GitHub with my project (it's opensource) as well, may be then things get clearer for true Jedis :D may be there is a need in a big picture to resolve the problem.

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 20 Jun 2018, 04:49 last edited by
        #7

        @Tikani Also you can post stack trace after crash here - it can help to find the issue

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

        T 1 Reply Last reply 20 Jun 2018, 04:52
        2
        • J jsulm
          20 Jun 2018, 04:49

          @Tikani Also you can post stack trace after crash here - it can help to find the issue

          T Offline
          T Offline
          Tikani
          wrote on 20 Jun 2018, 04:52 last edited by Tikani
          #8

          @jsulm OK, I got the point. I attach stacktrace and full code a little bit later - I need to go to work now :( Thanks anyway for the fastness of responses - now I'm confident that my issue would be resolved eventually with help of the community.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 20 Jun 2018, 20:01 last edited by
            #9

            Hi
            I see that you are using 32 bit.
            How many model items do you add ?

            1 Reply Last reply
            1
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 20 Jun 2018, 20:09 last edited by
              #10

              Hi,

              @Tikani said in Qut of memory in QVector:

              QList<Task> *tasks = nullptr; // Внутреннее хранилище всех задач

              Why are you using a pointer for tasks ? I don't see it initialised anywhere.

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

              T 1 Reply Last reply 20 Jun 2018, 21:05
              2
              • S SGaist
                20 Jun 2018, 20:09

                Hi,

                @Tikani said in Qut of memory in QVector:

                QList<Task> *tasks = nullptr; // Внутреннее хранилище всех задач

                Why are you using a pointer for tasks ? I don't see it initialised anywhere.

                T Offline
                T Offline
                Tikani
                wrote on 20 Jun 2018, 21:05 last edited by Tikani
                #11

                @SGaist It is just an inner storage over which subclassed model works. I forgot to comment it after my experiments with fields and its types, when I tried to locate a culprit of a aprogram crash. Anyway, it doesn't initialize in any way, it is just empty nullptr junk pointer.
                By the way, here stacktrace comes:

                1  msvcrt!abort                                                                        0x7732b3fb 
                2  libstdc++-6!_ZN9__gnu_cxx27__verbose_terminate_handlerEv                            0x1768085d 
                3  libstdc++-6!_ZN10__cxxabiv111__terminateEPFvvE                                      0x17679399 
                4  libstdc++-6!_ZSt9terminatev                                                         0x17713930 
                5  qt_check_pointer                                         qglobal.cpp           3050 0x6b98abc1 
                6  QVector<QHeaderViewPrivate::SectionItem>::reallocData    qvector.h             551  0xde2dc07  
                7  QVector<QHeaderViewPrivate::SectionItem>::resize         qvector.h             416  0xde2e4ce  
                8  QHeaderViewPrivate::createSectionItems                   qheaderview.cpp       3530 0xdcd1a3d  
                9  QHeaderView::initializeSections                          qheaderview.cpp       2279 0xdcd2572  
                10 QHeaderView::initializeSections                          qheaderview.cpp       2205 0xdcd5918  
                11 QHeaderView::reset                                       qheaderview.cpp       1774 0xdcd9584  
                12 QAbstractItemView::setModel                              qabstractitemview.cpp 748  0xdcc0764  
                13 QHeaderView::setModel                                    qheaderview.cpp       408  0xdcd94e0  
                14 QTableView::setModel                                     qtableview.cpp        1136 0xdd140d6  
                15 MainWindow::MainWindow                                   mainwindow.cpp        15   0x401910   
                16 qMain                                                    main.cpp              11   0x4016f4   
                17 WinMain *16                                              qtmain_win.cpp        104  0x404d85   
                18 main                                                                                0x40934d   
                
                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 20 Jun 2018, 21:11 last edited by
                  #12

                  One more thing, your data method is empty, it should at least contain return QVariant();.

                  You don't need to pass your QApplication instance as parameter. You can access it using the qApp macro.

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

                  T 1 Reply Last reply 22 Jun 2018, 04:46
                  3
                  • S SGaist
                    20 Jun 2018, 21:11

                    One more thing, your data method is empty, it should at least contain return QVariant();.

                    You don't need to pass your QApplication instance as parameter. You can access it using the qApp macro.

                    T Offline
                    T Offline
                    Tikani
                    wrote on 22 Jun 2018, 04:46 last edited by
                    #13

                    @SGaist Thanks, the issue is solved. There was a need in return QVariant() indeed. Mark as closed.

                    1 Reply Last reply
                    1
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 22 Jun 2018, 06:35 last edited by
                      #14

                      There's always a need to return something when your method has a return type. If you don't know what to return at first then return a default value.

                      Also, always take into account the warnings the compiler throws at you (there is one for functions not returning anything when their signature contains a return type). As the old saying goes: a compiler warning ignored today is a catastrophic crash in production tomorrow.

                      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
                      1

                      14/14

                      22 Jun 2018, 06:35

                      • Login

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