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. Buildroot + QT5 Crashes When Loading Virtual Keyboard
Forum Updated to NodeBB v4.3 + New Features

Buildroot + QT5 Crashes When Loading Virtual Keyboard

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

    Hello,

    I'm very new to QT5 so I apologize in advance if I'm missing something very obvious.

    I'm building a Buildroot-based image for the Raspberry Pi that includes QT5 application using a WebEngineView. Everything worked fine until I wanted to integrate a virtual keyboard and then the application started to segfault when loading the QML file. The same issue also happens with the virtual keyboard "basic" sample application so we can focus on that first.

    When running the example app, with debug logs enabled(QT_LOGGING_RULES="*.*=true" /usr/lib/qt/examples/virtualkeyboard/basic/basic) the last few lines of the output are:

    qt.qpa.input: evdevtouch: /dev/input/event0: Protocol type B  (multi), filtered=no
    qt.qpa.input: evdevtouch: /dev/input/event0: min X: 0 max X: 1279
    qt.scenegraph.general: threaded render loop
    qt.qpa.input: evdevtouch: /dev/input/event0: min Y: 0 max Y: 799
    qt.qpa.input: evdevtouch: /dev/input/event0: min pressure: 0 max pressure: 0
    qt.scenegraph.general: Using sg animation driver
    qt.qpa.input: evdevtouch: /dev/input/event0: device name: 10-0014 Goodix Capacitive TouchScreen
    qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
    qt.qml.diskcache: Error loading "qrc:/basic-b2qt.qml" from disk cache: "No such file or directory"
    

    I tried to build and run the application with GDB and got the following backtrace for the thread that segfault-ed:

    #0  0x0000007fa212e43c in QQmlPropertyCacheAliasCreator<QQmlTypeCompiler>::propertyDataForAlias(QmlIR::Object const&, QV4::CompiledData::Alias const&, int*, int*, QQmlPropertyData::Flags*, QQmlEnginePrivate*) () from /usr/lib64/libQt5Qml.so.5
    #1  0x0000007fa212e7bc in QQmlPropertyCacheAliasCreator<QQmlTypeCompiler>::appendAliasesToPropertyCache(QmlIR::Object const&, int, QQmlEnginePrivate*) () from /usr/lib64/libQt5Qml.so.5
    #2  0x0000007fa212c64c in QQmlComponentAndAliasResolver::resolveAliases(int) () from /usr/lib64/libQt5Qml.so.5
    #3  0x0000007fa212c810 in QQmlComponentAndAliasResolver::resolve() () from /usr/lib64/libQt5Qml.so.5
    #4  0x0000007fa212cd84 in QQmlTypeCompiler::compile() () from /usr/lib64/libQt5Qml.so.5
    #5  0x0000007fa20b441c in QQmlTypeData::compile(QQmlRefPointer<QQmlTypeNameCache> const&, QV4::ResolvedTypeReferenceMap*, std::function<QByteArray ()> const&) () from /usr/lib64/libQt5Qml.so.5
    #6  0x0000007fa20b7fd0 in QQmlTypeData::done() () from /usr/lib64/libQt5Qml.so.5
    #7  0x0000007fa20ac558 in QQmlDataBlob::tryDone() () from /usr/lib64/libQt5Qml.so.5
    #8  0x0000007fa20eed8c in QQmlTypeLoader::setCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*) () from /usr/lib64/libQt5Qml.so.5 #9  0x0000007fa20f2e88 in void QQmlTypeLoader::doLoad<CachedLoader>(CachedLoader const&, QQmlDataBlob*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
    #10 0x0000007fa20eedf0 in QQmlTypeLoader::loadWithCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
    #11 0x0000007fa20f1014 in QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5 #12 0x0000007fa20b701c in QQmlTypeData::resolveTypes() () from /usr/lib64/libQt5Qml.so.5
    #13 0x0000007fa20b8ac0 in QQmlTypeData::allDependenciesDone() () from /usr/lib64/libQt5Qml.so.5
    #14 0x0000007fa20eed5c in QQmlTypeLoader::setCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*) () from /usr/lib64/libQt5Qml.so.5
    #15 0x0000007fa20f2e88 in void QQmlTypeLoader::doLoad<CachedLoader>(CachedLoader const&, QQmlDataBlob*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
    #16 0x0000007fa20eedf0 in QQmlTypeLoader::loadWithCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
    #17 0x0000007fa20f1014 in QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
    #18 0x0000007fa20b701c in QQmlTypeData::resolveTypes() () from /usr/lib64/libQt5Qml.so.5
    #19 0x0000007fa20b8ac0 in QQmlTypeData::allDependenciesDone() () from /usr/lib64/libQt5Qml.so.5
    #20 0x0000007fa20eed5c in QQmlTypeLoader::setCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*) () from /usr/lib64/libQt5Qml.so.5
    #21 0x0000007fa20f2e88 in void QQmlTypeLoader::doLoad<CachedLoader>(CachedLoader const&, QQmlDataBlob*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
    #22 0x0000007fa20eedf0 in QQmlTypeLoader::loadWithCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
    #23 0x0000007fa20f1014 in QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
    #24 0x0000007fa20b701c in QQmlTypeData::resolveTypes() () from /usr/lib64/libQt5Qml.so.5
    #25 0x0000007fa20b8ac0 in QQmlTypeData::allDependenciesDone() () from /usr/lib64/libQt5Qml.so.5
    #26 0x0000007fa20ee9b8 in QQmlTypeLoader::setData(QQmlDataBlob*, QQmlDataBlob::SourceCodeData const&) () from /usr/lib64/libQt5Qml.so.5
    #27 0x0000007fa20eec88 in QQmlTypeLoader::setData(QQmlDataBlob*, QString const&) () from /usr/lib64/libQt5Qml.so.5
    #28 0x0000007fa20ef3f8 in QQmlTypeLoader::loadThread(QQmlDataBlob*) () from /usr/lib64/libQt5Qml.so.5
    #29 0x0000007fa20beccc in QQmlTypeLoaderThread::loadThread(QQmlDataBlob*) () from /usr/lib64/libQt5Qml.so.5
    #30 0x0000007fa2141f5c in QQmlThreadPrivate::threadEvent() () from /usr/lib64/libQt5Qml.so.5
    #31 0x0000007fa21421e8 in QQmlThreadPrivate::event(QEvent*) () from /usr/lib64/libQt5Qml.so.5
    #32 0x0000007fa1ae7da8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
    #33 0x0000007fa1ae8810 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQt5Core.so.5
    #34 0x0000007fa1b2599c in ?? () from /usr/lib64/libQt5Core.so.5
    #35 0x0000007f9f22ed54 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
    #36 0x0000007f9f22efb4 in ?? () from /usr/lib64/libglib-2.0.so.0
    #37 0x0000007f9f22f09c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
    #38 0x0000007fa1b254a0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
    #39 0x0000007fa1ae4ae0 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
    #40 0x0000007fa199e570 in QThread::exec() () from /usr/lib64/libQt5Core.so.5
    #41 0x0000007fa2141934 in QQmlThreadPrivate::run() () from /usr/lib64/libQt5Qml.so.5
    #42 0x0000007fa199f7d0 in ?? () from /usr/lib64/libQt5Core.so.5
    #43 0x0000007fa15817a8 in ?? () from /lib64/libc.so.6
    #44 0x0000007fa15d771c in ?? () from /lib64/libc.so.6
    

    I tried adding various prints to the function that crashes and can see some values that don't seem right. For example, the line that reads const int targetObjectIndex = objectForId(component, alias.targetObjectId); the component.id is -1 resulting with targetObjectIndex also equal to -1. This value is later used when executing QQmlPropertyCache *targetCache = propertyCaches->at(targetObjectIndex); which returns 0x18 as the value for targetCache and I believe the next line, where it tries to dereference targetCache causes the segmentation fault.

    Does anyone have any idea what might be missing causing this issue or can point me at where I should start looking?

    The specific tag used for q5declarative package is 51efb2ed2f071beda188270a23ac450fe4b318f7, qt5virtualkeyboard is at e8ae4757dd32e8dbf69a7c57f2bc5c1e238416db and QT5 is marked as version 5.15.8.

    Thanks in advance!

    S 1 Reply Last reply
    0
    • S Shmuelzon

      Hello,

      I'm very new to QT5 so I apologize in advance if I'm missing something very obvious.

      I'm building a Buildroot-based image for the Raspberry Pi that includes QT5 application using a WebEngineView. Everything worked fine until I wanted to integrate a virtual keyboard and then the application started to segfault when loading the QML file. The same issue also happens with the virtual keyboard "basic" sample application so we can focus on that first.

      When running the example app, with debug logs enabled(QT_LOGGING_RULES="*.*=true" /usr/lib/qt/examples/virtualkeyboard/basic/basic) the last few lines of the output are:

      qt.qpa.input: evdevtouch: /dev/input/event0: Protocol type B  (multi), filtered=no
      qt.qpa.input: evdevtouch: /dev/input/event0: min X: 0 max X: 1279
      qt.scenegraph.general: threaded render loop
      qt.qpa.input: evdevtouch: /dev/input/event0: min Y: 0 max Y: 799
      qt.qpa.input: evdevtouch: /dev/input/event0: min pressure: 0 max pressure: 0
      qt.scenegraph.general: Using sg animation driver
      qt.qpa.input: evdevtouch: /dev/input/event0: device name: 10-0014 Goodix Capacitive TouchScreen
      qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
      qt.qml.diskcache: Error loading "qrc:/basic-b2qt.qml" from disk cache: "No such file or directory"
      

      I tried to build and run the application with GDB and got the following backtrace for the thread that segfault-ed:

      #0  0x0000007fa212e43c in QQmlPropertyCacheAliasCreator<QQmlTypeCompiler>::propertyDataForAlias(QmlIR::Object const&, QV4::CompiledData::Alias const&, int*, int*, QQmlPropertyData::Flags*, QQmlEnginePrivate*) () from /usr/lib64/libQt5Qml.so.5
      #1  0x0000007fa212e7bc in QQmlPropertyCacheAliasCreator<QQmlTypeCompiler>::appendAliasesToPropertyCache(QmlIR::Object const&, int, QQmlEnginePrivate*) () from /usr/lib64/libQt5Qml.so.5
      #2  0x0000007fa212c64c in QQmlComponentAndAliasResolver::resolveAliases(int) () from /usr/lib64/libQt5Qml.so.5
      #3  0x0000007fa212c810 in QQmlComponentAndAliasResolver::resolve() () from /usr/lib64/libQt5Qml.so.5
      #4  0x0000007fa212cd84 in QQmlTypeCompiler::compile() () from /usr/lib64/libQt5Qml.so.5
      #5  0x0000007fa20b441c in QQmlTypeData::compile(QQmlRefPointer<QQmlTypeNameCache> const&, QV4::ResolvedTypeReferenceMap*, std::function<QByteArray ()> const&) () from /usr/lib64/libQt5Qml.so.5
      #6  0x0000007fa20b7fd0 in QQmlTypeData::done() () from /usr/lib64/libQt5Qml.so.5
      #7  0x0000007fa20ac558 in QQmlDataBlob::tryDone() () from /usr/lib64/libQt5Qml.so.5
      #8  0x0000007fa20eed8c in QQmlTypeLoader::setCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*) () from /usr/lib64/libQt5Qml.so.5 #9  0x0000007fa20f2e88 in void QQmlTypeLoader::doLoad<CachedLoader>(CachedLoader const&, QQmlDataBlob*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
      #10 0x0000007fa20eedf0 in QQmlTypeLoader::loadWithCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
      #11 0x0000007fa20f1014 in QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5 #12 0x0000007fa20b701c in QQmlTypeData::resolveTypes() () from /usr/lib64/libQt5Qml.so.5
      #13 0x0000007fa20b8ac0 in QQmlTypeData::allDependenciesDone() () from /usr/lib64/libQt5Qml.so.5
      #14 0x0000007fa20eed5c in QQmlTypeLoader::setCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*) () from /usr/lib64/libQt5Qml.so.5
      #15 0x0000007fa20f2e88 in void QQmlTypeLoader::doLoad<CachedLoader>(CachedLoader const&, QQmlDataBlob*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
      #16 0x0000007fa20eedf0 in QQmlTypeLoader::loadWithCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
      #17 0x0000007fa20f1014 in QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
      #18 0x0000007fa20b701c in QQmlTypeData::resolveTypes() () from /usr/lib64/libQt5Qml.so.5
      #19 0x0000007fa20b8ac0 in QQmlTypeData::allDependenciesDone() () from /usr/lib64/libQt5Qml.so.5
      #20 0x0000007fa20eed5c in QQmlTypeLoader::setCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*) () from /usr/lib64/libQt5Qml.so.5
      #21 0x0000007fa20f2e88 in void QQmlTypeLoader::doLoad<CachedLoader>(CachedLoader const&, QQmlDataBlob*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
      #22 0x0000007fa20eedf0 in QQmlTypeLoader::loadWithCachedUnit(QQmlDataBlob*, QV4::CompiledData::Unit const*, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
      #23 0x0000007fa20f1014 in QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) () from /usr/lib64/libQt5Qml.so.5
      #24 0x0000007fa20b701c in QQmlTypeData::resolveTypes() () from /usr/lib64/libQt5Qml.so.5
      #25 0x0000007fa20b8ac0 in QQmlTypeData::allDependenciesDone() () from /usr/lib64/libQt5Qml.so.5
      #26 0x0000007fa20ee9b8 in QQmlTypeLoader::setData(QQmlDataBlob*, QQmlDataBlob::SourceCodeData const&) () from /usr/lib64/libQt5Qml.so.5
      #27 0x0000007fa20eec88 in QQmlTypeLoader::setData(QQmlDataBlob*, QString const&) () from /usr/lib64/libQt5Qml.so.5
      #28 0x0000007fa20ef3f8 in QQmlTypeLoader::loadThread(QQmlDataBlob*) () from /usr/lib64/libQt5Qml.so.5
      #29 0x0000007fa20beccc in QQmlTypeLoaderThread::loadThread(QQmlDataBlob*) () from /usr/lib64/libQt5Qml.so.5
      #30 0x0000007fa2141f5c in QQmlThreadPrivate::threadEvent() () from /usr/lib64/libQt5Qml.so.5
      #31 0x0000007fa21421e8 in QQmlThreadPrivate::event(QEvent*) () from /usr/lib64/libQt5Qml.so.5
      #32 0x0000007fa1ae7da8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
      #33 0x0000007fa1ae8810 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQt5Core.so.5
      #34 0x0000007fa1b2599c in ?? () from /usr/lib64/libQt5Core.so.5
      #35 0x0000007f9f22ed54 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
      #36 0x0000007f9f22efb4 in ?? () from /usr/lib64/libglib-2.0.so.0
      #37 0x0000007f9f22f09c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
      #38 0x0000007fa1b254a0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
      #39 0x0000007fa1ae4ae0 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
      #40 0x0000007fa199e570 in QThread::exec() () from /usr/lib64/libQt5Core.so.5
      #41 0x0000007fa2141934 in QQmlThreadPrivate::run() () from /usr/lib64/libQt5Qml.so.5
      #42 0x0000007fa199f7d0 in ?? () from /usr/lib64/libQt5Core.so.5
      #43 0x0000007fa15817a8 in ?? () from /lib64/libc.so.6
      #44 0x0000007fa15d771c in ?? () from /lib64/libc.so.6
      

      I tried adding various prints to the function that crashes and can see some values that don't seem right. For example, the line that reads const int targetObjectIndex = objectForId(component, alias.targetObjectId); the component.id is -1 resulting with targetObjectIndex also equal to -1. This value is later used when executing QQmlPropertyCache *targetCache = propertyCaches->at(targetObjectIndex); which returns 0x18 as the value for targetCache and I believe the next line, where it tries to dereference targetCache causes the segmentation fault.

      Does anyone have any idea what might be missing causing this issue or can point me at where I should start looking?

      The specific tag used for q5declarative package is 51efb2ed2f071beda188270a23ac450fe4b318f7, qt5virtualkeyboard is at e8ae4757dd32e8dbf69a7c57f2bc5c1e238416db and QT5 is marked as version 5.15.8.

      Thanks in advance!

      S Offline
      S Offline
      Shmuelzon
      wrote on last edited by
      #2

      Never mind.. This is, apparently, the same issue as https://forum.qt.io/topic/143745/qtvirtualkeyboard-fails-on-embedded-buildroot-5-15-8. Switching from GCC 11 to GCC 10 "fixes" the issue.

      1 Reply Last reply
      0
      • S Shmuelzon 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