Package request: gammaray
System
- xuname:
Void 5.6.17_1 x86_64 AuthenticAMD notuptodate hold rrrrmmnFFFFFFFFFFFFFFFFFFFFFFFFFFFF - package:
gammaray-2.11.1
I'm requesting this because gammaray is present in most major distributions repositories and I'd like to debug Qt5 applications.
I already made a template. I encountered the following error when testing some of it's features, maybe it should be mentioned in a post installation message.
Startup: gammaray-launcher
Detaching: /usr/bin/gammaray --inprocess --probe qt5_14-x86_64 --no-listen --pid 31713
Working Directory: /home/tom
Detected ABI qt5_14-x86_64, using ABI qt5_14-x86_64.
Potential errors:
Error: gdb: Yama security extension is blocking runtime attaching, see /proc/sys/kernel/yama/ptrace_scope
Error: lldb: Yama security extension is blocking runtime attaching, see /proc/sys/kernel/yama/ptrace_scope
Uh-oh, there is no default attach injector on this platform.
See <https://github.com/KDAB/GammaRay/wiki/Known-Issues> for troubleshooting
# Template file for 'gammaray'
pkgname=gammaray
version=2.11.1
revision=1
build_style=cmake
configure_args="-DGAMMARAY_INSTALL_QT_LAYOUT=true -DECM_MKSPECS_INSTALL_DIR=/usr/lib/qt5/mkspecs/modules -DPLUGIN_INSTALL_DIR=/usr/lib/qt5/plugins/gammaray"
makedepends="qt5-devel"
short_desc="Tool to poke around in a Qt-application"
maintainer="toluschr <[email protected]>"
license="GPL-2.0-or-later"
homepage="https://github.com/KDAB/GammaRay"
distfiles="https://github.com/KDAB/GammaRay/releases/download/v${version}/${pkgname}-${version}.tar.gz"
checksum=87a1d72ad1ad6d1a0156c54a85b0976ab38c6a64136458ca7c4ee491566d25d0
LDFLAGS+="-Wl,-no-fatal-warnings"
pre_build() {
sed -e 's|plugins/gammaray|lib/qt5/plugins/gammaray|' -i CMakeLists.txt
}
gammaray-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision} ${makedepends}"
pkg_install() {
vmove usr/include
vmove usr/lib/cmake
vmove usr/lib/qt5/mkspecs
cd "${DESTDIR}"
for f in usr/lib/*.so; do [ -L "${f}" ] && vmove "${f}"; done
}
}
I am a little out of my depth here, but I suspect you need either gdb or preload as a dependency, or a default "injector" needs to be set in a config file somewhere.
$ cat /etc/sysctl.conf
kernel.yama.ptrace_scope=0
fixes it
I think the best way here would be to put a note about sysctl.conf in INSTALL, probably.
Also I'm thinking that the package could be split further. Debian repos have a package for each plugin.
I think the best way here would be to put a note about sysctl.conf in INSTALL, probably.
$ cat srcpkgs/gammaray/INSTALL.msg
The gdb and lldb injectors require kernel.yama.ptrace_scope to be set to 0.
This might reduce system security, as it allows regular users to inject into a non-child process.
# echo "kernel.yama.ptrace_scope=0" >> /etc/sysctl.conf
What about this?
Looks good too me. Are these "injectors" required for general operation of this tool?
Looks good too me. Are these "injectors" required for general operation of this tool?
They are not required, but the default method of injecting.
The PR for the package has been merged. Shouldn’t this issue be closed then?