<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif"><div style="font-family:arial,sans-serif;font-size:13px"><div class="gmail_default" style="font-family:verdana,sans-serif">(resent message because I CC&#39;ed criu mailing list, instead of replying to it)</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">​The initialisation code, that runs before dump and restore is the following:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">​  ​</div>int img_fd = open_img_dir(&quot;wdir/i/linpack_cr/&quot;);</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">    criu_init_opts();<br>    criu_set_service_address(&quot;./wdir/s/<a href="http://cs.sk/" target="_blank">cs.sk</a>&quot;);<br>    criu_set_images_dir_fd(img_fd);<div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">​​</div><br>    criu_set_log_level(4);</blockquote></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div class="gmail_default" style="font-family:verdana,sans-serif">​The code to dump (which seems to work okay) is this:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="verdana, sans-serif">  </font> int pid, ret;<br>    // Create a child<br>    pid = fork();<br>    assert(pid&gt;=0);<br><br>    if(!pid){     // The child will dump itself<br>        close(0); close(1); close(2);<br>        assert(setsid()&gt;=0);<br>        criu_set_log_file(&quot;dump.log&quot;);<br>        criu_set_leave_running(true)<br>        ret = criu_dump();<br>        if (ret &lt; 0){<br>            what_err_ret_mean(ret);<br>            exit(1);<br>        }<br>        if (ret ==0)<br>            ret = SUCC_DUMP_ECODE;<br>        else if (ret ==1)<br>            ret = SUCC_RSTR_ECODE;<br>        else<br>            ret =1;<br>        exit(ret);<br>    }// end-of child code<br>    // Wait for the child to be captured<br>    if(waitpid(pid,&amp;ret,0)&lt;0){<br>        perror(&quot;Can&#39;t wait child&quot;);<br>        kill(pid, SIGKILL);<br>        exit(-1);<br>    }<br>    if(chk_exit(ret,SUCC_DUMP_ECODE)){<br>        kill(pid,SIGKILL);<br>        exit(-1);<br>    }</blockquote><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><span style="font-family:arial,sans-serif;font-size:13px">Initially the restore code was taken from one of your tests.</span><div style="font-family:arial,sans-serif;font-size:13px">I was using:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><blockquote class="gmail_quote" style="font-family:arial,sans-serif;font-size:13px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">criu_set_log_file(&quot;restore.log&quot;);<br>pid = criu_restore_child();<br>if (pid &lt;=0){ what_err_ret_mean(pid);<br>exit(-1);<br>}<br><br>if(waitpid(pid, &amp;ret, 0)&lt;0){<br>perror(&quot;Can&#39;t wait for restore&quot;);<br>kill(pid,SIGKILL);<br>exit(-1);<br>}<br>return chk_exit(ret,SUCC_DUMP_ECODE);</blockquote><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div class="gmail_default" style="font-size:13px">​chk_exit​ was printing the &quot;exit 43&quot; message. It is the function found here:</div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="verdana, sans-serif"><a href="https://github.com/xemul/criu/blob/master/test/libcriu/lib.c" target="_blank">https://github.com/xemul/criu/blob/master/test/libcriu/lib.c</a></font><br></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style="font-size:13px"><br></div><div class="gmail_default" style="font-size:13px">Then I changed the restore code simply:</div><blockquote class="gmail_quote" style="font-family:arial,sans-serif;font-size:13px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">criu_set_log_file(&quot;restore.log&quot;);<br>criu_restore();</blockquote><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">​This produces a similar restore.log, with success messages, but the program does not seem to continue.</div></div><div style="font-family:arial,sans-serif;font-size:13px"><div class="gmail_default" style="font-family:verdana,sans-serif;display:inline"><br></div></div><div class="gmail_default" style="font-size:13px">​Thanks for your replies.</div><div class="gmail_default" style="font-size:13px">I haven&#39;t found any other examples other than the tests directory. That&#39;s why I based my code on them.</div><div class="gmail_default" style="font-size:13px"><br></div><div class="gmail_default" style="font-size:13px">Cheers,</div><div class="gmail_default" style="font-size:13px">Paschalis​</div><div style="font-family:arial,sans-serif;font-size:13px"></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 12:45 PM, Paschalis Mpeis <span dir="ltr">&lt;<a href="mailto:paschalis.mpeis@ed.ac.uk" target="_blank">paschalis.mpeis@ed.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_default" style="font-family:verdana,sans-serif">​The initialisation code, that runs before dump and restore is the following:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">​  ​</div>int img_fd = open_img_dir(&quot;wdir/i/linpack_cr/&quot;);</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">    criu_init_opts();<br>    criu_set_service_address(&quot;./wdir/s/<a href="http://cs.sk" target="_blank">cs.sk</a>&quot;);<br>    criu_set_images_dir_fd(img_fd);<div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">​​</div><br>    criu_set_log_level(4);</blockquote></div><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">​The code to dump (which seems to work okay) is this:</div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote"><font face="verdana, sans-serif">  </font> int pid, ret;<br>    // Create a child<br>    pid = fork();<br>    assert(pid&gt;=0);<br><br>    if(!pid){     // The child will dump itself<br>        close(0); close(1); close(2);<br>        assert(setsid()&gt;=0);<br>        criu_set_log_file(&quot;dump.log&quot;);<br>        criu_set_leave_running(true)<br>        ret = criu_dump();<br>        if (ret &lt; 0){<br>            what_err_ret_mean(ret);<br>            exit(1);<br>        }<br>        if (ret ==0)<br>            ret = SUCC_DUMP_ECODE;<br>        else if (ret ==1)<br>            ret = SUCC_RSTR_ECODE;<br>        else<br>            ret =1;<br>        exit(ret);<br>    }// end-of child code<br>    // Wait for the child to be captured<br>    if(waitpid(pid,&amp;ret,0)&lt;0){<br>        perror(&quot;Can&#39;t wait child&quot;);<br>        kill(pid, SIGKILL);<br>        exit(-1);<br>    }<br>    if(chk_exit(ret,SUCC_DUMP_ECODE)){<br>        kill(pid,SIGKILL);<br>        exit(-1);<br>    }</blockquote><br></div><div><br></div>Initially the restore code was taken from one of your tests.<div>I was using:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">criu_set_log_file(&quot;restore.log&quot;);<br>pid = criu_restore_child();<br>if (pid &lt;=0){        what_err_ret_mean(pid);<br>        exit(-1);<br>    }<br><br>    if(waitpid(pid, &amp;ret, 0)&lt;0){<br>        perror(&quot;Can&#39;t wait for restore&quot;);<br>        kill(pid,SIGKILL);<br>        exit(-1);<br>    }<br>    return chk_exit(ret,SUCC_DUMP_ECODE);</blockquote><div><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">​chk_exit​ was printing the &quot;exit 43&quot; message. It is the function found here:</div><div class="gmail_default"><font face="verdana, sans-serif"><a href="https://github.com/xemul/criu/blob/master/test/libcriu/lib.c" target="_blank">https://github.com/xemul/criu/blob/master/test/libcriu/lib.c</a></font><br></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Then I changed the restore code simply:</div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote"><span style="font-family:arial,sans-serif">criu_set_log_file(&quot;restore.log&quot;);<br></span>criu_restore();</blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">​This produces a similar restore.log, with success messages, but the program does not seem to continue.</div></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;display:inline"><br></div></div><div class="gmail_default" style="font-family:verdana,sans-serif">​Thanks for your replies.</div><div class="gmail_default" style="font-family:verdana,sans-serif">I haven&#39;t found any other examples other than the tests directory. That&#39;s why I based my code on them.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Cheers,</div><div class="gmail_default" style="font-family:verdana,sans-serif">Paschalis​</div><div><div><div><br><div class="gmail_quote">On Tue Jan 20 2015 at 12:22:15 PM Cyrill Gorcunov &lt;<a href="mailto:gorcunov@gmail.com" target="_blank">gorcunov@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Tue, Jan 20, 2015 at 03:06:39PM +0300, Pavel Emelyanov wrote:<br>
&gt; On 01/19/2015 10:31 PM, Paschalis Mpeis wrote:<br>
&gt; &gt; I am trying to capture, and replay a simple benchmark application.<br>
&gt; &gt; The application accepts as a command line argument (CLA) an integer value to denote whether we are capturing or restoring.<br>
&gt; &gt;<br>
&gt; &gt; On both capture and restore, I run the CRIU initialisation staff (provide folder for images, etc).<br>
&gt; &gt;<br>
&gt; &gt; I first run the application with the capture integer value. I set the leave_running option to true, I do the capture, which seems successful, and then the application continues execution and finishes.<br>
&gt; &gt;<br>
&gt; &gt; Then, I want to replay the application, from the point it was checkpointed. So I run again the application, and I pass as a CLA the restore integer value. For this case, the application simply initialises CRIU, and then tries to restore from the existing images.<br>
&gt; &gt;<br>
&gt; &gt; I get the following error:<br>
&gt; &gt; &quot; `- FAIL (exit 43)&quot;<br>
&gt;<br>
&gt; But that&#39;s not CRIU message. Who prints that and what does the &quot;exit 43&quot; mean?<br>
&gt;<br>
&gt; &gt; You can find attached the dump.log and restore.log.<br>
&gt;<br>
&gt; The restore.log ends with<br>
&gt;<br>
&gt; (00.025773) Restore finished successfully. Resuming tasks.<br>
&gt; (00.025795) 5084 was trapped<br>
&gt; (00.025797) `- Expecting exit<br>
&gt; (00.025804) 5084 was trapped<br>
&gt; (00.025806) 5084 is going to execute the syscall f<br>
&gt; (00.025823) 5084 was stopped<br>
&gt; (00.025836) 5084 was trapped<br>
&gt; (00.025838) 5084 is going to execute the syscall b<br>
&gt; (00.025853) 5084 was stopped<br>
&gt; (00.025857) Writing stats<br>
&gt;<br>
&gt; I.e. CRIU thinks that tasks are up and running.<br>
<br>
Yes, it means everything is up and fine. Paschalis could you please<br>
provide more details on your case<br>
<br>
 - the testing program itself<br>
 - step-by-step how you checkpointed and restored it<br>
</blockquote></div></div></div></div></div>
</blockquote></div><br></div></div>