<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'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("wdir/i/linpack_cr/");</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("./wdir/s/<a href="http://cs.sk/" target="_blank">cs.sk</a>");<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>=0);<br><br> if(!pid){ // The child will dump itself<br> close(0); close(1); close(2);<br> assert(setsid()>=0);<br> criu_set_log_file("dump.log");<br> criu_set_leave_running(true)<br> ret = criu_dump();<br> if (ret < 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,&ret,0)<0){<br> perror("Can't wait child");<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("restore.log");<br>pid = criu_restore_child();<br>if (pid <=0){ what_err_ret_mean(pid);<br>exit(-1);<br>}<br><br>if(waitpid(pid, &ret, 0)<0){<br>perror("Can't wait for restore");<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 "exit 43" 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("restore.log");<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't found any other examples other than the tests directory. That'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"><<a href="mailto:paschalis.mpeis@ed.ac.uk" target="_blank">paschalis.mpeis@ed.ac.uk</a>></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("wdir/i/linpack_cr/");</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("./wdir/s/<a href="http://cs.sk" target="_blank">cs.sk</a>");<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>=0);<br><br> if(!pid){ // The child will dump itself<br> close(0); close(1); close(2);<br> assert(setsid()>=0);<br> criu_set_log_file("dump.log");<br> criu_set_leave_running(true)<br> ret = criu_dump();<br> if (ret < 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,&ret,0)<0){<br> perror("Can't wait child");<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("restore.log");<br>pid = criu_restore_child();<br>if (pid <=0){ what_err_ret_mean(pid);<br> exit(-1);<br> }<br><br> if(waitpid(pid, &ret, 0)<0){<br> perror("Can't wait for restore");<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 "exit 43" 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("restore.log");<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't found any other examples other than the tests directory. That'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 <<a href="mailto:gorcunov@gmail.com" target="_blank">gorcunov@gmail.com</a>> 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>
> On 01/19/2015 10:31 PM, Paschalis Mpeis wrote:<br>
> > I am trying to capture, and replay a simple benchmark application.<br>
> > The application accepts as a command line argument (CLA) an integer value to denote whether we are capturing or restoring.<br>
> ><br>
> > On both capture and restore, I run the CRIU initialisation staff (provide folder for images, etc).<br>
> ><br>
> > 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>
> ><br>
> > 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>
> ><br>
> > I get the following error:<br>
> > " `- FAIL (exit 43)"<br>
><br>
> But that's not CRIU message. Who prints that and what does the "exit 43" mean?<br>
><br>
> > You can find attached the dump.log and restore.log.<br>
><br>
> The restore.log ends with<br>
><br>
> (00.025773) Restore finished successfully. Resuming tasks.<br>
> (00.025795) 5084 was trapped<br>
> (00.025797) `- Expecting exit<br>
> (00.025804) 5084 was trapped<br>
> (00.025806) 5084 is going to execute the syscall f<br>
> (00.025823) 5084 was stopped<br>
> (00.025836) 5084 was trapped<br>
> (00.025838) 5084 is going to execute the syscall b<br>
> (00.025853) 5084 was stopped<br>
> (00.025857) Writing stats<br>
><br>
> 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>