snapd icon indicating copy to clipboard operation
snapd copied to clipboard

interfaces/builtin/debugger_support: Add new interface to support debugging tools

Open locnnil opened this issue 1 year ago • 2 comments

Currently, there is no interface that supports debugging scenarios where such features like breakpoints (usage of ptrace syscall) are possible without classic confinement.

These changes were tested against parca-agent and Valgrind as reference software to be supported by this new interface.

locnnil avatar Aug 01 '24 03:08 locnnil

Tracing capabilities for software like parka or other observability frameworks need are IMO desired and we should look into supporting them, perhaps by extending system-trace interface. However, I am not quite sure about typical debugger support. It sounds more like a thing that would usually require classic given that debugger can pretty much do arbitrary things to the inferior process. One possible option I see is Ubuntu Core with gdbserver controlling a process within a snap. which is already be supported by snap run --gdbserver and the relevant gdbserver binary is part of the core* snaps.

bboozzoo avatar Aug 01 '24 09:08 bboozzoo

The main goal is to be able to solve this issue with ssdd on rt-tests-snap. The first idea was to try to have a supper-privilege interface that gives access to ptrace, but it's well known that due to maintenance problems it's not good to have such too scoped interfaces.

Then, after a discussion, the idea of creating a debugger-support interface emerges, putting more access into it than have ptrace only. But as you pointed @bboozzoo, maybe it would be a better idea to extend another interface.

My concern is: Can I consider this problem with ptrace not relevant anymore? Since the system-trace already have CAP_SYS_ADMIN enabled?

locnnil avatar Aug 01 '24 13:08 locnnil

Closing this since the idea was discussed, and I come to the conclusion that what we already have it's good enough!

Thanks for all the feedback Maciej.

locnnil avatar Oct 11 '24 15:10 locnnil