<div dir="ltr">Attached the failure log. It&#39;s quite short, though. I don&#39;t think I&#39;ve changed anything else, but if this makes no sense then I can try rebuilding everything to ensure I&#39;ve got the right setup.<div><br></div><div><a href="https://gist.github.com/boucher/74805891264e042881aa">https://gist.github.com/boucher/74805891264e042881aa</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 30, 2015 at 8:29 AM, Andrew Vagin <span dir="ltr">&lt;<a href="mailto:avagin@odin.com" target="_blank">avagin@odin.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Boucher,<br>
<br>
Could you try out the attached patch?<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Jun 30, 2015 at 05:00:36PM +0300, Andrew Vagin wrote:<br>
&gt; On Wed, Jun 24, 2015 at 12:34:51PM -0700, Ross Boucher wrote:<br>
&gt; &gt; Here&#39;s the output same procedure without the restore-sibling option:<br>
&gt; &gt; <a href="https://gist.githubusercontent.com/boucher/b18593b9da2782d17e95/raw/strace.txt" rel="noreferrer" target="_blank">https://gist.githubusercontent.com/boucher/b18593b9da2782d17e95/raw/strace.txt</a><br>
&gt; &gt;<br>
&gt; &gt; It&#39;s rather long. I&#39;m not really sure how to read the strace output.<br>
&gt;<br>
&gt; Thank you.<br>
&gt;<br>
&gt; 16272 write(1023, &quot;(00.139818)      1: \t\tCreate transport fd /crtools-fd-1-5\n&quot;, 58) = 58<br>
&gt; 16272 socket(PF_LOCAL, SOCK_DGRAM, 0)   = 0<br>
&gt; 16272 bind(0, {sa_family=AF_LOCAL, sun_path=@&quot;/crtools-fd-1-5&quot;}, 18) = 0<br>
&gt; 16272 fcntl(5, F_GETFD)                 = -1 EBADF (Bad file descriptor)<br>
&gt; 16272 dup2(0, 5)                        = 5<br>
&gt;<br>
&gt; 16272 write(1023, &quot;(00.142054)      1: Found id pipe:[122747] (fd 8) in inherit fd list\n&quot;, 69) = 69<br>
&gt; 16272 dup(8)                            = 9<br>
&gt; 16272 write(1023, &quot;(00.142074)      1: File pipe:[122747] will be restored from fd 9 duped from inherit fd 8\n&quot;, 90) = 90<br>
&gt; 16272 fcntl(5, F_GETFD)                 = 0<br>
&gt; 16272 write(1023, &quot;(00.142095)      1: Error (util.c:131): fd 5 already in use (called at files.c:872)\n&quot;, 84) = 84<br>
&gt;<br>
&gt; Looks like we meet both ends of an inhereted pipe.<br>
&gt;<br>
&gt; The same problem can be reproduced by the pipes test with the following<br>
&gt; path:<br>
&gt;<br>
&gt; diff --git a/test/pipes/pipe.c b/test/pipes/pipe.c<br>
&gt; index cb34703..03efccc 100644<br>
&gt; --- a/test/pipes/pipe.c<br>
&gt; +++ b/test/pipes/pipe.c<br>
&gt; @@ -232,7 +232,7 @@ int main(int argc, char *argv[])<br>
&gt;<br>
&gt;                 child_pid = getpid();<br>
&gt;<br>
&gt; -               close_safe(pipefd[READ_FD]);<br>
&gt; +//             close_safe(pipefd[READ_FD]);<br>
&gt;                 setsid();<br>
&gt;                 logfd = open_safe(OLD_LOG_FILE, O_WRONLY | O_APPEND | O_CREAT);<br>
&gt;                 dup2_safe(logfd, 1);<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; On Tue, Jun 23, 2015 at 11:39 PM, Pavel Emelyanov &lt;<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;     On 06/24/2015 01:42 AM, Ross Boucher wrote:<br>
&gt; &gt;     &gt; If I run strace on the docker daemon, criu fails to restore with a<br>
&gt; &gt;     different error:<br>
&gt; &gt;     &gt;<br>
&gt; &gt;     &gt; <a href="https://gist.github.com/boucher/bef6e944ae700526a979" rel="noreferrer" target="_blank">https://gist.github.com/boucher/bef6e944ae700526a979</a><br>
&gt; &gt;     &gt; (I included both the restore log and the strace)<br>
&gt; &gt;     &gt;<br>
&gt; &gt;     &gt; Without strace, I get the same fd already in use error.<br>
&gt; &gt;<br>
&gt; &gt;     Hm... The new error is because criu tries to PTRACE_SEIZE the init to do<br>
&gt; &gt;     the<br>
&gt; &gt;     --restore-sibling restore and can&#39;t do it since strace is already there.<br>
&gt; &gt;<br>
&gt; &gt;     Can you (for experiment only) patch out the --restore-sibling option from<br>
&gt; &gt;     the<br>
&gt; &gt;     code that calls criu? Or (!) call criu restore manually on the existing<br>
&gt; &gt;     images<br>
&gt; &gt;     with all the options being &quot;correct&quot; by yet again w/o the<br>
&gt; &gt;     --restore-sibling?<br>
&gt; &gt;<br>
&gt; &gt;     -- Pavel<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; CRIU mailing list<br>
&gt; &gt; <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
&gt; &gt; <a href="https://lists.openvz.org/mailman/listinfo/criu" rel="noreferrer" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; CRIU mailing list<br>
&gt; <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
&gt; <a href="https://lists.openvz.org/mailman/listinfo/criu" rel="noreferrer" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
</div></div></blockquote></div><br></div>