Bug 4449 - [Alinux3][内部nightly][x86-64]alitests-cs编译失败:error: ‘RES_USE_INET6’ undeclared (first use in this function)
Summary: [Alinux3][内部nightly][x86-64]alitests-cs编译失败:error: ‘RES_USE_INET6’ undeclared...
Status: CLOSED INVALID
Alias: None
Product: Antest
Classification: Infrastructures
Component: 测试用例 (show other bugs) 测试用例
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: Jacob
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-09 11:06 UTC by wangpingping
Modified: 2023-03-15 15:00 UTC (History)
7 users (show)

See Also:


Attachments
编译失败日志 (547.76 KB, text/plain)
2023-03-09 11:06 UTC, wangpingping
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wangpingping alibaba_cloud_group 2023-03-09 11:06:41 UTC
Created attachment 670 [details]
编译失败日志

[缺陷描述]:
alitests和alitests-cs在编译过程中有多处报错
部分报错日志如下(详情请见附件):
...
make[5]: Leaving directory '/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/multithread'
make[5]: Entering directory '/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk'
Building modules: mod_aprl_test.c
make -C /lib/modules/5.10.134-857.git.68ae31977f38.al8.x86_64/build M=/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk
make[6]: Entering directory '/usr/src/kernels/5.10.134-857.git.68ae31977f38.al8.x86_64'
  CC [M]  /home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk/mod_aprl_test.o
/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk/mod_aprl_test.c: In function ‘thread_init’:
/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk/mod_aprl_test.c:34:3: error: implicit declaration of function ‘get_task_struc ’ [-Werror=implicit-function-declaration]
   34 |   get_task_struct(test_task[i]);
      |   ^~~~~~~~~~~~~~~
/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk/mod_aprl_test.c: In function ‘thread_cleanup’:
/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk/mod_aprl_test.c:47:3: error: implicit declaration of function ‘put_task_struc ’ [-Werror=implicit-function-declaration]
   47 |   put_task_struct(test_task[i]);
      |   ^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[7]: *** [scripts/Makefile.build:286: /home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk/mod_aprl_test.o] Error 1
make[6]: *** [Makefile:1834: /home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk] Error 2
make[6]: Leaving directory '/usr/src/kernels/5.10.134-857.git.68ae31977f38.al8.x86_64'
make[5]: [../../../../../include/mk/module.mk:60: .dep_modules] Error 2 (ignored)
rm -rf *.mod.c *.o *.ko.unsigned modules.order .tmp* .*.ko .*.cmd Module.symvers
make[5]: Leaving directory '/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/printk'
make[5]: Entering directory '/home/wb-wpp899309/ltp/testcases/alitests/kernel/misc/futex'
gcc -fcommon -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -x c++  -I../../../../../include -I../../../../../include -I../../../../../include/old/   -pthread -lstdc++ -static-libstdc++ -L../../../../../lib  futex_wakeup.c   -o futex_wakeup
cc1plus: warning: command-line option ‘-Wold-style-definition’ is valid for C/ObjC but not for C++
...

Building modules: mod_cpuacct_01.c mod_mdelay_04.c
make -C /lib/modules/5.10.134-857.git.68ae31977f38.al8.x86_64/build M=/home/wb-wpp899309/ltp/testcases/alitests/kernel/controller/cpuacct
make[6]: Entering directory '/usr/src/kernels/5.10.134-857.git.68ae31977f38.al8.x86_64'
"SKIP: "
  CC [M]  /home/wb-wpp899309/ltp/testcases/alitests/kernel/controller/cpuacct/mod_cpuacct_01.o
  CC [M]  /home/wb-wpp899309/ltp/testcases/alitests/kernel/controller/cpuacct/mod_mdelay_04.o
  CC [M]  /home/wb-wpp899309/ltp/testcases/alitests/kernel/controller/cpuacct/aone17075765_reproducer.o
/home/wb-wpp899309/ltp/testcases/alitests/kernel/controller/cpuacct/aone17075765_reproducer.c:8:10: fatal error: unistd.h: No such file or directory
    8 | #include <unistd.h>
      |          ^~~~~~~~~~
