-
Notifications
You must be signed in to change notification settings - Fork 599
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
CRIU can't dump memfd_secret
fd containing process
#2188
Comments
dump.log:
|
I'm stuck figuring out why the CRIU dump process fails at |
|
Hi @warusadura problem is that this execution path is wrong. For some reason during processing of memfd_secretfd you are getting into the For example, read Line 189 in 4f3d6e6
Another point of interest for you is this place: Line 565 in 4f3d6e6
here we assigning a proper dump callback ops depending on the file descriptor type. Now about mounts and why you are getting this error. It's a implementation detail of a linux kernel, almost any types of a file descriptors in Linux kernel has some filesystem under the hood. For regular files it can be xfs, ext4, btrfs, ntfs and so on, for sockets it is sockfs, for pipes it is pipefs, for block devices it is bdev. But you can't mount pipefs, sockfs or bdev by yourself. It's kind of a magic filesystems (and hidden mounts) those are only existing behind the scene and that's why you can't see them in |
thanks @mihalicyn |
I'm trying to implement a similar function to the following, for
I can't figure out the reason behind this comparison:
And in
|
new changes diff,
|
reason of this comparison is to determine if this particular file descriptor is the memfd file descriptor or not. As you can see from this code Line 564 in 4f3d6e6
ops with corresponding value memfd_dump_ops .
Each file descriptor in Linux kernel is unique somehow. For example, if you have a pipe/fifo fd then you can easily distinguish it just by doing
in the memfd case we have managed to find a proper way to distinguish it from other file descriptors those are look like a "regular files". We are doing it by checking
As you can see from the CRIU code:
we just open a memfd descriptor and then saving st_dev from |
thank you very much @mihalicyn . |
So @warusadura please try to follow a code path for so, technically you need to do the same thing as we did for memfd, but device node will be different. |
why do we set the |
because EFAULT is a correct value that |
understood, thanks @mihalicyn |
@mihalicyn I have implemented the helper function: But, I'm still stuck at properly implementing the
In memfd case, I have found that, both With memfd_secret case Also, where can I found the following,
git diff criu/files.c
|
they shouldn't be equal. for memfd_secret you should have |
understood, thanks @mihalicyn |
@mihalicyn @rppt Now I'm currently implementing the Since
Should there be more member for Also, when we talk about inodes related to criu dump we are only concerned about the inodes for the contents of Also, related to implementation of
|
current:
|
Great!
I don't know, try to understand from the existing memfd code why we have these fields and whats the purpose of them ;-)
I'm not sure that I understand question, but generally we don't care about inode numbers, but we care about inodes content (file content). Self-control question: why do we need
|
thanks Alex! @mihalicyn |
@mihalicyn @rppt
Also, in
|
Hi @warusadura have you tried to read |
@mihalicyn yeah I did. |
great, then try to take |
thanks @mihalicyn |
memfd-secret.c
As of now dump fails with the following error,
line: How can set an appropriate value for I think the origin of |
Hi @warusadura!
You don't need to set any value to Line 342 in 4d137b8
and it's the index of a file descriptor to dump. Most likely you are getting You can use But in case of |
thanks @mihalicyn
No, I did not :D I'm guessing it comes from here. I tried to figure this out with |
Yeah, I think so too. |
I strongly recommend you to pay some time to understand how this machinery works. |
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
See "man 2 memfd_secret". Fixes: checkpoint-restore#2188 Signed-off-by: Dhanuka Warusadura <[email protected]>
dumpee src:
dumpee
criu dump:
sudo ./criu/criu dump --shell-job -D dumpdir/ -v4 -t 3959
to reproduce this:
Please apply the following
diff
otherwise the dump will fail at:vma_get_mapfile
The text was updated successfully, but these errors were encountered: