iovisor / iovisor/bcc

OSError: /lib/x86_64-linux-gnu/libbcc.so.0: undefined symbol: _ZSt28__throw_bad_array_new_lengthv

Open
#4,610 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

I install BCC use source follow :INSTALL.md.

My system:
uname -a
Linux liujilei-virtual-machine 5.19.0-35-generic https://github.com/iovisor/bcc/pull/36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64
x86_64 x86_64 GNU/Linux
so i install the depends: sudo apt install -y bison build-essential cmake flex git libedit-dev
libllvm14 llvm-14-dev libclang-14-dev python3 zlib1g-dev libelf-dev libfl-dev python3-setuptools

build follow:
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 .. # build python3 binding
pushd src/python/
make
sudo make install
popd

run example:
cd bcc/example
python3 hello_word.py and error:
python3 hello_world.py
Traceback (most recent call last):
File "/usr/share/bcc/tools/./stackcount", line 19, in
from bcc import BPF, USDT
File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 26, in
from .libbcc import lib, bcc_symbol, bcc_symbol_option, bcc_stacktrace_build_id, _SYM_CB_TYPE
File "/usr/lib/python3/dist-packages/bcc/libbcc.py", line 17, in
lib = ct.CDLL("libbcc.so.0", use_errno=True)
File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /lib/x86_64-linux-gnu/libbcc.so.0: undefined symbol: _ZSt28__throw_bad_array_new_lengthv
Has anyone encountered this problem?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with INSTALL.md and the build commands in the report, then inspect the generated libbcc.so.0 and the Python binding under src/python/. Reproduce the import failure from bcc/example/hello_world.py or hello_word.py and compare the build and runtime library dependencies; done means the Python example imports bcc without the undefined-symbol error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, linux, python
Domain
build-system, observability-sre, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.