compilation terminated.
make[7]: *** [scripts/Makefile.build:286: /home/wb-wpp899309/ltp/testcases/alitests/kernel/controller/cpuacct/aone17075765_reproducer.o] Error 1
make[6]: *** [Makefile:1834: /home/wb-wpp899309/ltp/testcases/alitests/kernel/controller/cpuacct] Error 2
make[6]: Leaving directory '/usr/src/kernels/5.10.134-857.git.68ae31977f38.al8.x86_64'
make[5]: [../../../../../include/mk/module.mk:60: .dep_modules] Error 2 (ignored)
rm -rf *.mod.c *.o *.ko.unsigned modules.order .tmp* .*.ko .*.cmd Module.symvers
gcc -fcommon -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition  -I/home/wb-wpp899309/ltp/testcases/alitests/include -I../../../../../include -I../../../../../include -I../../../../../include/old/   -L/home/wb-wpp899309/ltp/testcases/alitests/lib -L../../../../../lib  dummy_threads.c   -lltp -lalitest -lltp -lpthread -o dummy_threads
dummy_threads.c: In function ‘sigusr_handler’:
...

[重现概率]:
必现

[重现步骤]:
git clone http://gitlab.alibaba-inc.com/alikernel/ltp.git
export CFLAGS="${CFLAGS} -fcommon"
cd ltp
make autotools
./configure 
make

[重现环境]:
内核:
5.10.134-857.git.68ae31977f38.al8.x86_64

# cat /etc/os-release
NAME="Alibaba Cloud Linux"
VERSION="3 (Soaring Falcon)"
ID="alinux"
ID_LIKE="rhel fedora centos"
VERSION_ID="3"
PLATFORM_ID="platform:al8"
PRETTY_NAME="Alibaba Cloud Linux 3 (Soaring Falcon)"
ANSI_COLOR="0;31"
HOME_URL="https://www.aliyun.com/"

cpu信息:
]# lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           2
NUMA node(s):        1
Vendor ID:           GenuineIntel
BIOS Vendor ID:      Alibaba Cloud
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz
BIOS Model name:     pc-i440fx-2.1
Stepping:            7
CPU MHz:             2500.016
BogoMIPS:            5000.03
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            36608K
NUMA node0 CPU(s):   0-7
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1

内存信息:
# free -h
              total        used        free      shared  buff/cache   available
Mem:           31Gi       518Mi        27Gi       1.0Mi       2.8Gi        30Gi
Swap:            0B          0B          0B

[预期结果]:
测试套编译成功

[实际结果]:
测试套编译过程中有多处失败,编译失败
Comment 1 wangpingping alibaba_cloud_group 2023-03-09 18:29:54 UTC
最后编译失败的点如下:
make[4]: Entering directory '/home/wb-wpp899309/ltp/testcases/network/multicast/mc_cmds'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/wb-wpp899309/ltp/testcases/network/multicast/mc_cmds'
make[4]: Entering directory '/home/wb-wpp899309/ltp/testcases/network/multicast/mc_gethost'
gcc -fcommon -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition  -I../../../../include -I../../../../include -I../../../../include/old/   -L../../../../lib  mc_gethost.c   -lltp -o mc_gethost
mc_gethost.c: In function ‘main’:
mc_gethost.c:54:19: error: ‘RES_USE_INET6’ undeclared (first use in this function)
   54 |   _res.options |= RES_USE_INET6;
      |                   ^~~~~~~~~~~~~
mc_gethost.c:54:19: note: each undeclared identifier is reported only once for each function it appears in
make[4]: *** [<builtin>: mc_gethost] Error 1
make[4]: Leaving directory '/home/wb-wpp899309/ltp/testcases/network/multicast/mc_gethost'
make[3]: *** [../../../include/mk/generic_trunk_target.inc:93: all] Error 2
make[3]: Leaving directory '/home/wb-wpp899309/ltp/testcases/network/multicast'
make[2]: *** [../../include/mk/generic_trunk_target.inc:93: all] Error 2
make[2]: Leaving directory '/home/wb-wpp899309/ltp/testcases/network'
make[1]: *** [../include/mk/generic_trunk_target.inc:93: all] Error 2
make[1]: Leaving directory '/home/wb-wpp899309/ltp/testcases'
make: *** [Makefile:114: testcases-all] Error 2
Comment 2 wangpingping alibaba_cloud_group 2023-03-15 15:00:16 UTC
系环境原因,环境本来内存为32G,当时环境上内存显示只有900多兆,导致报错,重置环境后,并安装依赖包gcc-c++,可以编译通过;
非问题,故closed此缺陷;