latest ltp not building on RHEL 9.6 ?
Hi -
My daily CI builds ltp and runs it against my nfsd-testing branch. For the past week or so, the ltp build fails with:
In file included from cve-2017-16939.c:28:../../include/lapi/sched.h:18:8: error: redefinition of ‘struct sched_attr’
18 | struct sched_attr {
| ^~~~~~~~~~
In file included from /usr/include/bits/sched.h:60,
from /usr/include/sched.h:43,
from ../../include/lapi/sched.h:10,
from cve-2017-16939.c:28:
/usr/include/linux/sched/types.h:102:8: note: originally defined here
102 | struct sched_attr {
| ^~~~~~~~~~The test runner is a RHEL 9.6 guest. I don't see any recent changes to ltp in this area, so perhaps 9.6 modified /usr/include/linux/sched.h ?
Any advice appreciated.
Signature · 5 lines
Chuck Lever -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 18 lines · Chuck Lever via ltp
Hi -
My daily CI builds ltp and runs it against my nfsd-testing branch. For the past week or so, the ltp build fails with:
In file included from cve-2017-16939.c:28:
../../include/lapi/sched.h:18:8: error: redefinition of ‘struct sched_attr’18 | struct sched_attr { | ^~~~~~~~~~ In file included from /usr/include/bits/sched.h:60, from /usr/include/sched.h:43, from ../../include/lapi/sched.h:10, from cve-2017-16939.c:28: /usr/include/linux/sched/types.h:102:8: note: originally defined here 102 | struct sched_attr { | ^~~~~~~~~~
Quoted 2 lines
The test runner is a RHEL 9.6 guest. I don't see any recent changes to ltp in this area, so perhaps 9.6 modified
/usr/include/linux/sched.h?
I saw that LTP has already handle that conflict in lapi header file, in commit
https://github.com/linux-test-project/ltp/commit/c48700d8cdbe6d0d78fda6e6cc658972464b5ccd
Can you provide the version of your kernel-header and glibc?
e.g.
$ rpm -qf /usr/include/linux/sched/types.h
$ rpm -qf /usr/include/bits/sched.h
Signature · 6 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 25 lines · Li Wang
Quoted 18 lines · Chuck Lever via ltp
Hi -
My daily CI builds ltp and runs it against my nfsd-testing branch. For the past week or so, the ltp build fails with:
In file included from cve-2017-16939.c:28:
../../include/lapi/sched.h:18:8: error: redefinition of ‘struct sched_attr’18 | struct sched_attr { | ^~~~~~~~~~ In file included from /usr/include/bits/sched.h:60, from /usr/include/sched.h:43, from ../../include/lapi/sched.h:10, from cve-2017-16939.c:28: /usr/include/linux/sched/types.h:102:8: note: originally defined here 102 | struct sched_attr { | ^~~~~~~~~~Quoted 2 lines
The test runner is a RHEL 9.6 guest. I don't see any recent changes to ltp in this area, so perhaps 9.6 modified
/usr/include/linux/sched.h?I saw that LTP has already handle that conflict in lapi header file, in commit
https://github.com/linux-test-project/ltp/commit/c48700d8cdbe6d0d78fda6e6cc658972464b5ccd
Quoted 6 lines
Can you provide the version of your kernel-header and glibc?
e.g.
$ rpm -qf /usr/include/linux/sched/types.h$ rpm -qf /usr/include/bits/sched.h
Hi!
I test recent kernels in this set-up, so I included the output of "uname" in case that is relevant.
[kdevops@ltp-notify ~]$ uname -r 6.15.0-rc6-g7278569740f6
[kdevops@ltp-notify ~]$ rpm -qf /usr/include/linux/sched/types.h kernel-headers-5.14.0-570.17.1.el9_6.x86_64 [kdevops@ltp-notify ~]$ rpm -qf /usr/include/bits/sched.h glibc-headers-2.34-168.el9_6.14.x86_64 [kdevops@ltp-notify ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.6 (Plow) [kdevops@ltp-notify ~]$
I guess one thing I might try is running the ltp build on a stock RHEL 9.6 kernel. I'm not sure if the test workflow replaces the kernel headers under /usr/include.
Signature · 4 lines
Chuck Lever -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 49 lines · Chuck Lever
Quoted 25 lines · Li Wang
Quoted 18 lines · Chuck Lever via ltp
Hi -
My daily CI builds ltp and runs it against my nfsd-testing branch. For the past week or so, the ltp build fails with:
In file included from cve-2017-16939.c:28:
../../include/lapi/sched.h:18:8: error: redefinition of ‘struct sched_attr’18 | struct sched_attr { | ^~~~~~~~~~ In file included from /usr/include/bits/sched.h:60, from /usr/include/sched.h:43, from ../../include/lapi/sched.h:10, from cve-2017-16939.c:28: /usr/include/linux/sched/types.h:102:8: note: originally defined here 102 | struct sched_attr { | ^~~~~~~~~~Quoted 2 lines
The test runner is a RHEL 9.6 guest. I don't see any recent changes to ltp in this area, so perhaps 9.6 modified
/usr/include/linux/sched.h?I saw that LTP has already handle that conflict in lapi header file, in commit
https://github.com/linux-test-project/ltp/commit/c48700d8cdbe6d0d78fda6e6cc658972464b5ccdQuoted 6 lines
Can you provide the version of your kernel-header and glibc?
e.g.
$ rpm -qf /usr/include/linux/sched/types.h$ rpm -qf /usr/include/bits/sched.hHi!
I test recent kernels in this set-up, so I included the output of "uname" in case that is relevant.
[kdevops@ltp-notify ~]$ uname -r 6.15.0-rc6-g7278569740f6
[kdevops@ltp-notify ~]$ rpm -qf/usr/include/linux/sched/types.hkernel-headers-5.14.0-570.17.1.el9_6.x86_64 [kdevops@ltp-notify ~]$ rpm -qf/usr/include/bits/sched.hglibc-headers-2.34-168.el9_6.14.x86_64 [kdevops@ltp-notify ~]$ cat/etc/redhat-release
Red Hat Enterprise Linux release 9.6 (Plow) [kdevops@ltp-notify ~]$
Quoted 3 lines
I guess one thing I might try is running the ltp build on a stock RHEL 9.6 kernel. I'm not sure if the test workflow replaces the kernel headers under
/usr/include.
That's weird, I wasn't able to reproduce this on the same env. Your test system may be polluted with new kernel headers.
And, you might need to manually check the struct sched_attr in both /usr/include/bits/sched.h and /usr/include/linux/sched/types.h to see if something different.
# cat /usr/include/bits/sched.h
...
54 /* Use "" to work around incorrect macro expansion of the
55 __has_include argument (GCC PR 80005). */
56 # ifdef __has_include
57 # if __has_include ("linux/sched/types.h")
58 /* Some older Linux versions defined sched_param in
<linux/sched/types.h>. */
59 # define sched_param __glibc_mask_sched_param
60 # include <linux/sched/types.h>
61 # undef sched_param
62 # endif
63 # endif
64 # ifndef SCHED_ATTR_SIZE_VER0
65 # include <linux/types.h>
66 # define SCHED_ATTR_SIZE_VER0 48
67 # define SCHED_ATTR_SIZE_VER1 56
68 struct sched_attr
69 {
70 __u32 size;
71 __u32 sched_policy;
72 __u64 sched_flags;
73 __s32 sched_nice;
74 __u32 sched_priority;
75 __u64 sched_runtime;
76 __u64 sched_deadline;
77 __u64 sched_period;
78 __u32 sched_util_min;
79 __u32 sched_util_max;
80 /* Additional fields may be added at the end. */
81 };
82 # endif /* !SCHED_ATTR_SIZE_VER0 */# cat /usr/include/linux/sched/types.h ...
#define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */ #define SCHED_ATTR_SIZE_VER1 56 /* add: util_{min,max} */
struct sched_attr {__u32 size;
__u32 sched_policy;__u64 sched_flags;
/* SCHED_NORMAL, SCHED_BATCH */__s32 sched_nice;
/* SCHED_FIFO, SCHED_RR */__u32 sched_priority;
/* SCHED_DEADLINE */__u64 sched_runtime;__u64 sched_deadline;__u64 sched_period;
/* Utilization hints */__u32 sched_util_min;__u32 sched_util_max;
};
-------------------------- test result on my clean 9.6 --------------------
# cat /etc/redhat-release Red Hat Enterprise Linux release 9.6 (Plow)
# uname -r 5.14.0-570.17.1.el9_6.x86_64
# rpm -qf /usr/include/linux/sched/types.h kernel-headers-5.14.0-570.17.1.el9_6.x86_64
# rpm -qf /usr/include/bits/sched.h glibc-headers-2.34-168.el9_6.14.x86_64
# V=1 make
gcc -I../../include -I../../include -I../../include/old/ -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=return-type -fno-common -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -std=gnu99 -D_GNU_SOURCE -L../../lib cve-2017-16939.c -lltp -o cve-2017-16939
# echo $? 0
Signature · 6 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 50 lines · Li Wang
Quoted 49 lines · Chuck Lever
Quoted 25 lines · Li Wang
Quoted 18 lines · Chuck Lever via ltp
Hi -
My daily CI builds ltp and runs it against my nfsd-testing branch. For the past week or so, the ltp build fails with:
In file included from cve-2017-16939.c:28:
../../include/lapi/sched.h:18:8: error: redefinition of ‘struct sched_attr’18 | struct sched_attr { | ^~~~~~~~~~ In file included from /usr/include/bits/sched.h:60, from /usr/include/sched.h:43, from ../../include/lapi/sched.h:10, from cve-2017-16939.c:28: /usr/include/linux/sched/types.h:102:8: note: originally defined here 102 | struct sched_attr { | ^~~~~~~~~~Quoted 2 lines
The test runner is a RHEL 9.6 guest. I don't see any recent changes to ltp in this area, so perhaps 9.6 modified
/usr/include/linux/sched.h?I saw that LTP has already handle that conflict in lapi header file, in commit
https://github.com/linux-test-project/ltp/commit/c48700d8cdbe6d0d78fda6e6cc658972464b5ccdQuoted 6 lines
Can you provide the version of your kernel-header and glibc?
e.g.
$ rpm -qf /usr/include/linux/sched/types.h$ rpm -qf /usr/include/bits/sched.hHi!
I test recent kernels in this set-up, so I included the output of "uname" in case that is relevant.
[kdevops@ltp-notify ~]$ uname -r 6.15.0-rc6-g7278569740f6
[kdevops@ltp-notify ~]$ rpm -qf/usr/include/linux/sched/types.hkernel-headers-5.14.0-570.17.1.el9_6.x86_64 [kdevops@ltp-notify ~]$ rpm -qf/usr/include/bits/sched.hglibc-headers-2.34-168.el9_6.14.x86_64 [kdevops@ltp-notify ~]$ cat/etc/redhat-release
Red Hat Enterprise Linux release 9.6 (Plow) [kdevops@ltp-notify ~]$
Quoted 7 lines
Quoted 3 lines
I guess one thing I might try is running the ltp build on a stock RHEL 9.6 kernel. I'm not sure if the test workflow replaces the kernel headers under
/usr/include.That's weird, I wasn't able to reproduce this on the same env. Your test system may be polluted with new kernel headers.
I get the same error whether the stock kernel or a custom kernel is in use. The system is an AWS instance built from the ground up with terraform before each test run, so there is no debris from previous tests.
Looks like the problem is actually that my test environment is still cloning ltp commit b0ae1ee2392d ("rpc_svc_1: Fix incompatible pointer type error") instead of HEAD. So it's missing commit c48700d8cdbe ("sched_attr: Do not define for glibc >= 2.41").
Once I changed my test workflow to clone LTP from HEAD instead of the older commit, this build failure goes away.
Thank you, Li, for your advice!
Quoted 93 lines
And, you might need to manually check the struct
sched_attrin both/usr/include/bits/sched.hand/usr/include/linux/sched/types.hto see if something different.# cat /usr/include/bits/sched.h ... 54 /* Use "" to work around incorrect macro expansion of the 55 __has_include argument (GCC PR 80005). */ 56 # ifdef __has_include 57 # if __has_include ("linux/sched/types.h") 58 /* Some older Linux versions defined sched_param in <linux/sched/types.h>. */ 59 # define sched_param __glibc_mask_sched_param 60 # include <linux/sched/types.h> 61 # undef sched_param 62 # endif 63 # endif 64 # ifndef SCHED_ATTR_SIZE_VER0 65 # include <linux/types.h> 66 # define SCHED_ATTR_SIZE_VER0 48 67 # define SCHED_ATTR_SIZE_VER1 56 68 struct sched_attr 69 { 70 __u32 size; 71 __u32 sched_policy; 72 __u64 sched_flags; 73 __s32 sched_nice; 74 __u32 sched_priority; 75 __u64 sched_runtime; 76 __u64 sched_deadline; 77 __u64 sched_period; 78 __u32 sched_util_min; 79 __u32 sched_util_max; 80 /* Additional fields may be added at the end. */ 81 }; 82 # endif /* !SCHED_ATTR_SIZE_VER0 */# cat /usr/include/linux/sched/types.h ...#define
SCHED_ATTR_SIZE_VER048 /* sizeof first published struct */ #defineSCHED_ATTR_SIZE_VER156 /* add: util_{min,max} */struct
sched_attr{__u32size;
__u32sched_policy;__u64sched_flags;/*
SCHED_NORMAL,SCHED_BATCH*/__s32sched_nice;/*
SCHED_FIFO,SCHED_RR*/__u32sched_priority;/*
SCHED_DEADLINE*/__u64sched_runtime;__u64sched_deadline;__u64sched_period;/* Utilization hints */
__u32sched_util_min;__u32sched_util_max;};
-------------------------- test result on my clean 9.6 --------------------
# cat /etc/redhat-release Red Hat Enterprise Linux release 9.6 (Plow)# uname -r 5.14.0-570.17.1.el9_6.x86_64# rpm -qf /usr/include/linux/sched/types.h kernel-headers-5.14.0-570.17.1.el9_6.x86_64# rpm -qf /usr/include/bits/sched.h glibc-headers-2.34-168.el9_6.14.x86_64# V=1 make
gcc -I../../include -I../../include -I../../include/old/ -Wformat(quoted diff) +0
-3-Werror=format-security -Werror=implicit-function-declaration -Werror=return-type -fno-common -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -std=gnu99 -D_GNU_SOURCE -L../../lib
cve-2017-16939.c-lltp -o cve-2017-16939# echo $? 0
Signature · 4 lines
Chuck Lever -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 25 lines · Li Wang
Quoted 18 lines · Chuck Lever via ltp
Hi -
My daily CI builds ltp and runs it against my nfsd-testing branch. For the past week or so, the ltp build fails with:
In file included from cve-2017-16939.c:28:
../../include/lapi/sched.h:18:8: error: redefinition of ‘struct sched_attr’18 | struct sched_attr { | ^~~~~~~~~~ In file included from /usr/include/bits/sched.h:60, from /usr/include/sched.h:43, from ../../include/lapi/sched.h:10, from cve-2017-16939.c:28: /usr/include/linux/sched/types.h:102:8: note: originally defined here 102 | struct sched_attr { | ^~~~~~~~~~Quoted 2 lines
The test runner is a RHEL 9.6 guest. I don't see any recent changes to ltp in this area, so perhaps 9.6 modified
/usr/include/linux/sched.h?I saw that LTP has already handle that conflict in lapi header file, in commit
https://github.com/linux-test-project/ltp/commit/c48700d8cdbe6d0d78fda6e6cc658972464b5ccd
Quoted 8 lines
Can you provide the version of your kernel-header and glibc?
e.g.
$ rpm -qf /usr/include/linux/sched/types.h$ rpm -qf /usr/include/bits/sched.h
Building on a stock 9.6 kernel fails the same way:
In file included from cve-2017-16939.c:28:../../include/lapi/sched.h:18:8: error: redefinition of ‘struct sched_attr’
18 | struct sched_attr {
| ^~~~~~~~~~
In file included from /usr/include/bits/sched.h:60,
from /usr/include/sched.h:43,
from ../../include/lapi/sched.h:10,
from cve-2017-16939.c:28:
/usr/include/linux/sched/types.h:102:8: note: originally defined here
102 | struct sched_attr {
| ^~~~~~~~~~In file included from cve-2017-16939.c:28:../../include/lapi/sched.h:36:19: error: conflicting types for ‘sched_setattr’; have ‘int(pid_t, const struct sched_attr *, unsigned int)’ {aka ‘int(int, const struct sched_attr *, unsigned int)’}
36 | static inline int sched_setattr(pid_t pid, const structsched_attr *attr,
| ^~~~~~~~~~~~~
In file included from /usr/include/sched.h:43,
from ../../include/lapi/sched.h:10,
from cve-2017-16939.c:28:/usr/include/bits/sched.h:141:5: note: previous declaration of ‘sched_setattr’ with type ‘int(pid_t, struct sched_attr *, unsigned int)’ {aka ‘int(int, struct sched_attr *, unsigned int)’}
141 | int sched_setattr (pid_t tid, struct sched_attr *attr, unsigned
int flags)
| ^~~~~~~~~~~~~
In file included from cve-2017-16939.c:28:../../include/lapi/sched.h:42:19: error: conflicting types for ‘sched_getattr’; have ‘int(pid_t, struct sched_attr *, unsigned int, unsigned int)’ {aka ‘int(int, struct sched_attr *, unsigned int, unsigned int)’}
42 | static inline int sched_getattr(pid_t pid, struct sched_attr *attr,
| ^~~~~~~~~~~~~
In file included from /usr/include/sched.h:43,
from ../../include/lapi/sched.h:10,
from cve-2017-16939.c:28:/usr/include/bits/sched.h:146:5: note: previous declaration of ‘sched_getattr’ with type ‘int(pid_t, struct sched_attr *, unsigned int, unsigned int)’ {aka ‘int(int, struct sched_attr *, unsigned int, unsigned int)’}
146 | int sched_getattr (pid_t tid, struct sched_attr *attr, unsigned
int size,
| ^~~~~~~~~~~~~
gmake[2]: *** [../../include/mk/rules.mk:45: cve-2017-16939] Error 1 gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [../include/mk/generic_trunk_target.inc:108: all] Error 2
gmake: *** [Makefile:85: testcases-all] Error 2
gmake: *** Waiting for unfinished jobs....
(the sched_{set,get}attr failures also occurred before, I included just the first error in the initial report for brevity).
Signature · 4 lines
Chuck Lever -- Mailing list info: https://lists.linux.it/listinfo/ltp