[CRIU] Help dumping and restoring a process

Jose Atiles jxatiles at hotmail.com
Wed Aug 22 06:53:05 MSK 2018


Hi, thanks for your replies.

I have attempted to dump/checkpoint the following programs in Linux Mint 19 Matte:
Calculator, XED text pad, Firefox latest version, TuxPuck pong game.
All those were simply "test runs", as my target is to run a windows game application through Wine,
or even an Emulator like Citra. Either way, single player, non online games/apps.

I'm using CRIU 3.6-2.

Since Radostin suggested running the application with a container like docker, I have been researching that approach. There seems to be a bug in the current Docker version, that breaks CRIU checkpoint ability.
This is based on the following article. There the author describes a workaround by installing an old version of Docker; sadly I'm still waiting a reply, because I can not reproduce the steps he describes.
https://technology.amis.nl/2018/04/08/first-steps-with-docker-checkpoint-to-create-and-restore-snapshots-of-running-containers/#comment-9763


Other sources I've been researching are:
https://github.com/martynjarvis/wine-nvidia-base

https://marmelab.com/blog/2018/03/21/using-nvidia-gpu-within-docker-container.html

https://github.com/NVIDIA/nvidia-docker


I went with the Docker approach because vnc seemed a bit more complicated. Is the Docker approach non viable? Is VNC the only alternative?
<https://github.com/NVIDIA/nvidia-docker>


________________________________
From: Adrian Reber <adrian at lisas.de>
Sent: Tuesday, August 21, 2018 5:50 AM
To: Jose Atiles
Cc: criu at openvz.org
Subject: Re: [CRIU] Help dumping and restoring a process

On Sat, Aug 18, 2018 at 02:32:03AM +0000, Jose Atiles wrote:
> Hi, I'm interested in using criu to do debugging in games, saving a checkpoint to recreate bugs. Also to provide saving to games who do not have this feature.
> My end target is saving a game that is being executed with wine. I'm currently using Linux mint 19 Mate 19.
>
> I have tried to dump a process but have failed.
> Also, criu check --extra says Looks good.
>
> I did a small test trying to checkpoint a calculator, a text editor and Firefox, but none seem to work. Can you provide me some usage examples? can you tell me one basic type of application which I could use to test CRIU?

Like Radostin said, you cannot checkpoint applications which are using
the GUI without running in VNC. Which makes it pretty unusable for
games. If the game would be two parts, one server without GUI and a
'dumb' GUI you could checkpoint the server. But I doubt any single
player game is written  like that.

> The following is my log file, please help me!
>
> ies at mint:~$ sudo su
> [sudo] password for aries:
> root at mint:/home/aries# criu dump -D checkpoint -t 7909
> Warn  (criu/kerndat.c:659): Can't load /run/criu.kdat
> Error (criu/image.c:416): Can't open dir checkpoint: No such file or directory

That is easy. The destination directory does not exist.

> root at mint:/home/aries# criu dump -D /home/aries/Documents/test -t 7909
> Error (criu/namespaces.c:408): Can't dump nested net namespace for 8026
> Error (criu/namespaces.c:626): Can't make netns id
> Error (criu/cr-dump.c:1709): Dumping FAILED.
> root at mint:/home/aries# criu dump -D "/home/aries/Documents/test" -t 7909
> Error (criu/namespaces.c:408): Can't dump nested net namespace for 8026
> Error (criu/namespaces.c:626): Can't make netns id
> Error (criu/cr-dump.c:1709): Dumping FAILED.
> root at mint:/home/aries# criu dump -D /home/aries/Documents/test -t 7909
> Error (criu/namespaces.c:408): Can't dump nested net namespace for 8026
> Error (criu/namespaces.c:626): Can't make netns id
> Error (criu/cr-dump.c:1709): Dumping FAILED.
> root at mint:/home/aries# criu dump -D /home/aries/Documents/test -t 17604
> Warn  (compel/arch/x86/src/lib/infect.c:249): Will restore 17604 with interrupted system call
> Warn  (compel/arch/x86/src/lib/infect.c:249): Will restore 17608 with interrupted system call
> Warn  (compel/arch/x86/src/lib/infect.c:249): Will restore 17609 with interrupted system call
> Warn  (compel/arch/x86/src/lib/infect.c:249): Will restore 17610 with interrupted system call
> Error (criu/cr-dump.c:431): Task 17604 with SysVIPC shmem map @7fb97f613000 doesn't live in IPC ns
> Error (criu/cr-dump.c:1411): Dump mappings (pid: 17604) failed with -1
> Error (criu/cr-dump.c:1709): Dumping FAILED.

All those attempts failed. Would be interesting to know what you are
trying to dump. You also need to have all processes involved in IPC
communication be part of the checkpoint. Namespaces are an easy way to
solve this.

> root at mint:/home/aries# criu restore -d  -D /home/aries/Documents/test
> Error (criu/util.c:596): Can't read link of fd -404: No such file or directory
> Error (criu/protobuf.c:75): Unexpected EOF on (null)

All your attempts to restore a process make no sense as all checkpoint
attempts failed.

[...]

> root at mint:/home/aries# criu dump -D ./home/aries/Documents/test -t 17604
> Error (criu/image.c:416): Can't open dir ./home/aries/Documents/test: No such file or directory

This is just wrong usage of a directory path.

> root at mint:/home/aries# cd /home/aries/Documents/test
> root at mint:/home/aries/Documents/test# criu dump -D /home/aries/Documents/test -t 17604
> Warn  (compel/arch/x86/src/lib/infect.c:249): Will restore 17604 with interrupted system call
> Warn  (compel/arch/x86/src/lib/infect.c:249): Will restore 17608 with interrupted system call
> Warn  (compel/arch/x86/src/lib/infect.c:249): Will restore 17609 with interrupted system call
> Warn  (compel/arch/x86/src/lib/infect.c:249): Will restore 17610 with interrupted system call
> Error (criu/cr-dump.c:431): Task 17604 with SysVIPC shmem map @7fb97f613000 doesn't live in IPC ns
> Error (criu/cr-dump.c:1411): Dump mappings (pid: 17604) failed with -1
> Error (criu/cr-dump.c:1709): Dumping FAILED.
> root at mint:/home/aries/Documents/test# criu check --extra
> Looks good.
> root at mint:/home/aries/Documents/test# test/zdtm.py run -a
> bash: test/zdtm.py: No such file or directory
> root at mint:/home/aries/Documents/test# cd ..
> root at mint:/home/aries/Documents# cd ..
> root at mint:/home/aries# cd ..
> root at mint:/home# cd ..
> root at mint:/# test/zdtm.py run -a
> bash: test/zdtm.py: No such file or directory
> root at mint:/# cd home
> root at mint:/home# test/zdtm.py run -a
> bash: test/zdtm.py: No such file or directory
> root at mint:/home# cd aries
> root at mint:/home/aries# test/zdtm.py run -a
> bash: test/zdtm.py: No such file or directory

Running zdtm also seems wrong unless you have installed CRIU from
source.

Please provide more details about the used CRIU version and the programs
you are trying to checkpoint.

                Adrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20180822/461eaa0f/attachment-0001.html>


More information about the CRIU mailing list