Open
Description
Is your feature request related to a problem? Please describe
Debugging software with rr in Gitpod currently doesn't work:
# Install rr
$ cd /tmp && wget https://github.com/rr-debugger/rr/releases/download/5.5.0/rr-5.5.0-Linux-$(uname -m).deb && sudo dpkg -i rr-5.5.0-Linux-$(uname -m).deb
# Try rr with any binary
$ cd - && rr record ./binary
rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 2.
Change it to 1, or use 'rr record -n' (slow).
Consider putting 'kernel.perf_event_paranoid = 1' in /etc/sysctl.d/10-rr.conf.
See 'man 8 sysctl', 'man 5 sysctl.d' (systemd systems)
and 'man 5 sysctl.conf' (non-systemd systems) for more details.
Initially reported by William Durand from Mozilla: https://twitter.com/couac/status/1521092130890031105
Describe the behaviour you'd like
I suspect this fails because Gitpod's seccomp profile disables the syscall perf_event_open
by default.
I also believe that we could allow perf_event_open
in Gitpod, provided there aren't any major security issues.
This would allow Gitpod users to benefit from the powerful and popular record-replay debugger rr
.
Describe alternatives you've considered
Additional context
To work properly, rr
needs:
- the
CAP_SYS_PTRACE
capability (already granted since GDB isn't working #544)
... as well as a seccomp profile that allows:
- the
ptrace
syscall (I believe this is allowed by default in Linux kernels >= 4.8) - the
perf_event_open
syscall (I believe this is disabled by default) - and maybe the
process_vm_writev
syscall too (but let's focus onperf_event_open
first)
Sources: