iovisor / iovisor/bcc

errors running bcc-tools in a container image

Open
#4,705 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
5d 13h
Merged PRs (30d)
3

Description

Dockerfile used to build image
```
ARG VERSION="18.04"
FROM ubuntu:${VERSION}

RUN echo "deb [trusted=yes] http://repo.iovisor.org/apt/xenial xenial-nightly main" > /etc/apt/sources.list.d/iovisor.list

RUN apt-get update && apt-get install -y libelf1 bcc-tools libbcc
```
running the container
```
podman run -it --rm --privileged --name=appname --net=host --pid=host -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /sys/kernel/debug:/sys/kernel/debug kepler:bcc-tools
```
kernel version: `6.1.15-200.fc37.x86_64`

lots of such errors:

```
root@thinkpad:/# /usr/share/bcc/tools/capable
In file included from :317:
In file included from :7:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/types.h:6:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/uapi/linux/types.h:14:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/uapi/linux/posix_types.h:5:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/stddef.h:5:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/uapi/linux/stddef.h:5:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/compiler_types.h:94:
/lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/compiler-clang.h:41:9: warning: '__HAVE_BUILTIN_BSWAP32__'
macro redefined [-Wmacro-redefined]
#define __HAVE_BUILTIN_BSWAP32__
^
:4:9: note: previous definition is here
#define __HAVE_BUILTIN_BSWAP32__ 1
^

In file included from /virtual/main.c:2:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/uapi/linux/ptrace.h:153:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/arch/x86/include/asm/ptrace.h:5:
/lib/modules/6.1.15-200.fc37.x86_64/build/arch/x86/include/asm/segment.h:256:2: error: expected '(' after 'asm'
alternative_io ("lsl %[seg],%[p]",
^
/lib/modules/6.1.15-200.fc37.x86_64/build/arch/x86/include/asm/alternative.h:249:2: note: expanded from macro
'alternative_io'
asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, feature) \
^
/lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/compiler_types.h:292:24: note: expanded from macro 'asm_inline'
#define asm_inline asm __inline

In file included from /virtual/main.c:3:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/sched.h:14:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/pid.h:5:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/rculist.h:11:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/rcupdate.h:26:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/irqflags.h:16:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/arch/x86/include/asm/irqflags.h:63:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/arch/x86/include/asm/paravirt.h:17:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/cpumask.h:12:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/bitmap.h:11:
In file included from /lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/string.h:253:
/lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/fortify-string.h:136:7: error: conflicting pass_object_size
attributes on parameters
char *strncpy(char * const POS p, const char *q, __kernel_size_t size)
^
/lib/modules/6.1.15-200.fc37.x86_64/build/include/linux/string.h:26:15: note: previous declaration is here
extern char * strncpy(char *,const char *, __kernel_size_t);
^

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Dockerfile and the podman command, then reproduce `/usr/share/bcc/tools/capable` against the mounted Fedora 6.1.15 kernel headers. Inspect how the container's bcc-tools compilation interacts with `/lib/modules/.../build`; done means the tool runs without the reported macro, asm, and conflicting-attribute errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, docker, linux, ubuntu
Domain
devops, devtools, observability, 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.