Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#849747: bpfcc-tools needs different compile flags to work

132 views
Skip to first unread message

George Kargiotakis

unread,
Dec 30, 2016, 7:10:02 AM12/30/16
to
Package: bpfcc-tools
Version: 0.2.0-1
Severity: grave
Tags: newcomer
Justification: renders package unusable

Dear Maintainer,

Trying to run binaries after installing bpfcc-tools ends up in an error like the following:

# tcpconnect
In file included from <built-in>:317:
<command line>:5:10: fatal error: './include/linux/kconfig.h' file not found
#include "./include/linux/kconfig.h"
^
1 error generated.
Traceback (most recent call last):
File "/usr/sbin/tcpconnect", line 207, in <module>
b = BPF(text=bpf_text)
File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 197, in __init__
raise Exception("Failed to compile BPF module %s" % src_file)
Exception: Failed to compile BPF module

The fix for this is already upstream and one needs to change the debian/rules file:

- dh_auto_configure -- -DREVISION_LAST=$(UPSTREAM_VERSION) -DREVISION=$(UPSTREAM_VERSION) -DLLVM_DEFINITIONS="-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+ dh_auto_configure -- -DREVISION_LAST=$(UPSTREAM_VERSION) -DREVISION=$(UPSTREAM_VERSION) -DLLVM_DEFINITIONS="-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -DBCC_KERNEL_HAS_SOURCE_DIR=1

The fix is documented here:
https://github.com/dkronst/bcc/commit/3e2f9d9d6250d3f8a076bbf1a953cf4f0d21f75a

After applying the change in debian/rules and rebuilding the package the binaries work:

# tcpconnect
In file included from /virtual/main.c:3:
In file included from include/net/sock.h:51:
In file included from include/linux/netdevice.h:38:
In file included from include/linux/dmaengine.h:20:
In file included from include/linux/device.h:24:
In file included from include/linux/pinctrl/devinfo.h:21:
In file included from include/linux/pinctrl/consumer.h:17:
In file included from include/linux/seq_file.h:10:
include/linux/fs.h:2686:9: warning: comparison of unsigned enum
expression < 0 is always false [-Wtautological-compare]
if (id < 0 || id >= READING_MAX_ID)
~~ ^ ~
1 warning generated.
PID COMM IP SADDR DADDR DPORT
3805 Chrome_IOThr 4 10.20.10.1 1.2.3.4 443

The following might also be a fix for the issue but I haven't tested it yet
https://github.com/iovisor/bcc/pull/701/files


-- System Information:
Debian Release: 8.6
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable'), (400, 'unstable'), (400, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.8.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages bpfcc-tools depends on:
ii python-bpfcc 0.2.0-1
ii python-netaddr 0.7.12-2
pn python:any <none>

bpfcc-tools recommends no packages.

bpfcc-tools suggests no packages.

-- no debconf information

George Kargiotakis

unread,
Dec 30, 2016, 12:20:03 PM12/30/16
to
Hello,

it's actually a stretch/sid chroot on a jessie host.

inside the chroot
# cat /etc/debian_version
stretch/sid

# apt-cache policy linux-libc-dev
linux-libc-dev:
Installed: 4.8.11-1
Candidate: 4.8.11-1
Version table:
*** 4.8.11-1 500
500 http://ftp.de.debian.org/debian testing/main amd64 Packages
100 /var/lib/dpkg/status

# apt-cache policy linux-headers-4.8.0-2-amd64
linux-headers-4.8.0-2-amd64:
Installed: 4.8.11-1
Candidate: 4.8.11-1
Version table:
*** 4.8.11-1 500
500 http://ftp.de.debian.org/debian testing/main amd64 Packages
100 /var/lib/dpkg/status

Take a look at https://github.com/iovisor/bcc/issues/397

Ritesh Raj Sarraf

unread,
Dec 30, 2016, 12:30:03 PM12/30/16
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Control: tag -1 +pending -moreinfo


Thanks. I've added the change to the repo. Will be part of next upload.
- --
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAlhmmK4ACgkQpjpYo/Lh
dWmTCA//ReNi6sgeefNU+JGN8xayyDE6o5c5+TToDhl/X9gI1ZgZbVYjI3tk1mdM
kez0uQ+rOOxLQZSuTeypuAl7rZzjRtRkXFDdL9JGQI3cSsf7K763leFsuMIcuXIq
50RP08N4WNyRtkbSFB2ouIzZ/4WjwR+lmeSIbJ9weLkHjz3Jt7npL8+IJqNV6dVT
QvNGiu0/zmAuXBkNVnKSRlQRD/mYYe9bJmWzt0wbGJiZc5iQDqjtHTJAo6+jz1UD
Gni5a6184zIWGuBDL7UGnMbXHi9KldZZxjKHLGMc3XV33dATQLOc6ypCShPMFNbo
2CIrgG4/Er9dpbcPyTdw7eOapYM5FziziekMKQzAgmSumO4TZdeSLp4s7o8TXPlf
7PuxjrNwEGQkxIPotH1/uc2+HA+mMxonMVnmBo9BoJyVg4tkYBTxrZQnMalm5D1B
wL6Kv06Z7+xF7nRdnZ949I5pBEZ2nzdNefzTrhpu0Ms84o5pr6jK8L7c/pXKCSMf
H+zdvH+uVYFAyicGeBblAdbl41K/yOANHAENeoU1Fj0fvcWMjgjj4plTkLD/ABhV
I8rTpt8nlW94Q+JJd4So+KWV3bp8ZiM/o1iW6x3wk1ubEpPkdFqNkeR6qH7Ln42i
lraPeJUgHcm/tWGLtHokU7RTSbwlaKep60RU3QzOj0wz8ojozaU=
=dhQ6
-----END PGP SIGNATURE-----
0 new messages