Skip to content
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

Attaching rr record to an already running process #3698

Open
agentzh opened this issue Feb 26, 2024 · 1 comment
Open

Attaching rr record to an already running process #3698

agentzh opened this issue Feb 26, 2024 · 1 comment

Comments

@agentzh
Copy link

agentzh commented Feb 26, 2024

I wonder if implementing such features is technically possible, and we're interested in helping.

It seems like we just need to use ptrace, etc., first to attach and stop the target, save the current execution state as a snapshot, and then record any events while letting the target continue running. Any other technical hurdles here?

And for rr replay, we can revive from the saved snapshot into a new process and make the history start from the snapshot state.

Sorry if it makes little sense. I have very limited knowledge about the rr internals atm.

Many thanks!

@rocallahan
Copy link
Collaborator

I thought we had an issue for this already but I can't find it.

Attaching is quite hard for a few reasons. We'd have to save the initial state as some kind of persistent checkpoint (see #2184) which would be at the start of the recording (which is not covered by #2184) and would break all kinds of assumptions. We'd have to inject librrpage.so and librrpreload.so somehow; the latter would be really hard. We'd have to collect state about the meaning of the currently open file descriptors, populate AddressSpace based on the current VMAs, etc etc. It actually sounds really hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants