Important: Please read the Qt Code of Conduct -

QtWidget application: OK with mouse, Crashes with Touchscreen

  • I am running on a ARM based Linux device a very basic application with 1 QPushButton and 1 QLabel. I am experiencing this strange problem: if I use the mouse to interact with the app, all is OK. If I reconfigure the device in order to enable thetouchscree, when I touch the QPushbutton (or other) the app crashes with Segmentation Fault.
    Can anyone give me a suggestion to guide me in the right direction to solve the problem please? Thanks!

  • @sitti said in QtWidget application: OK with mouse, Crashes with Touchscreen:

    Can anyone give me a suggestion to guide me in the right direction to solve the problem please?

    Besides enabling debugging, are you able to run any other non-Qt application using the touchscreen?

  • make a debug build and show your backtrace here.

  • @JoeCFD You mean run it via debugger or simply make a debug build and run it on the device?

  • Lifetime Qt Champion

    @sitti Run a debug build in a debugger

  • @jsulm Still trying to debug my application via SSH with the built-in debugger in Qt Creator, but I get the following error message:

    The remote file system has only 0 megabytes of free space, but 5 megabytes are required.

    I don't think there is a real problem about space in the device.
    Anyone have any suggestion please?

  • Doing df -h on the device, I obtain the following:

    Filesystem                Size      Used Available Use% Mounted on
    /dev/root                25.3M     25.3M         0 100% /
    devtmpfs                234.3M         0    234.3M   0% /dev
    tmpfs                   234.6M         0    234.6M   0% /dev/shm
    tmpfs                   234.6M    232.0K    234.4M   0% /tmp
    ubi0:data               462.3M     83.8M    378.5M  18% /media/nand

  • Lifetime Qt Champion

    @sitti Root file system is indeed full. To which location do you deploy your app?

  • @jsulm you are right. I'm trying to figure out where that /dev/root came from. I want to deploy in /media/nand/project

  • I solved the space leakage adding my deploy path on "Remote path to check for free space" in Run Settings in Qt Creator.
    Now, when I launch the application in the debugger, it does not start, and the following error message appears on the output console:

    Process /media/nand/project/verySimpleApp created; pid = 3569
    File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
    Unable to find dynamic linker breakpoint function.
    GDB will be unable to debug shared library initializers
    and track explicitly loaded dynamic code./media/nand/project/verySimpleApp: error while loading shared libraries: cannot open shared object file: No such file or directory

    In the device, the Qt libraries are in a custom path, and I add that path to the LD_LIBRARY_PATH environmental variable. In fact, if I run the application directly on the device, it starts. Have I to tell the debugger where the Qt libraries on the target are?

  • @jsulm Ok, I solved the missing library issue by adding the proper environmental variables in the Environment field Project -> Run in Qt Creator. Now I am able to deploy my application.
    Returning to the main topic:

    • I run a debug build of my application in the debugger
    • When I touch for the first time the screen, the application crashes
      In the application Output window there are no insteresting messages, but a pop up appears with the following error:
    The inferior stopped because it received a signal from the operating system.
    Signal name : SIGSEGV
    Signal meaning : Segmentation fault

    Running the app with the debugger, I was hoping to have some additional information .. Any help is appreciated.

  • Lifetime Qt Champion

    @sitti If you run through debugger there must be more information in the debug view (the stack trace). So, please take closer look at debug output.

  • The problem is that I have no idea where to put a breakpoint to stop the execution and go step by step, because the app crashes when I touch the screen before any slot is called..

  • Lifetime Qt Champion

    @sitti There is no need to put any break points in this case. Simply start the app through debugger, after it crashes close the dialog telling you that it crashed and then check the stack trace in debugger view.

  • @jsulm I's sorry, perhaps I have a non.standard view. Please explain me what do you mean with "stack trace in the debugger view". Below is my view when I close the dialog containing the error message:

  • Lifetime Qt Champion

    @sitti said in QtWidget application: OK with mouse, Crashes with Touchscreen:

    stack trace in the debugger view"

    Stack trace is what you see in your screen shot in bottom left corner. It shows the chain of calls leading to the crash.
    Please build in debug mode to get readable information...

  • @jsulm thanks, now that's clear. There should be another issue, because I am actually running in debug mode:

  • Lifetime Qt Champion

    @sitti said in QtWidget application: OK with mouse, Crashes with Touchscreen:

    I am actually running in debug mode

    What I mean is: build first in debug mode, not in release mode, then run through debugger.

  • @jsulm It is actually what I am doing.

Log in to reply