void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

Package request: gammaray

Open toluschr opened this issue 6 years ago • 8 comments

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
	}
}

toluschr avatar Jun 10 '20 11:06 toluschr

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.

furryfixer avatar Jun 10 '20 15:06 furryfixer

$ cat /etc/sysctl.conf
kernel.yama.ptrace_scope=0

fixes it

toluschr avatar Jun 10 '20 15:06 toluschr

I think the best way here would be to put a note about sysctl.conf in INSTALL, probably.

fosslinux avatar Jun 13 '20 03:06 fosslinux

Also I'm thinking that the package could be split further. Debian repos have a package for each plugin.

toluschr avatar Jun 13 '20 12:06 toluschr

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?

toluschr avatar Jun 13 '20 12:06 toluschr

Looks good too me. Are these "injectors" required for general operation of this tool?

fosslinux avatar Jun 13 '20 22:06 fosslinux

Looks good too me. Are these "injectors" required for general operation of this tool?

They are not required, but the default method of injecting.

toluschr avatar Jun 14 '20 07:06 toluschr

The PR for the package has been merged. Shouldn’t this issue be closed then?

ghost avatar Aug 20 '20 19:08 ghost