-
Notifications
You must be signed in to change notification settings - Fork 284
Known Issues
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.
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.
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:
- Ubuntu 10.10, 11.04 (Bug report: https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/906014)
If you are affected by this, try the gdb or style injectors instead, using the "-i" command line option.
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.
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:
- http://askubuntu.com/questions/41629/after-upgrade-gdb-wont-attach-to-process
- https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace_Protection
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 to work when build for 32bit systems on Mac. No workaround is currently known.
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.
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.