Bug 6268 - [alinux3][x86_64/aarch64][nightly]bcc:bcc-tools升级到0.19.0-5.0.4.al8版本后,bcc下多个测试用例失败,报错:Segmentation fault (core dumped)
Summary: [alinux3][x86_64/aarch64][nightly]bcc:bcc-tools升级到0.19.0-5.0.4.al8版本后,bcc下多个测...
Status: NEW
Alias: None
Product: Antest
Classification: Infrastructures
Component: 测试用例 (show other bugs) 测试用例
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: shuming
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-29 11:54 UTC by wangpingping
Modified: 2023-08-29 11:54 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wangpingping alibaba_cloud_group 2023-08-29 11:54:06 UTC
[缺陷描述]:
bcc-tools从0.19.0-5.0.2.al8升级到0.19.0-5.0.4.al8版本后,bcc下多个测试用例失败;

bcc-tools版本:
# rpm -qa |grep bcc-tools
bcc-tools-0.19.0-5.0.4.al8.x86_64

# rpm -qa |grep bcc
libccd-2.1-4.el8.x86_64
bcc-tools-0.19.0-5.0.4.al8.x86_64
bcc-0.19.0-5.0.4.al8.x86_64
python3-bcc-0.19.0-5.0.4.al8.x86_64
libccd-devel-2.1-4.el8.x86_64

失败用例:
Default Setup... Do nothing
test_trace1.py: Fail
test_trace2.py: Fail
test_trace3.py: Fail
test_trace4.py: Fail
test_trace_maxactive.py: Fail
test_probe_count.py: Pass
test_debuginfo.py: Pass
test_clang.py: Fail
test_histogram.py: Fail
test_array.py: Fail
test_uprobes.py: Fail
test_tracepoint.py: Fail
test_perf_event.py: Fail
test_utils.py: Pass
test_percpu.py: Fail
test_dump_func.py: Pass
test_disassembler.py: Fail
test_tools_smoke.py: Fail
test_usdt.py: Fail
test_usdt2.py: Fail
test_usdt3.py: Fail
test_license.py: Fail
test_free_bcc_memory.py: Pass
test_rlimit.py: Fail

以test_trace2.py为例,报错日志如下:
# python test_trace2.py
/usr/lib/python3.6/site-packages/bcc/__init__.py:310: DeprecationWarning: not a bytes object: '\n#include <linux/ptrace.h>\nstruct Ptr { u64 ptr; };\nstruct Counters { char unused; __int128 stat1; };\nBPF_HASH(stats, struct Ptr, struct Counters, 1024);\n\nint count_sched(struct pt_regs *ctx) {\n  struct Ptr key = {.ptr=PT_REGS_PARM1(ctx)};\n  struct Counters zleaf;\n\n  memset(&zleaf, 0, sizeof(zleaf));\n  struct Counters *val = stats.lookup_or_try_init(&key, &zleaf);\n  if (val) {\n    val->stat1++;\n  }\n  return 0;\n}\n'
  text = _assert_is_bytes(text)
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:2:
In file included from include/linux/compiler_types.h:69:
include/linux/compiler-clang.h:51:9: warning: '__HAVE_BUILTIN_BSWAP32__' macro redefined [-Wmacro-redefined]
#define __HAVE_BUILTIN_BSWAP32__
        ^
<command line>:4:9: note: previous definition is here
#define __HAVE_BUILTIN_BSWAP32__ 1
        ^
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:2:
In file included from include/linux/compiler_types.h:69:
include/linux/compiler-clang.h:52:9: warning: '__HAVE_BUILTIN_BSWAP64__' macro redefined [-Wmacro-redefined]
#define __HAVE_BUILTIN_BSWAP64__
        ^
<command line>:5:9: note: previous definition is here
#define __HAVE_BUILTIN_BSWAP64__ 1
        ^
In file included from <built-in>:2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from include/linux/types.h:6:
In file included from include/uapi/linux/types.h:14:
In file included from include/uapi/linux/posix_types.h:5:
In file included from include/linux/stddef.h:5:
In file included from include/uapi/linux/stddef.h:2:
In file included from include/linux/compiler_types.h:69:
include/linux/compiler-clang.h:53:9: warning: '__HAVE_BUILTIN_BSWAP16__' macro redefined [-Wmacro-redefined]
#define __HAVE_BUILTIN_BSWAP16__
        ^
<command line>:3:9: note: previous definition is here
#define __HAVE_BUILTIN_BSWAP16__ 1
        ^
3 warnings generated.
Segmentation fault (core dumped)

[复现概率]:
必现

[复现环境]:
机器:线下vm

内核:
# uname -r
5.10.134-1040.git.0c8b383f7007.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:  4
Socket(s):           1
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:             2499.998
BogoMIPS:            4999.99
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       533Mi        24Gi       2.0Mi       6.1Gi        30Gi
Swap:            0B          0B          0B


[复现步骤]:
git clone -q http://gitlab-sp.alibaba-inc.com/baseos/bcc.git bcc

解压缩 tar -zxvf xxx

ls *.patch

cd bcc

patch -p1 < ../*.patch (逐一打上patch)

chmod +x tools/*.py

yum -y install bcc-tools

cd tests/python
python test_clang.py

[预期结果]:
用例执行成功

[实际结果]:
用例执行失败