checkpoint-restore / criu

Checkpoint/Restore tool
criu.org
Other
2.97k stars 596 forks source link

CRIU unable to dump a process which is monitored by userfaultfd #2021

Open itayslepian opened 1 year ago

itayslepian commented 1 year ago

Description

We are trying to do migrations with CRIU to a process which is also monitored by Userfaultfd. We are running on Ubuntu18.04, linux kernel 5.15 When dumping the pid, we receive the following error:

(00.026780) Error (criu/files-ext.c:94): Can't dump file 3 of that type [600] (anon anon_inode:[userfaultfd])

Steps to reproduce the issue:

  1. Run userfaultfd_demo.c from https://man7.org/linux/man-pages/man2/userfaultfd.2.html#EXAMPLE
  2. Dump the pid of by using CRIU through terminal: sudo criu  dump -vvvv -o dump.log -t --shell-job && echo OK

CRIU logs and information:

CRIU full dump/restore logs:

Attached is a file named LOG.txt ``` ```

Output of `criu --version`:

``` Version: 3.17 GitID: v3.17-117-g50db2be1a ```

Output of `criu check --all`:

``` Warn (criu/cr-check.c:1347): Nftables based locking requires libnftables and set concatenations support Looks good but some kernel features are missing which, depending on your process tree, may cause dump or restore failure. ```

LOG.txt

adrianreber commented 1 year ago

Thanks for opening. At this point I am not aware of anyone working on this, so right now we cannot really help you unless you have an idea how to implement this in CRIU.

mihalicyn commented 1 year ago

That's a pretty interesting but really hard-to-implement feature.

I'm not an expert in memory management and uffd but as I can see we need: