[CRIU] zdtm test seccomp_filter_tsync failures and wierdness

Tycho Andersen tycho.andersen at canonical.com
Thu Feb 11 06:37:25 PST 2016


On Thu, Feb 11, 2016 at 01:38:34PM +0300, Pavel Emelyanov wrote:
> Hi, Tycho!
> 
> I've noticed that the seccomp_filter_tsync test fails on our jenkins boxes
> with the reason:
> 
> 10:23:23.965:     4: SKIP: seccomp_filter_tsync.c:110: no seccomp present in this kernel
> 10:23:23.966:     3: ERR: test.c:192: Test exited unexpectedly with code 0
> 
> Looking at the .c file of the test I see this code:
> 
>    #undef __NR_seccomp
> 
>    #ifdef __NR_seccomp
>    #define HAVE_SECCOMP 1
>    #else
>    #define HAVE_SECCOMP 0
>    #define __NR_seccomp -1
>    #endif
> 
> and then this
> 
>    int main(int argc, char ** argv)
>    {
> 	...
> 	if (!HAVE_SECCOMP) {
> 		skip("no seccomp present in this kernel\n");
> 		return 0;
> 	}
> 
> This makes me think that this test ALWAYS exits with 'no seccomp present'
> message as __NR_seccomp is undefined from the very beginning and then the
> ifdef sets the HAVE_SECCOMP to 0.
> 
> 
> Another issue I've found is with this test's .checkskip -- it calls make
> on the /tmp/has_nr_seccomp while providing the .c file only. On my debian
> box make doesn't know how to work with that:
> 
>     make: *** No rule to make target '/tmp/has_nr_seccomp'.  Stop.

Huh, really? It works for me on both debian and ubuntu:

$ ./seccomp_filter_tsync.checkskip 
cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -iquote ../../lib/arch/x86/include -I../../lib   /tmp/has_nr_seccomp.c   -o /tmp/has_nr_seccomp

Anyway, I think both of these checks are broken. We should just use the feature
checks by criu check as in the other seccomp_filter tests. I'll send patches
for those shortly.

Tycho

> 
> Both were introduced with ac6641033d5c37ecb1f472d53920204efeae315f, can
> you help us understand what's going on there? %)
> 
> -- Pavel


More information about the CRIU mailing list