Bug 131 - [Anolis OS 8.4 龙芯版][4.19.190-3.an8.loongarch64]ltp测试时clone302用例fail,fail原因为构造无效的pidfd,然后通过clone3创建进程,预期返回错误码EFAULT,实际返回错误码EINVAL
Summary: [Anolis OS 8.4 龙芯版][4.19.190-3.an8.loongarch64]ltp测试时clone302用例fail,fail原因为构造...
Status: CLOSED INVALID
Alias: None
Product: ANCK 4.19 Dev
Classification: ANCK
Component: general/others (show other bugs) general/others
Version: unspecified
Hardware: loongarch Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: wenlong
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-17 15:18 UTC by shanxifanshi
Modified: 2023-07-25 15:22 UTC (History)
5 users (show)

See Also:


Attachments
用例部分代码实现已fail点见图中标记 (99.51 KB, image/png)
2021-12-17 15:18 UTC, shanxifanshi
Details
报错图片 (63.22 KB, image/png)
2021-12-20 10:16 UTC, wulifuture
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shanxifanshi alibaba_cloud_group 2021-12-17 15:18:15 UTC
Created attachment 30 [details]
用例部分代码实现已fail点见图中标记

[缺陷描述]:
ltp测试时syscalls目录下的clone302用例fail,fail原因为构造无效的pidfd,然后通过clone3创建进程,预期返回错误码EFAULT,实际返回错误码EINVAL

测试日志:
<<<test_start>>>
tag=clone302 stime=1639724726
cmdline="clone302"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
tst_buffers.c:55: TINFO: Test is using guarded buffers
tst_test.c:1411: TINFO: Timeout per run is 0h 05m 00s
clone302.c:101: TPASS: invalid args: clone3() failed as expected: EFAULT (14)
clone302.c:101: TPASS: zero size: clone3() failed as expected: EINVAL (22)
clone302.c:101: TPASS: short size: clone3() failed as expected: EINVAL (22)
clone302.c:101: TPASS: extra size: clone3() failed as expected: EFAULT (14)
clone302.c:101: TPASS: sighand-no-VM: clone3() failed as expected: EINVAL (22)
clone302.c:101: TPASS: thread-no-sighand: clone3() failed as expected: EINVAL (22)
clone302.c:101: TPASS: fs-newns: clone3() failed as expected: EINVAL (22)
clone302.c:97: TFAIL: invalid pidfd: clone3() should fail with EFAULT: EINVAL (22)
clone302.c:101: TPASS: invalid signal: clone3() failed as expected: EINVAL (22)
clone302.c:101: TPASS: zero-stack-size: clone3() failed as expected: EINVAL (22)
clone302.c:101: TPASS: invalid-stack: clone3() failed as expected: EINVAL (22)

Summary:
passed   10
failed   1
broken   0
skipped  0
warnings 0
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>

系统镜像:
http://8.131.87.1/kojifiles/output/an-8-loongarch64-RC1/compose/BaseOS/loongarch64/iso/

复现环境:
龙芯物理机

复现概率:
必现

[复现步骤]:
git clone https://github.com/linux-test-project/ltp.git
cd ltp
make autotools
./configure
make
make install
/opt/ltp/runltp -f syscalls -s clone302

内核信息:
# uname -r
4.19.190-3.an8.loongarch64

操作系统信息:
# cat /etc/anolis-release
Anolis OS release 8.4
[root@localhost ~]# cat /etc/os-release
NAME="Anolis OS"
VERSION="8.4"
ID="anolis"
ID_LIKE="rhel fedora centos"
VERSION_ID="8.4"
PLATFORM_ID="platform:an8"
PRETTY_NAME="Anolis OS 8.4"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"

cpu信息:
# lscpu
Architecture:        loongarch64
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
CPU family:          Loongson-64bit
Model name:          Loongson-3A5000LL
BogoMIPS:            4600.00
L1d cache:           64K
L1i cache:           64K
L2 cache:            256K
L3 cache:            16384K
NUMA node0 CPU(s):   0-3
Flags:               cpucfg lam ual fpu lsx lasx complex crypto lvz lbt_x86 lbt_arm lbt_mips

