[CRIU] criu fails to dump JVM processes due to a half-closed socketpair()

Pavel Emelyanov xemul at parallels.com
Tue Jul 2 06:36:32 EDT 2013


On 07/02/2013 05:19 PM, Florian Gross wrote:
> Hey there,
> 
[snip]
> Unfortunately, criu fails to dump half-closed socket pairs. To confirm this, I wrote this
> minimal C program, which criu fails to dump with the same symptoms [3]:
> 
> 	#include <sys/socket.h>
> 	#include <stdio.h>
> 	#include <unistd.h>
> 
> 	int main(int argc, char** argv) {
> 	  int sp[2];
> 
> 	  if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) {
> 	    perror("Failed to get socketpair");
> 	  }
> 
> 	  close(sp[1]);
> 
> 	  for (;;) { sleep(1000); }
> 	}

Wow! That's a NICE test case, thank you for that :)
 
> 
> So here's my question: Would it be possible to specially detect this case and just create a
> new half-open socketpair on restore? Or is there a better solution? This would help in supporting
> checkpointing of the Java VM, which would be very awesome. (I'm seeing the same behavior for both
> OpenJDK 6 and 7.)

Well, at first glance it's perfectly valid test-case, that should be covered by criu. I will
look at what can be done here and report back.

> Thanks a lot,
> Florian Gross

Thanks,
Pavel


More information about the CRIU mailing list