[CRIU] seccomp zdtm tests compilation error

Andrew Vagin avagin at virtuozzo.com
Fri Nov 27 06:57:20 PST 2015


On Thu, Nov 26, 2015 at 06:24:55PM -0700, Tycho Andersen wrote:
> Hi Pavel,
> 
> On Thu, Nov 26, 2015 at 04:33:58PM +0300, Pavel Emelyanov wrote:
> > Hi, Tycho.
> > 
> > On Travis we have the same error about absent bpf.h file as we had
> > in generic criu code:
> > 
> > https://travis-ci.org/cyrillos/criu/jobs/93309914
> > 
> > gcc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -iquote ../../lib/arch/x86/include -I../../lib seccomp_filter_tsync.c ../../lib/libzdtmtst.a -pthread -o seccomp_filter_tsync
> > seccomp_filter.c:10:23: fatal error: linux/bpf.h: No such file or directory
> > compilation terminated.
> 
> Whoops, sorry about that. The attached patch should fix it. [Also
> sorry for the delay, I've been mostly AFK for the US national holiday
> this week :)]

Our jenkins job for the 3.11 kernel fails:

https://ci.openvz.org/job/CRIU-3.11/1/console

seccomp_filter_tsync.c:65:14: error: ‘__NR_seccomp’ undeclared (first
use in this function)
  if (syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, flags, &bpf_prog) <
0) {
              ^
seccomp_filter_tsync.c:65:14: note: each undeclared identifier is
reported only once for each function it appears in
seccomp_filter_tsync.c:65:28: error: ‘SECCOMP_SET_MODE_FILTER’
undeclared (first use in this function)
  if (syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, flags, &bpf_prog) <
0) {
                            ^
seccomp_filter_tsync.c: In function ‘main’:
seccomp_filter_tsync.c:141:35: error: ‘SECCOMP_FILTER_FLAG_TSYNC’
undeclared (first use in this function)
   if (filter_syscall(__NR_ptrace, SECCOMP_FILTER_FLAG_TSYNC) < 0)
                                   ^
make[2]: *** [seccomp_filter_tsync] Error 1

> 
> Tycho

> From 19c419a169f97e0296d9056737922a433b66a3f0 Mon Sep 17 00:00:00 2001
> From: Tycho Andersen <tycho.andersen at canonical.com>
> Date: Thu, 26 Nov 2015 18:21:06 -0700
> Subject: [PATCH] tests: remove unused bpf.h
> 
> This header is unused, and not present on kernels w/o CONFIG_BPF_SYSCALL,
> so let's not require it.
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
>  test/zdtm/live/static/seccomp_filter.c             | 1 -
>  test/zdtm/live/static/seccomp_filter_inheritance.c | 1 -
>  test/zdtm/live/static/seccomp_filter_tsync.c       | 1 -
>  3 files changed, 3 deletions(-)
> 
> diff --git a/test/zdtm/live/static/seccomp_filter.c b/test/zdtm/live/static/seccomp_filter.c
> index 20f5722..700e4de 100644
> --- a/test/zdtm/live/static/seccomp_filter.c
> +++ b/test/zdtm/live/static/seccomp_filter.c
> @@ -7,7 +7,6 @@
>  #include <linux/seccomp.h>
>  #include <linux/filter.h>
>  #include <linux/limits.h>
> -#include <linux/bpf.h>
>  #include <stdlib.h>
>  #include <sys/types.h>
>  #include <sys/socket.h>
> diff --git a/test/zdtm/live/static/seccomp_filter_inheritance.c b/test/zdtm/live/static/seccomp_filter_inheritance.c
> index e35c3e3..ff0c46a 100644
> --- a/test/zdtm/live/static/seccomp_filter_inheritance.c
> +++ b/test/zdtm/live/static/seccomp_filter_inheritance.c
> @@ -7,7 +7,6 @@
>  #include <linux/seccomp.h>
>  #include <linux/filter.h>
>  #include <linux/limits.h>
> -#include <linux/bpf.h>
>  #include <stdlib.h>
>  #include <sys/types.h>
>  #include <sys/socket.h>
> diff --git a/test/zdtm/live/static/seccomp_filter_tsync.c b/test/zdtm/live/static/seccomp_filter_tsync.c
> index 67349c4..0a93559 100644
> --- a/test/zdtm/live/static/seccomp_filter_tsync.c
> +++ b/test/zdtm/live/static/seccomp_filter_tsync.c
> @@ -7,7 +7,6 @@
>  #include <linux/seccomp.h>
>  #include <linux/filter.h>
>  #include <linux/limits.h>
> -#include <linux/bpf.h>
>  #include <stdlib.h>
>  #include <sys/types.h>
>  #include <sys/socket.h>
> -- 
> 2.5.0
> 

> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu



More information about the CRIU mailing list