OSError: /lib/x86_64-linux-gnu/libbcc.so.0: undefined symbol: _ZSt28__throw_bad_array_new_lengthv
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
same problem
Traceback (most recent call last):
File "//./offcputime.py", line 14, in
In my case, the issue was caused by a difference in GCC versions between Python 3 and the one used for compilation.
In my case, the issue was caused by a difference in GCC versions between Python 3 and the one used for compilation.
@hov1417 So how do you solve it ?
These were the outputs of gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 10.5.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
and python3
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
note that gcc is 10.5.0 in one case and 11.4.0 in the other. I changed my current using update-alternatives
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
@hov1417 I see but it not works for me :(. Anyway thank you very much.