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. Why QT C++ application get crash ?
Forum Updated to NodeBB v4.3 + New Features

Why QT C++ application get crash ?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 4 Posters 442 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.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    when my code is reach to destructor of QmlEngineUtility it get crash .

    QmlEngineUtility::~QmlEngineUtility
    {
    
    }
    

    Below i written the stack and break point output:

    1   QThreadStorageData::get() const                                                                                                              0x7ffff3eb952b 
    2   QOpenGLContext::currentContext()                                                                                                             0x7ffff49af988 
    3   QSurface::~QSurface()                                                                                                                        0x7ffff497bb4c 
    4   QWindow::~QWindow()                                                                                                                          0x7ffff497994f 
    5   QQuickWindow::~QQuickWindow()                                                                                                                0x7ffff785bb54 
    6   QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement()                                                                                0x7fffd200677d 
    7   QQmlApplicationEnginePrivate::cleanUp()                                                                                                      0x7ffff5ce014e 
    8   QQmlApplicationEngine::~QQmlApplicationEngine()                                                                                              0x7ffff5ce0198 
    9   QQmlApplicationEngine::~QQmlApplicationEngine()                                                                                              0x7ffff5ce01b9 
    10  QtSharedPointer::CustomDeleter<QQmlApplicationEngine, QtSharedPointer::NormalDeleter>::execute                     qsharedpointer_impl.h 187 0x404387       
    11  QtSharedPointer::ExternalRefCountWithCustomDeleter<QQmlApplicationEngine, QtSharedPointer::NormalDeleter>::deleter qsharedpointer_impl.h 205 0x4041bb       
    12  QtSharedPointer::ExternalRefCountData::destroy                                                                     qsharedpointer_impl.h 149 0x403c7d       
    13  QSharedPointer<QQmlApplicationEngine>::deref                                                                       qsharedpointer_impl.h 458 0x4042bc       
    14  QSharedPointer<QQmlApplicationEngine>::deref                                                                       qsharedpointer_impl.h 453 0x4040b4       
    15  QSharedPointer<QQmlApplicationEngine>::~QSharedPointer                                                             qsharedpointer_impl.h 310 0x403e14       
    16  QmlEngineUtility::~QmlEngineUtility                                                                                QmlEngineUtility.cpp  27  0x40ab1a       
    17  __run_exit_handlers                                                                                                                          0x7ffff74621e6
    
    JonBJ Christian EhrlicherC 2 Replies Last reply
    0
    • Q Qt embedded developer

      when my code is reach to destructor of QmlEngineUtility it get crash .

      QmlEngineUtility::~QmlEngineUtility
      {
      
      }
      

      Below i written the stack and break point output:

      1   QThreadStorageData::get() const                                                                                                              0x7ffff3eb952b 
      2   QOpenGLContext::currentContext()                                                                                                             0x7ffff49af988 
      3   QSurface::~QSurface()                                                                                                                        0x7ffff497bb4c 
      4   QWindow::~QWindow()                                                                                                                          0x7ffff497994f 
      5   QQuickWindow::~QQuickWindow()                                                                                                                0x7ffff785bb54 
      6   QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement()                                                                                0x7fffd200677d 
      7   QQmlApplicationEnginePrivate::cleanUp()                                                                                                      0x7ffff5ce014e 
      8   QQmlApplicationEngine::~QQmlApplicationEngine()                                                                                              0x7ffff5ce0198 
      9   QQmlApplicationEngine::~QQmlApplicationEngine()                                                                                              0x7ffff5ce01b9 
      10  QtSharedPointer::CustomDeleter<QQmlApplicationEngine, QtSharedPointer::NormalDeleter>::execute                     qsharedpointer_impl.h 187 0x404387       
      11  QtSharedPointer::ExternalRefCountWithCustomDeleter<QQmlApplicationEngine, QtSharedPointer::NormalDeleter>::deleter qsharedpointer_impl.h 205 0x4041bb       
      12  QtSharedPointer::ExternalRefCountData::destroy                                                                     qsharedpointer_impl.h 149 0x403c7d       
      13  QSharedPointer<QQmlApplicationEngine>::deref                                                                       qsharedpointer_impl.h 458 0x4042bc       
      14  QSharedPointer<QQmlApplicationEngine>::deref                                                                       qsharedpointer_impl.h 453 0x4040b4       
      15  QSharedPointer<QQmlApplicationEngine>::~QSharedPointer                                                             qsharedpointer_impl.h 310 0x403e14       
      16  QmlEngineUtility::~QmlEngineUtility                                                                                QmlEngineUtility.cpp  27  0x40ab1a       
      17  __run_exit_handlers                                                                                                                          0x7ffff74621e6
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #4

      @Qt-embedded-developer said in Why QT C++ application get crash ?:

      QSharedPointer<QQmlApplicationEngine>::~QSharedPointer

      You were informed about the problems when using automatic pointers with Qt objects in your last question: https://forum.qt.io/topic/154869/what-is-difference-between-std-unique_ptr-v-s-std-make_unique?_=1709130823393

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • Q Qt embedded developer

        when my code is reach to destructor of QmlEngineUtility it get crash .

        QmlEngineUtility::~QmlEngineUtility
        {
        
        }
        

        Below i written the stack and break point output:

        1   QThreadStorageData::get() const                                                                                                              0x7ffff3eb952b 
        2   QOpenGLContext::currentContext()                                                                                                             0x7ffff49af988 
        3   QSurface::~QSurface()                                                                                                                        0x7ffff497bb4c 
        4   QWindow::~QWindow()                                                                                                                          0x7ffff497994f 
        5   QQuickWindow::~QQuickWindow()                                                                                                                0x7ffff785bb54 
        6   QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement()                                                                                0x7fffd200677d 
        7   QQmlApplicationEnginePrivate::cleanUp()                                                                                                      0x7ffff5ce014e 
        8   QQmlApplicationEngine::~QQmlApplicationEngine()                                                                                              0x7ffff5ce0198 
        9   QQmlApplicationEngine::~QQmlApplicationEngine()                                                                                              0x7ffff5ce01b9 
        10  QtSharedPointer::CustomDeleter<QQmlApplicationEngine, QtSharedPointer::NormalDeleter>::execute                     qsharedpointer_impl.h 187 0x404387       
        11  QtSharedPointer::ExternalRefCountWithCustomDeleter<QQmlApplicationEngine, QtSharedPointer::NormalDeleter>::deleter qsharedpointer_impl.h 205 0x4041bb       
        12  QtSharedPointer::ExternalRefCountData::destroy                                                                     qsharedpointer_impl.h 149 0x403c7d       
        13  QSharedPointer<QQmlApplicationEngine>::deref                                                                       qsharedpointer_impl.h 458 0x4042bc       
        14  QSharedPointer<QQmlApplicationEngine>::deref                                                                       qsharedpointer_impl.h 453 0x4040b4       
        15  QSharedPointer<QQmlApplicationEngine>::~QSharedPointer                                                             qsharedpointer_impl.h 310 0x403e14       
        16  QmlEngineUtility::~QmlEngineUtility                                                                                QmlEngineUtility.cpp  27  0x40ab1a       
        17  __run_exit_handlers                                                                                                                          0x7ffff74621e6
        
        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #2

        @Qt-embedded-developer Can you show an absolutely minimal example of your code which produces this?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AhsanKhan
          wrote on last edited by
          #3

          There can be several reasons. One of them being, accessing a null pointer's members or an out of bounds iterator (which caused my program to crash recently without any error). Provide the code that you've written, so we can see what's happening!

          1 Reply Last reply
          0
          • Q Qt embedded developer

            when my code is reach to destructor of QmlEngineUtility it get crash .

            QmlEngineUtility::~QmlEngineUtility
            {
            
            }
            

            Below i written the stack and break point output:

            1   QThreadStorageData::get() const                                                                                                              0x7ffff3eb952b 
            2   QOpenGLContext::currentContext()                                                                                                             0x7ffff49af988 
            3   QSurface::~QSurface()                                                                                                                        0x7ffff497bb4c 
            4   QWindow::~QWindow()                                                                                                                          0x7ffff497994f 
            5   QQuickWindow::~QQuickWindow()                                                                                                                0x7ffff785bb54 
            6   QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement()                                                                                0x7fffd200677d 
            7   QQmlApplicationEnginePrivate::cleanUp()                                                                                                      0x7ffff5ce014e 
            8   QQmlApplicationEngine::~QQmlApplicationEngine()                                                                                              0x7ffff5ce0198 
            9   QQmlApplicationEngine::~QQmlApplicationEngine()                                                                                              0x7ffff5ce01b9 
            10  QtSharedPointer::CustomDeleter<QQmlApplicationEngine, QtSharedPointer::NormalDeleter>::execute                     qsharedpointer_impl.h 187 0x404387       
            11  QtSharedPointer::ExternalRefCountWithCustomDeleter<QQmlApplicationEngine, QtSharedPointer::NormalDeleter>::deleter qsharedpointer_impl.h 205 0x4041bb       
            12  QtSharedPointer::ExternalRefCountData::destroy                                                                     qsharedpointer_impl.h 149 0x403c7d       
            13  QSharedPointer<QQmlApplicationEngine>::deref                                                                       qsharedpointer_impl.h 458 0x4042bc       
            14  QSharedPointer<QQmlApplicationEngine>::deref                                                                       qsharedpointer_impl.h 453 0x4040b4       
            15  QSharedPointer<QQmlApplicationEngine>::~QSharedPointer                                                             qsharedpointer_impl.h 310 0x403e14       
            16  QmlEngineUtility::~QmlEngineUtility                                                                                QmlEngineUtility.cpp  27  0x40ab1a       
            17  __run_exit_handlers                                                                                                                          0x7ffff74621e6
            
            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @Qt-embedded-developer said in Why QT C++ application get crash ?:

            QSharedPointer<QQmlApplicationEngine>::~QSharedPointer

            You were informed about the problems when using automatic pointers with Qt objects in your last question: https://forum.qt.io/topic/154869/what-is-difference-between-std-unique_ptr-v-s-std-make_unique?_=1709130823393

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            1
            • Q Qt embedded developer has marked this topic as solved on

            • Login

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