Nominate our 2022 Qt Champions!

Qt app freezes when touch screen after a time

  • Hello,

    I have a big problem with a qt app. The qt version is 5.9, build It in qt creator 4.2.1 and cross-compiler to an Imx6 Linux board.

    The Imx6 was built with Yocto 2.4.

    My qt app is a big project, has spi communication, date and time update with rtc driver, use qcustomplot to draw curves in real-time, use stylesheets files, use audio.

    I cant show my code because its a huge project but in a nutshell the app reads data from a memory connected by spi and shows these data in curves using qcustomplot. The app shows date and time from system and user car change them.

    The app is working but when it passes a few minutes the app freeze completely when the user touches the screen (touchscreen). I have reading a lot of posts in different forums, and many people had this "freeze" problem, but I haven't get any solution in nowhere, a read that It can be a deadlock because the program is locked for some reason in somewhere. When I use a mouse instead touchscreen the "freeze" problem doesn't happen.

    Y debugged the app from qt creator and when the program es "freeze" in qt creator I see the follows threads in backtrace:

    1 futex_wait_cancelable futex-internal.h 88 0x76437a24
    2 __pthread_cond_wait_common pthread_cond_wait.c 502 0x76437a24
    3 __pthread_cond_wait pthread_cond_wait.c 655 0x76437a24
    4 _XReply xcb_io.c 590 0x7580cd90
    5 _XSeqSyncFunction XlibInt.c 203 0x7580f544
    6 _XError XlibInt.c 1436 0x7580ee70
    7 handle_error xcb_io.c 199 0x7580bcb8
    8 handle_response xcb_io.c 311 0x7580bd6c
    9 _XReply xcb_io.c 640 0x7580cd58
    10 _XSeqSyncFunction XlibInt.c 203 0x7580f544
    11 _XError XlibInt.c 1436 0x7580ee70
    12 handle_error xcb_io.c 199 0x7580bcb8
    13 handle_response xcb_io.c 311 0x7580bd6c
    14 _XReply xcb_io.c 640 0x7580cd58
    15 _XSeqSyncFunction XlibInt.c 203 0x7580f544
    16 _XError XlibInt.c 1436 0x7580ee70
    17 handle_error xcb_io.c 199 0x7580bcb8
    18 handle_response xcb_io.c 311 0x7580bd6c
    19 _XReply xcb_io.c 640 0x7580cd58
    20 _XSeqSyncFunction XlibInt.c 203 0x7580f544
    21 _XError XlibInt.c 1436 0x7580ee70
    22 handle_error xcb_io.c 199 0x7580bcb8
    23 handle_response xcb_io.c 311 0x7580bd6c
    24 _XReply xcb_io.c 640 0x7580cd58
    25 _XSeqSyncFunction XlibInt.c 203 0x7580f544
    26 _XError XlibInt.c 1436 0x7580ee70
    27 handle_error xcb_io.c 199 0x7580bcb8
    28 handle_response xcb_io.c 311 0x7580bd6c
    29 _XReply xcb_io.c 640 0x7580cd58
    30 _XSeqSyncFunction XlibInt.c 203 0x7580f544
    31 _XError XlibInt.c 1436 0x7580ee70
    32 handle_error xcb_io.c 199 0x7580bcb8
    33 handle_response xcb_io.c 311 0x7580bd6c
    34 _XReply xcb_io.c 640 0x7580cd58
    35 _XSeqSyncFunction XlibInt.c 203 0x7580f544
    36 XIAllowTouchEvents XIAllowEvents.c 91 0x736a3c3c
    37 QHash<int, QPointF>::operator[] qhash.h 750 0x734f45f0
    38 QXcbConnection::xi2ProcessTouch qxcbconnection_xi2.cpp 722 0x734f45f0
    39 QXcbConnection::xi2HandleEvent qxcbconnection_xi2.cpp 580 0x734f4c1c
    40 QXcbConnection::handleXcbEvent qxcbconnection.cpp 1250 0x734d608c
    41 QVector<bool ( *)(QXcbConnection *, xcb_generic_event_t *)>::resize qvector.h 416 0x734d6480
    42 QVector<bool ( *)(QXcbConnection *, xcb_generic_event_t *)>::clear qvector.h 420 0x734d6480
    43 QXcbConnection::processXcbEvents qxcbconnection.cpp 1743 0x734d6480
    44 QObject::event qobject.cpp 1255 0x765fad14
    45 QApplicationPrivate::process_cmdline qapplication.cpp 488 0x76c5ce88
    46 ?? 0x3de9f0

    Any suggestion or any idea that I can handle this bug.


  • Check all std::threads and QThread in your code to see if any is locked and waits forever.

  • @JoeCFD Hi, thanks for response.
    I don't use threads or Qthreads in my code. I think that is an internal or library thread. Only occur with touch, no with a mouse.

Log in to reply