[CRIU] Using p.haul migration failure

Pavel Emelyanov xemul at parallels.com
Tue Oct 28 04:57:54 PDT 2014


On 10/28/2014 06:07 AM, Sowmini Varadhan wrote:
> On (10/27/14 17:21), Pavel Emelyanov wrote:
>>
>> Pre-dump logs terminate at collect_mntinfo() and the criu just quits.
>> This typically happens when it crashes somewhere afterwards, so it
>> would be useful if you could help us fining out where.
>>
> 
> It's seg-faulting here:
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000046624d in validate_mounts (info=0x114e050, for_dump=true)
>     at mount.c:433
> 433                                             ret = run_plugins(DUMP_EXT_MOUNT, m->mountpoint, m->mnt_id);

Ah, I see. This is a pre-dump during which plugins are not initialized,
but mount.c tries to call them on unsupported (external?) mountpoint.

> Is there something wrong with these values? How to tell? How to validate
> this data?

No, the problem is in plugins are called for unsupported mount points,
while not initialized. Can you check this patch:

diff --git a/include/namespaces.h b/include/namespaces.h
index 9b93b29..79327f5 100644
--- a/include/namespaces.h
+++ b/include/namespaces.h
@@ -48,7 +48,7 @@ extern struct collect_image_info nsfile_cinfo;
 
 extern int walk_namespaces(struct ns_desc *nd, int (*cb)(struct ns_id *, void *), void *oarg);
 extern int collect_namespaces(bool for_dump);
-extern int collect_mnt_namespaces(void);
+extern int collect_mnt_namespaces(bool for_dump);
 extern int dump_mnt_namespaces(void);
 extern int dump_namespaces(struct pstree_item *item, unsigned int ns_flags);
 extern int prepare_namespace(struct pstree_item *item, unsigned long clone_flags);
diff --git a/mount.c b/mount.c
index a60c86e..59ffe53 100644
--- a/mount.c
+++ b/mount.c
@@ -2097,7 +2097,7 @@ static int collect_mntns(struct ns_id *ns, void *oarg)
 	return 0;
 }
 
-int collect_mnt_namespaces(void)
+int collect_mnt_namespaces(bool for_dump)
 {
 	int need_to_validate = 0, ret;
 
@@ -2105,7 +2105,7 @@ int collect_mnt_namespaces(void)
 	if (ret)
 		goto err;
 
-	if (need_to_validate) {
+	if (for_dump && need_to_validate) {
 		if (collect_shared(mntinfo))
 			goto err;
 		if (validate_mounts(mntinfo, true))
diff --git a/namespaces.c b/namespaces.c
index 87849fa..481b23d 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -574,7 +574,7 @@ int collect_namespaces(bool for_dump)
 {
 	int ret;
 
-	ret = collect_mnt_namespaces();
+	ret = collect_mnt_namespaces(for_dump);
 	if (ret < 0)
 		return ret;
 

---

Please, note, that your dump stage will fail anyway, as there are some
mount points in your program, that CRIU doesn't support for now. Let's
check what it is.

Thanks,
Pavel




More information about the CRIU mailing list