Why QT C++ application get crash ?
-
wrote on 28 Feb 2024, 11:33 last edited by
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
-
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
@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
-
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
wrote on 28 Feb 2024, 11:45 last edited by@Qt-embedded-developer Can you show an absolutely minimal example of your code which produces this?
-
wrote on 28 Feb 2024, 12:40 last edited by
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!
-
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
@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
-
4/4