Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt 4.8.7 crashes on Cortex A9 with QDeclarativeView
Forum Updated to NodeBB v4.3 + New Features

Qt 4.8.7 crashes on Cortex A9 with QDeclarativeView

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 268 Views 1 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.
  • M Offline
    M Offline
    mertcanozdemir
    wrote on last edited by
    #1

    Hi all,
    I am trying to build a project with 3 devices. I need to use Qt 4.8.7 because older devices doesn't have a c++11 supported compiler. The older ones are working fine, they have generic armv7l cpu. Compiled and ran without problems(qws). But the third one has a cortex a9 cpu(dvf101) when i try to run my code on it, it crashes. But only if i use QDeclarativeView. I don't have any problems running qwidgets. Here is my code and backtrace. Thanks in advance

    main.cpp

    #include <QApplication>
    #include <QDeclarativeView>
    #include <QtDeclarative>
    #include <QDeclarativeContext>
    #include <QWSKeyboardHandler>
    #include <QPluginLoader>
    #include <QCursor>
    #include <QWSServer>
    #include <QDebug>
    #include "screenupdater.h"
    #include <sys/ioctl.h>
    #include <QGraphicsColorizeEffect>
    #include "oscreen.h"
    #include "colorpalette.h"
    #include <iostream>
    #include <unistd.h>
    
    int main(int argc, char *argv[])
    {
        sleep(15);
        std::cout << __LINE__ << std::endl;
        QApplication a(argc, argv);
    std::cout << __LINE__ << std::endl;
    
        std::cout << __LINE__ << std::endl;
        QDeclarativeView* view = new QDeclarativeView;
        std::cout << __LINE__ << std::endl;
    
        std::cout << __LINE__ << std::endl;
    
        std::cout << __LINE__ << std::endl;
    
        std::cout << __LINE__ << std::endl;
    
    
        std::cout << __LINE__ << std::endl;
    
        std::cout << __LINE__ << std::endl;
    std::cout << __LINE__ << std::endl;
    
    #if __BOARD__ == __FIRSTBOARD__
    std::cout << __LINE__ << std::endl;
        view->setSource(QUrl("qrc:/yahak.qml")); //crashes here
        std::cout << __LINE__ << std::endl;
    #elif __BOARD__ == __SECONDBOARD__
        view->setSource(QUrl("qrc:/mainlow.qml"));
    #endif
    std::cout << __LINE__ << std::endl;
    
        view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
    
    std::cout << __LINE__ << std::endl;
    #ifndef __SIMULATOR__
        view->showFullScreen();
        QWSServer::setCursorVisible(false);
    #else
    
        view->show();
    #if __BOARD__ == __FIRSTBOARD__
        view->setFixedSize(840, 480);
    #elif __BOARD__ == __SECONDBOARD__
        view->setFixedSize(190, 48);
    #endif
    
    #endif
    #if __BOARD__ == __SECONDBOARD__
        ScreenUpdater* updater = new ScreenUpdater();
    #endif
        std::cout << __LINE__ << std::endl;
        qDebug() << "hi";
        return a.exec();
    }
    
    

    yahak.qml

    import QtQuick 1.1
    
    Item {
        width: 1
        height: 1
        Rectangle{anchors.fill: parent; color: "red"}
    
    }
    
    

    Backtrace

    #0  0xb6dcef0c in QDeclarativeCompiledData::TypeReference::metaObject (
        this=this@entry=0x0) at qml/qdeclarativecompileddata.cpp:206
    No locals.
    #1  0xb6dc2de8 in QDeclarativeCompiler::buildObject (this=0xbe8c2b40, 
        obj=0x312e0, ctxt=...) at qml/qdeclarativecompiler.cpp:737
            tr = <error reading variable>
            objCtxt = {stack = 17, owner = -1098110528, 
              object = 0xb6ec9d58 <QDeclarativeItem::staticMetaObject>}
            type = <optimized out>
            isCustomParser = <optimized out>
            customProps = {{p = {static shared_null = {ref = {_q_value = 377}, 
                    alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, 
                  d = 0x0}, d = 0x0}}
            deferredList = {<QList<QString>> = {{p = {static shared_null = {ref = {
                        _q_value = 377}, alloc = 0, begin = 0, end = 0, 
                      sharable = 1, array = {0x0}}, d = 0x1}, 
                  d = 0x1}}, <No data fields>}
            defaultProperty = <optimized out>
            skipProperty = <optimized out>
            cp = <optimized out>
    #2  0xb6dc6884 in QDeclarativeCompiler::buildListProperty (
        this=this@entry=0xbe8c2b40, prop=prop@entry=0x6c5c0, 
        obj=obj@entry=0x34f68, ctxt=...) at qml/qdeclarativecompiler.cpp:1978
            v = 0x6c570
            ii = 0
            t = <optimized out>
            listType = -1098110640
            listTypeIsInterface = <optimized out>
            assignedBinding = 225
    #3  0xb6dc7ed0 in QDeclarativeCompiler::buildProperty (this=this@entry=0xbe8c2b40, prop=prop@entry=0x6c5c0, obj=obj@entry=0x34f68, ctxt=...) at qml/qdeclarativecompiler.cpp:1555
            metaObject = <optimized out>
    #4  0xb6dc35b8 in QDeclarativeCompiler::buildObject (this=this@entry=0xbe8c2b40, obj=obj@entry=0x34f68, ctxt=...) at qml/qdeclarativecompiler.cpp:868
            ids = 0
            prop = 0x6c5c0
            canDefer = false
            tr = <optimized out>
            objCtxt = {stack = 0, owner = 0, object = 0x34f68}
            type = <optimized out>
            isCustomParser = 184
            customProps = {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xb60755d4 <QListData::shared_null>}, d = 0xb60755d4 <QListData::shared_null>}}
            deferredList = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xb60755d4 <QListData::shared_null>}, d = 0xb60755d4 <QListData::shared_null>}}, <No data fields>}
            defaultProperty = 0x6c5c0
            skipProperty = 0xb5b58090 <mp_>
            cp = 0x0
    #5  0xb6dc6174 in QDeclarativeCompiler::compileTree (this=0xbe8c2b40, tree=0x34f68) at ../../include/QtDeclarative/private/../../../src/declarative/qml/qdeclarativecompiler_p.h:173
            init = <optimized out>
            importedScripts = <optimized out>
            importedScriptIndexes = <optimized out>
            def = <optimized out>
            _container_ = <optimized out>
            script = <optimized out>
            scriptCode = <optimized out>
            pragmas = <optimized out>
            scriptBlock = <optimized out>
            iter = <optimized out>
            import = <optimized out>
            ii = <optimized out>
    #6  0xb6dcb09c in QDeclarativeCompiler::compile (this=0xbe8c2b00, this@entry=0xbe8c2b40, engine=0x53148, unit=0x1, unit@entry=0x65ea8, out=0xffffffff) at qml/qdeclarativecompiler.cpp:622
            resolvedTypes = @0x65f00: {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x6a7f8}, d = 0x6a7f8}}
            referencedTypes = {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x6c118}, d = 0x6c118}}
            root = <optimized out>
    #7  0xb6de1804 in QDeclarativeTypeData::compile (this=this@entry=0x65ea8) at qml/qdeclarativetypeloader.cpp:1045
            compiler = {compileState = {ids = {{d = 0xb60755a0 <QHashData::shared_null>, e = 0xb60755a0 <QHashData::shared_null>}}, idIndexes = {{d = 0xb60755a0 <QHashData::shared_null>, e = 0xb60755a0 <QHashData::shared_null>}}, parserStatusCount = 1, pushedProperties = 0, compiledBindingData = {static shared_null = {ref = {_q_value = 62}, alloc = 0, size = 0, data = 0xb607559c <QByteArray::shared_null+16> "", array = ""}, static shared_empty = {ref = {_q_value = 3}, alloc = 0, size = 0, data = 0xb6075588 <QByteArray::shared_empty+16> "", array = ""}, d = 0xb607558c <QByteArray::shared_null>}, bindings = {{d = 0xb60755a0 <QHashData::shared_null>, e = 0xb60755a0 <QHashData::shared_null>}}, signalExpressions = {{d = 0xb60755a0 <QHashData::shared_null>, e = 0xb60755a0 <QHashData::shared_null>}}, aliasingObjects = {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xb60755d4 <QListData::shared_null>}, d = 0xb60755d4 <QListData::shared_null>}}, root = 0x34f68}, componentStat = {lineNumber = 3, ids = 0, scriptBindings = {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xb60755d4 <QListData::shared_null>}, d = 0xb60755d4 <QListData::shared_null>}}, optimizedBindings = {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xb60755d4 <QListData::shared_null>}, d = 0xb60755d4 <QListData::shared_null>}}, objects = 2}, savedCompileStates = {{d = 0xb60755a0 <QHashData::shared_null>, e = 0xb60755a0 <QHashData::shared_null>}}, savedComponentStats = {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xb60755d4 <QListData::shared_null>}, d = 0xb60755d4 <QListData::shared_null>}}, exceptions = {{p = {static shared_null = {ref = {_q_value = 377}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xb60755d4 <QListData::shared_null>}, d = 0xb60755d4 <QListData::shared_null>}}, output = 0x6a820, engine = 0x3bbb8, enginePrivate = 0x53148, unitRoot = 0x34f68, unit = 0x65ea8}
    #8  0xb6de2068 in QDeclarativeTypeData::done (this=0x65ea8) at qml/qdeclarativetypeloader.cpp:963
    No locals.
    #9  0xb6de0bfc in QDeclarativeDataBlob::tryDone (this=0xb6de0bfc <QDeclarativeDataBlob::tryDone()+92>) at qml/qdeclarativetypeloader.cpp:414
    No locals.
    #10 QDeclarativeDataBlob::tryDone (this=0xb6de0bfc <QDeclarativeDataBlob::tryDone()+92>) at qml/qdeclarativetypeloader.cpp:407
    No locals.
    #11 0xb6de23d4 in QDeclarativeDataLoader::load (this=this@entry=0x53224, blob=blob@entry=0x65ea8) at qml/qdeclarativetypeloader.cpp:546
            data = {static shared_null = {ref = {_q_value = 62}, alloc = 0, size = 0, data = 0xb607559c <QByteArray::shared_null+16> "", array = ""}, static shared_empty = {ref = {_q_value = 3}, alloc = 0, size = 0, data = 0xb6075588 <QByteArray::shared_empty+16> "", array = ""}, d = 0x3f480}
            file = {<QIODevice> = {<QObject> = {_vptr.QObject = 0xb6072010 <vtable for QFile+8>, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0xb5fd8a68 <qt_meta_stringdata_QObject> "QObject", data = 0xb5fd8b3c <qt_meta_data_QObject>, extradata = 0xb606d3cc <QObject::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0xb5f1657c <QObject::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}, d_ptr = {d = 0x31ba8}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0xb60490b4 <qt_meta_stringdata_Qt> "Qt", data = 0xb604c9b8 <qt_meta_data_Qt>, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x27d78 <QObject::staticMetaObject>, stringdata = 0xb60518f0 <qt_meta_stringdata_QIODevice> "QIODevice", data = 0xb6051954 <qt_meta_data_QIODevice>, extradata = 0xb6070634 <QIODevice::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0xb5f5bb58 <QIODevice::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}}, static staticMetaObject = {d = {superdata = 0xb6072118 <QIODevice::staticMetaObject>, stringdata = 0xb60518a4 <qt_meta_stringdata_QFile> "QFile", data = 0xb60518b4 <qt_meta_data_QFile>, extradata = 0xb607062c <QFile::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0xb5f5b9f4 <QFile::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}}
            lf = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 285}, alloc = 0, size = 0, data = 0xb607565e <QString::shared_null+18>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 8}, alloc = 0, size = 0, data = 0xb607564a <QString::shared_empty+18>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x66038, static codecForCStrings = 0x0}
    #12 0xb6de2650 in QDeclarativeTypeLoader::get (this=0x53224, url=...) at qml/qdeclarativetypeloader.cpp:712
            typeData = 0x65ea8
    #13 0xb6daafd8 in QDeclarativeComponent::loadUrl (this=this@entry=0x64748, url=...) at ../../include/QtCore/../../src/corelib/global/qglobal.h:2580
            d = 0x313d8
            data = <optimized out>
    #14 0xb6dab280 in QDeclarativeComponent::QDeclarativeComponent (this=0x64748, engine=0x3bbb8, url=..., parent=0x3d9e0) at qml/qdeclarativecomponent.cpp:437
            d = <optimized out>
            d = <optimized out>
    #15 0xb6cc7274 in QDeclarativeViewPrivate::execute (this=0x458d8) at util/qdeclarativeview.cpp:173
            q = 0x3d9e0
    #16 0x00011bcc in main (argc=1, argv=0xbe8c2e74) at ../deneme/main.cpp:43
            a = {<QCoreApplication> = {<QObject> = {_vptr.QObject = 0xb699a570 <vtable for QApplication+8>, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0xb5fd8a68 <qt_meta_stringdata_QObject> "QObject", data = 0xb5fd8b3c <qt_meta_data_QObject>, extradata = 0xb606d3cc <QObject::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0xb5f1657c <QObject::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}, d_ptr = {d = 0x2fbe8}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0xb60490b4 <qt_meta_stringdata_Qt> "Qt", data = 0xb604c9b8 <qt_meta_data_Qt>, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x27d78 <QObject::staticMetaObject>, stringdata = 0xb60528f8 <qt_meta_stringdata_QCoreApplication> "QCoreApplication", data = 0xb6052994 <qt_meta_data_QCoreApplication>, extradata = 0xb60706bc <QCoreApplication::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0xb5f5d3b8 <QCoreApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}, static self = 0xbe8c2d00}, static staticMetaObject = {d = {superdata = 0xb60728f4 <QCoreApplication::staticMetaObject>, stringdata = 0xb68b1c3c <qt_meta_stringdata_QApplication> "QApplication", data = 0xb68b1e24 <qt_meta_data_QApplication>, extradata = 0xb698f800 <QApplication::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0xb62f14f4 <QApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}}
            view = 0x3d9e0
    
    

    qmake.conf

    #
    
    # qmake configuration for building with arm-none-linux-gnueabi-g++
    
    #
    
    
    
    include(../../common/linux.conf)
    
    include(../../common/gcc-base-unix.conf)
    
    include(../../common/g++-unix.conf)
    
    include(../../common/qws.conf)
    
    
    
    # modifications to g++.conf
    
    QMAKE_CC                = arm-dspg-linux-gnueabi-gcc
    
    QMAKE_CXX               = arm-dspg-linux-gnueabi-g++
    
    QMAKE_LINK              = arm-dspg-linux-gnueabi-g++
    
    QMAKE_LINK_SHLIB        = arm-dspg-linux-gnueabi-g++
    
    
    
    # modifications to linux.conf
    
    QMAKE_AR                = arm-dspg-linux-gnueabi-ar cqs
    
    QMAKE_OBJCOPY           = arm-dspg-linux-gnueabi-objcopy
    
    QMAKE_STRIP             = arm-dspg-linux-gnueabi-strip
    
    
    
    # my modifications
    
    
    
    QMAKE_CFLAGS           += -g -funwind-tables -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a9 -mtune=cortex-a9 -fno-strict-aliasing -rdynamic -funwind-tables -mno-long-calls -fPIC -fsigned-char -D__SOFTFP__ -std=gnu++98
    
    QMAKE_CXXFLAGS         += $$QMAKE_CFLAGS -fno-exceptions $(CXXFLAGS_QT_WARN)
    
    
    
    load(qt_config)
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mertcanozdemir
      wrote on last edited by mertcanozdemir
      #2

      I found the solution. The problem was gcc 9 and foreach implementation in qt 4. If anyone encounters this problem you need to apply cxx11 and gcc9-qforeach patches from this link and compile qt without -std=gnu++98 flag
      http://git.pld-linux.org/gitweb.cgi?p=packages/qt4.git;a=commitdiff;h=b42b0c7fae8860fc46b9a9f4d937f4d8066f2daf#patch1

      1 Reply Last reply
      1

      • Login

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