[CRIU] BUG: CRIU corrupt floating point state after checkpoint

Diyu Zhou zhoudiyupku at gmail.com
Wed Sep 25 19:24:11 MSK 2019


I think in the CRIU code,  the fpu frame saving and restoring is only performed
for the main thread. Other threads do not do that and thus cause the corruption.

I did a few experiment with the CRIU code. I'm confident the floating
point corruption occurs inside the function parasite_dump_thread_seized
in criu/parasite-syscall.c. Specifically, I suspect the parasite code run
by compel_run_in_thread(tctl, PARASITE_CMD_DUMP_THREAD) causes the floating
point corruption. I added a return 0; before that function and the
floating point corruption does not occur anymore.


On Wed, Sep 25, 2019 at 1:23 AM Cyrill Gorcunov <gorcunov at gmail.com> wrote:
>
> On Wed, Sep 25, 2019 at 09:40:07AM +0300, Cyrill Gorcunov wrote:
> >
> > The parasite code indeed does use fpu :/ Crap. Still I think
> > we might simply need to save fpu state when entering parasite
> > and restore on cleanup, simply because compiler might use
> > fpu instructions for better performance on say u64 and etc.
>
> I just recall that we are saving fpu frame on parasite injection,
> thus something get screwed. Will take a look closer once time
> permit.


More information about the CRIU mailing list