[CRIU] crtools error: "can't splice to pipe"

Cyrill Gorcunov gorcunov at gmail.com
Tue May 13 12:21:58 PDT 2014


On Tue, May 13, 2014 at 10:58:25PM +0400, Andrew Vagin wrote:
> > But if it's enough just to get the required error, why not? ;)
> 
> I have read kernel code and found that __get_user_pages can stop if vma
> has the VM_IO flag.
> 
> This flag is set in remap_pfn_range(), which is used by video drivers.
> 
> To prove this version we need to look at /proc/PID/smaps. J F, could you
> attach /proc/PID/smaps for the checkpointed process.

I believe to make sure we're getting proper smaps, better to use a patch
for that. JF. apply the patch attached and run criu, we will see the
smaps contents.
-------------- next part --------------
diff --git a/proc_parse.c b/proc_parse.c
index 340ef7d3c5b3..ac9eb29b7a2a 100644
--- a/proc_parse.c
+++ b/proc_parse.c
@@ -269,6 +269,22 @@ int parse_self_maps_lite(struct vm_area_list *vms)
 
 static char smaps_buf[PAGE_SIZE];
 
+static void pr_debug_smaps(pid_t pid)
+{
+	FILE *smaps = NULL;
+
+	smaps = fopen_proc(pid, "smaps");
+	if (!smaps)
+		return;
+
+	setvbuf(smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
+	pr_debug("--- /proc/%d/smaps ---\n", pid);
+	while (fgets(buf, BUF_SIZE, smaps))
+		pr_debug("%s", buf);
+	pr_debug("----------------\n");
+	fclose(smaps);
+}
+
 int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, bool use_map_files)
 {
 	struct vma_area *vma_area = NULL;
@@ -286,6 +302,8 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, bool use_map_file
 	vma_area_list->priv_size = 0;
 	INIT_LIST_HEAD(&vma_area_list->h);
 
+	pr_debug_smaps(pid);
+
 	smaps = fopen_proc(pid, "smaps");
 	if (!smaps)
 		goto err;


More information about the CRIU mailing list