-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support rr debugger (record-replay) by allowing the syscall perf_event_open
in Gitpod workspaces
#9687
Comments
William also correctly pointed out that we might want to make sure
|
FWIW, this first warning cannot be solved currently. Creating the gitpod /tmp $ echo 'kernel.perf_event_paranoid = 1' | sudo tee /etc/sysctl.d/10-rr.conf
kernel.perf_event_paranoid = 1
gitpod /tmp $ cat /etc/sysctl.d/10-rr.conf
kernel.perf_event_paranoid = 1
gitpod /tmp $ sudo sysctl --system
[...]
* Applying /etc/sysctl.d/10-rr.conf ...
sysctl: setting key "kernel.perf_event_paranoid", ignoring: Read-only file system
[...] We can use
What do we do now? We build
|
kernel.perf_event_paranoid is a single global config setting for the whole kernel. It can't be set inside a container.
This is perf_event_open(2) being disallowed by the seccomp policy. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is still valid but without access to the Gitpod "hardware" (see quote above), there isn't a lot external contributors can do at the moment. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The CPU type was added to rr rr-debugger/rr#2872; so the biggest part is the docker configuration (and so far I've only seen an option to adjust the dockerd arguments, but not the arguments for docker run. Please add |
CAP_SYS_PTRACE probably isn't necessary these days. |
Can you please retest and adjust the rr wiki? |
That's not really a priority for me.
You can create your own seccomp profile e.g.
and then do Somebody could actually spend the time to come up with a minimal seccomp profile for rr itself but that's a non-trivial amount of work. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The question is (@jankeromnes ?): is there any reason to not allow |
@GitMensch I believe it should be safe to always allow However, we wouldn't want to use So, instead of entirely disabling seccomp in Gitpod, we should consider all syscalls separately (for example, when they can unlock super cool use cases like |
I'm totally fine with that.
So... I guess this is on the schedule now? |
It is not yet on the schedule. For it to be, we need to lobby Gitpod's workspace team into picking up this issue (hi @kylos101! 👋 😇) |
Any progress on getting |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sadly there is still no option to use |
@GitMensch Sadly there isn't yet. However, let's keep this issue open until there is. 👍 |
@jankeromnes You've previously said
and I agree, so... Who is the one that this issue is now depending on? Is @kylos101 "from Gitpod's workspace team" the right (and possibly only) one? If I understood this correctly this would add |
From SO:
This possibly is not enough for |
@jankeromnes Can you please try the steps outlined above for adding minimal perf counter support to GitPod? |
Is your feature request related to a problem? Please describe
Debugging software with rr in Gitpod currently doesn't work:
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:CAP_SYS_PTRACE
capability (already granted since GDB isn't working #544)... as well as a seccomp profile that allows:
ptrace
syscall (I believe this is allowed by default in Linux kernels >= 4.8)perf_event_open
syscall (I believe this is disabled by default)process_vm_writev
syscall too (but let's focus onperf_event_open
first)Sources:
The text was updated successfully, but these errors were encountered: