iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.52k stars 3.88k forks source link

CentOS7.7 hello_world.py Segfault #2692

Open THU-jty opened 4 years ago

THU-jty commented 4 years ago

I follow install.md to install LLVM, clang and finally bcc, there is no error during installing, but I cannot run hello_world.py due to Segmentation fault. I use Python2.7 and install bcc-tools. This is my kernel config

[root@globus-client tools]# grep _BPF /boot/config-$(uname -r)
CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT_ALWAYS_ON=y
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NET_CLS_BPF=m
CONFIG_BPF_JIT=y
CONFIG_BPF_EVENTS=y

and this is my gdb results.

[root@globus-client examples]# gdb python
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-115.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python2.7...Reading symbols from /usr/bin/python2.7...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Missing separate debuginfos, use: debuginfo-install python-2.7.5-86.el7.x86_64
(gdb) run -x ./hello_world.py
Starting program: /usr/bin/python -x ./hello_world.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
warning: File "/usr/local/lib64/libstdc++.so.6.0.24-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py:/usr/lib/golang/src/runtime/runtime-gdb.py".
To enable execution of this file add
        add-auto-load-safe-path /usr/local/lib64/libstdc++.so.6.0.24-gdb.py
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
Detaching after fork from child process 3883.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6db6397 in __strncpy_sse2 () from /usr/lib64/libc.so.6

Can anyone help me? Thanks

pchaigno commented 4 years ago

Could you please add gdb's backtrace to your post?