Bug report: a process restored with criu crashes on SIGFPE

Submitted by Andrey Vagin on Jan. 29, 2018, 10:31 p.m.

Details

Message ID 20180129223100.GA3779@outlook.office365.com
State Rejected
Series "Bug report: a process restored with criu crashes on SIGFPE"
Headers show

Commit Message

Andrey Vagin Jan. 29, 2018, 10:31 p.m.
On Tue, Jan 30, 2018 at 01:21:23AM +0300, Cyrill Gorcunov wrote:
> On Mon, Jan 29, 2018 at 02:45:02PM +0200, Shlomi Matichin wrote:
> >    hello andrei and dimitry,
> >    (dimitry, thats a cool email address).
> >    so i started creating a VM for you guys to reproduce the bug, and found
> >    out it works great on t2.large aws instances - but crashes consistently on
> >    c5.large aws instances, which i think explains why you couldn't reproduce
> >    it...
> >    dimitry's test fails on the c5.large, and succeeds on the t2.large (rest
> >    of the tests you requested, pass on both). output attached. (i had to add
> >    sudo and change protobuf-python -> python protobuf).
> >    pypy crashes after restore on my personal laptop as well, but unfortunatly
> >    the tests didn't run on my laptop, output exception and cpuinfo also
> >    attached.
> >    i'm creating a VM for you guys on AWS with a c5.large instance type to
> >    work on, will send connection details later on a private email.
> >    i'm using the following ami, at eu-west-1 aws region
> >    "ami-0741d47e" #
> >    ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180102
> >    i'll also finish writing a script to reproduce the issue, and will send
> >    you the instructions in that email.
> >    thanks you very much,
> >    Shlomi.
> 
> Shlomi, could you please run the patch below?
> ---
> diff --git a/compel/arch/x86/src/lib/include/uapi/asm/fpu.h b/compel/arch/x86/src/lib/include/uapi/asm/fpu.h
> index f60112b9ba50..97aeff1e711b 100644
> --- a/compel/arch/x86/src/lib/include/uapi/asm/fpu.h
> +++ b/compel/arch/x86/src/lib/include/uapi/asm/fpu.h
> @@ -96,7 +96,7 @@ typedef struct {
>  
>  	union {
>  		struct xsave_struct	xsave;
> -		uint8_t			__pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
> +		uint8_t			__pad[4096];
>  	};
>  
>  	uint8_t has_fpu;

ubuntu@ip-172-31-35-209:~/avagin/criu$ git diff
ubuntu@ip-172-31-35-209:~/avagin/criu$ make
make[1]: Nothing to be done for 'all'.
make[1]: 'images/built-in.o' is up to date.
make[1]: 'compel/plugins/std.lib.a' is up to date.
make[1]: 'compel/plugins/fds.lib.a' is up to date.
make[1]: 'compel/libcompel.a' is up to date.
make[1]: 'compel/compel-host-bin' is up to date.
make[1]: Nothing to be done for 'all'.
make[1]: 'soccr/libsoccr.a' is up to date.
make[2]: Nothing to be done for 'all'.
make[2]: Nothing to be done for 'all'.
make[2]: Nothing to be done for 'all'.
make[2]: Nothing to be done for 'all'.
make[2]: 'lib/c/built-in.o' is up to date.
  GEN      magic.py
ubuntu@ip-172-31-35-209:~/avagin/criu$ sudo python test/zdtm.py run -t zdtm/static/fpu02
=== Run 1/1 ================ zdtm/static/fpu02

========================== Run zdtm/static/fpu02 in h ==========================
Start test
./fpu02 --pidfile=fpu02.pid --outfile=fpu02.out
Run criu dump
Run criu restore
Send the 15 signal to  39
Wait for zdtm/static/fpu02(39) to die for 0.100000
################# Test zdtm/static/fpu02 FAIL at result check ##################
Test output: ================================
22:29:37.290:    39: before: 1f80, after: 0
22:29:37.290:    39: FAIL: fpu02.c:81:  (errno = 11 (Resource temporarily unavailable))

 <<< ================================
##################################### FAIL #####################################

Patch hide | download patch | download mbox

diff --git a/compel/arch/x86/src/lib/include/uapi/asm/fpu.h b/compel/arch/x86/src/lib/include/uapi/asm/fpu.h
index f60112b9b..b53af420f 100644
--- a/compel/arch/x86/src/lib/include/uapi/asm/fpu.h
+++ b/compel/arch/x86/src/lib/include/uapi/asm/fpu.h
@@ -96,7 +96,8 @@  typedef struct {
 
        union {
                struct xsave_struct     xsave;
-               uint8_t                 __pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
+               //uint8_t                       __pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
+               uint8_t                 __pad[4096];
        };
 
        uint8_t has_fpu;