内存信息:
# free -h
              total        used        free      shared  buff/cache   available
Mem:           15Gi       1.3Gi       2.7Gi        18Mi        11Gi        12Gi
Swap:         7.9Gi       1.0Mi       7.9Gi

[期望结果]:
clone302用例pass

[实际结果]:
clone302用例fail

[初步分析]:
测试代码路径:ltp/testcases/kernel/syscalls/clone3/clone302.c

通过构造无效的地址来构造无效的pidfd,然后通过clone3创建进程,预期返回错误码EFAULT,实际返回错误码EINVAL
Comment 1 wulifuture 2021-12-20 10:16:30 UTC
Created attachment 36 [details]
报错图片
Comment 2 wulifuture 2021-12-20 10:17:30 UTC
龙芯3A5000台式机LTP稳定性压力测试fail,为同样问题
报错信息见附件

[root@localhost ltp]# lscpu
架构:           loongarch64
字节序:         Little Endian
CPU:             4
在线 CPU 列表:  0-3
每个核的线程数: 1
每个座的核数:   4
座:             1
NUMA 节点:      1
CPU 系列:       Loongson-64bit
型号名称:       Loongson-3A5000
BogoMIPS:       5000.00
L1d 缓存:       64K
L1i 缓存:       64K
L2 缓存:        256K
L3 缓存:        16384K
NUMA 节点0 CPU: 0-3
标记:           cpucfg lam ual fpu lsx lasx complex crypto lvz lbt_x86 lbt_arm lbt_mips

系统镜像:
http://8.131.87.1/kojifiles/output/an-8-loongarch64-RC1/compose/BaseOS/loongarch64/iso/

内核:
[root@localhost ~]# uname -r
4.19.190-3.an8.loongarch64

硬件设备:
Loongson-3A5000台式机
Comment 3 wenlong loongson_group 2021-12-20 15:43:13 UTC
已跟踪,内部id号:2029
Comment 4 liqianwen loongson_group 2021-12-24 16:46:23 UTC
[测试描述]
X86 ltp测试syscalls目录下的clone302用例时,终端显示内核版本因低于5.3而无法继续测试
[测试日志]
<<<test_start>>>
tag=clone302 stime=1640316460
cmdline="clone302"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
tst_buffers.c:55: TINFO: Test is using guarded buffers
tst_test.c:1428: TINFO: Timeout per run is 0h 05m 00s
../../../../include/lapi/clone.h:52: TCONF: Test not supported on kernel version < v5.3
Summary:
passed   0
failed   0
broken   0
skipped  1
warnings 0
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=32 corefile=no
cutime=0 cstime=0
<<<test_end>>>
[复现步骤]:
git clone https://github.com/linux-test-project/ltp.git
cd ltp
make autotools
./configure
make
make install
/opt/ltp/runltp -f syscalls -s clone302
[内核信息]
# uname -r
4.18.0-305.25.1.el8_4.x86_64
[操作系统信息]
# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
[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:  1
Core(s) per socket:  1
Socket(s):           8
NUMA node(s):        1
Vendor ID:           GenuineIntel
BIOS Vendor ID:      Red Hat
CPU family:          6
Model:               85
Model name:          Intel Xeon Processor (Skylake, IBRS)
BIOS Model name:     RHEL-8.2.0 PC (Q35 + ICH9, 2009)
Stepping:            4
CPU MHz:             2194.838
BogoMIPS:            4389.67
Virtualization:      VT-x
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            4096K
L3 cache:            16384K
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 syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat umip pku ospke md_clear arch_capabilities
[内存信息]
# free -h
              total        used        free      shared  buff/cache   available
Mem:           15Gi       672Mi        14Gi        20Mi       711Mi        14Gi
Swap:            0B          0B          0B
[期望结果]:
clone302用例pass

[实际结果]:
clone302用例fail
Comment 5 yangyinglu loongson_group 2021-12-27 11:52:41 UTC
Test not supported on kernel version < v5.3,因此,此问题不用关注
Comment 6 wenlong loongson_group 2022-01-12 16:19:07 UTC
Test not supported on kernel version < v5.3,因此,此问题不用关注