Skip to content

Known Issues

Kevin Funk edited this page Jun 30, 2019 · 26 revisions

Known Issues

All Platforms

QtQuick 2 key event handling misbehaves (Qt5 <= 5.2.1)

The key event handling code in Qt Quick 2 changes behavior depending on whether its signals are connected or not. However, Qt also considers all signal to be connected if a signal spy callback (not to be confused with QSignalSpy) is registered. This is done by the GammaRay timer plug-in.

A fix for this has been integrated upstream (https://codereview.qt-project.org/#change,75530), for Qt 5.2.2 or later.

As a workaround, remove the timer plug-in (gammaray_timertop_plugin.so/dll) from your GammaRay installation.

Linux

Preloading

When launching an application using the Preload-Injector method, you may get this output:

Error: Symbol is not marked as relocatable: qt_startup_hook

The qt_startup_hook function is the entry point in qtcore we try to overwrite in order to hook ourselves into the target application. If this symbol isn't marked as relocatable (e.g. readelf --relocs --wide /path/to/Qt5Core.so | grep qt_startup_hook returns nothing), then the Preload-Injector method cannot function.

There are multiple causes for this issue.

Preloading fails with -Bsymbolic-function (Qt <= 5.3)

If your Qt is linked with "-Bsymbolic-function", preloading wont work. If used, references to global functions are bind to the shared object internally. The definition of the function is now fixed and cant be overwritten by preloading. Note that this is different from using -reduce-relocations from Qt's configure command, this will add exceptions for the preloading hooks we (and also e.g. Squish) need.

Be sure that your distro provided packages or your self-compiled packages are not linked with this flag (check with echo $LDFLAGS before compiling) without including the exception from src/corelib/QtCore.dynlist. For more info see: "man ld; search for "-Bsymbolic-function".

Affected distros:

If you are affected by this, try the gdb or style injectors instead, using the "-i" command line option.

Preloading fails with -reduce-relocations and the gold linker (Qt <= 5.3)

Similar issue as the one above, but here also the -reduce-relocations flag of Qt's configure is affected. The gold linker does not seem to support adding exceptions to the -Bsymbolic-functions option yet, so the hooks we need in QtCore wont work. (Issue is tracked here: http://sourceware.org/bugzilla/show_bug.cgi?id=13577 [Marked as RESOLVED])

Note that -reduce-relocations is enabled by default in Qt5.

Workarounds are either not using -no-reduce-relocations in combination with gold when compiling Qt or using a differerent GammaRay injection method. Both the gdb and style injectors still work in this case.

GDB method fails to attach to running process

First, note that you do not need to run gammaray as root to attach to user-space processes. It's fine to run gammaray as user, as long as the following conditions are met.

Ubuntu (and probably other distros) have a kernel security feature that disallows attaching to other processes. The message you'll get when trying to do so looks like this:

Could not attach to process.
If your uid matches the uid of the target process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try again as the root user.
For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.

... or this:

Potential errors:
  Error: gdb: Yama security extension is blocking runtime attaching, see /proc/sys/kernel/yama/ptrace_scope
  ...

In case that happens please read the following resources:

Mac

Undefined behavior when using app bundles containing Qt

When attaching GammaRay to an app bundle that contains its own Qt version, GammaRay may additionally load the Qt libraries it has been linked against. This will cause undefined behavior even if these are exactly the same Qt versions as static variables are overwritten in the process.

So far, the only workaround is adding GammaRay to the same app bundle.

GammaRay fails when build for 32bit

GammaRay fails to work when build for 32bit systems on Mac. No workaround is currently known.

Windows

GammaRay not working in release mode (Qt < 5.4)

You either have to use debug builds of Qt, or use a different injection method ("style" should work, requires the use of the command line interface though). This got fixed in Qt 5.4.

Attaching not always working

GammaRay fails to attach to some applications.

Update to at least GammaRay 2.4.1 which contains the last set of improvements for this. If it still doesn't work, try launching your target with GammaRay, rather than attaching at runtime.