[CRIU] ptrace attached during a dump?

Pavel Emelyanov xemul at parallels.com
Wed Nov 20 07:56:28 PST 2013


On 11/20/2013 07:42 PM, Sebastian Biedermann wrote:
> Hi guys!
> 
> I'm wondering if you use ptrace attached/detached to a process once it
> is dumped.

We do, but we use the version that handles stopped state gracefully and
is called PTRACE_SEIZE.

> Actually I saw that ptrace gets only three times attached in the source
> code:
> 
> $ grep -r "PTRACE_ATTACH" ../crtools/
> ../crtools/cr-restore.c:                        if
> (ptrace(PTRACE_ATTACH, pid, 0, 0)) {
> ../crtools/test/zdtm/live/transition/ptrace.c:          if
> (ptrace(PTRACE_ATTACH, pids[i], (char *)1, NULL) == -1) {
> ../crtools/cr-check.c:  if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) == -1)
> 
> But I found out that once I dump a process ($ sudo ./crtools/criu dump
> -t 22459 --shell-job) none of them was used.
> Don't you attach ptrace once a process is dumped? However, if you use it
> for dumping, where in the code is it attached and detached?
> 
> Thank you!
> 

Thanks,
Pavel


More information about the CRIU mailing list