How can I debug this User Space application error?

I am running a Qt5.4.0 application on my embedded Linux system (based on TI AM335x) and it stops and I am having a hard time debugging this. This is a QtWebKit QML example (youtubeview), but other QtWebKit examples are the same for me as they are for WebKit based on my system.

When I start the application, it starts up for a second or so and then ends without messages. Nothing is reported to syslog and dmesg. When I start with strace I see this futex message:

futex(0x2d990, FUTEX_WAKE_PRIVATE, 1)   = 0
futex(0x2d9ac, FUTEX_WAIT_PRIVATE, 7, NULL <unfinished ...>
+++ exited with 1 +++

      

Then he stops. Not very helpful ... My next one, although it should have debugged this with GDB, GDB crashes when I try to run this:

-sh-4.2 # gdb youtubeview
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
...
(gdb) run
Startup program: / usr / share / qt5 / examples / webkitqml / youtubeview / youtubeview
/ home / mike / ulf_qt_450 / ulf / build-ulf / out / work / armv7ahf-vfp-neon-linux-gnueabihf /gdb/7.5-r0.0/gdb-7.5/gdb/utils.c:1081: Internal error: Out of virtual memory: Unable to allocate 64652911 bytes.
Found a problem internal to GDB,

This problem occurs even if I first set a breakpoint in main, as soon as it starts running it gets stuck and ends out of memory.

  • Are there other tools or techniques that can be used here to help isolate the problem?
  • Perhaps the GDB arguments limit memory usage, or provide additional information as to why this Qt program made it crash?
  • Perhaps some FD or system variables I could use to figure out why FUTEX is being held and failing?

I'm not sure where to get this problem right now.

The Qt code itself is pretty simple and I don't expect any problems here:

#include <QGuiApplication>
#include <QQuickView>
int main(int argc, char* argv[])
{
    QGuiApplication app(argc,argv);
    QQuickView view;
    view.setSource(QUrl("qrc:///" QWEBKIT_EXAMPLE_NAME ".qml"));
    view.setResizeMode(QQuickView::SizeRootObjectToView);
    view.show();
    return app.exec();
return 0;
}

      

+3


source to share


1 answer


Running gdb on a device, especially with a huge library like WebKit, will inevitably lead to memory errors. Instead, start gdbserver on the device and connect to it via gdb running on the host using the crosschd binding. In this case, gdb on the host loads all the debug information, while gdbserver on the device needs almost no memory. It is also possible to have separate debug information on the host and shared libraries on the device.

Note that parts of WebKit are always built in release mode, even if the rest of Qt was built in debug mode, if you intend to debug WebKit you can change this in the build system.

Here's a minimal example:

Device:



# gdbserver 192.168.1.2:12345 myapp
Process myapp created; pid = 989
Listening on port 12345

      

Leading:

# arm-none-linux-gnueabi-gdb myapp
GNU gdb (Sourcery G++ Lite 2009q1-203) 6.8.50.20081022-cvs
(gdb) set solib-absolute-prefix /opt/targetroot
(gdb) target remote 192.168.1.42:12345
Remote debugging using 192.168.1.42:12345
(gdb) start
The "remote" target does not support "run".  Try "help target" or "continue".
(gdb) break main
Breakpoint 1 at 0x1ab9c: file myapp/main.cpp, line 12.
(gdb) cont
Continuing.
Breakpoint 1, main (argc=1, argv=0xbecfedb4) at myapp/main.cpp:12
12          QApplication app(argc, argv, QApplication::GuiServer);

      

And you are correct that it looks like a problem in QtWebKit itself, not in your application. Good luck!

+2


source







All Articles