v0.36.0 on v6.18: bindsnoop - error: invalid application of 'sizeof' to an incomplete type 'struct bpf_task_work'
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
Release v0.36.0 fails to run `bindsnoop` Python tool it provides on Linux 6.18.7 which it supposed to support:
```
# /usr/src/tmp/bcc-buildroot/usr/share/bcc/tools/bindsnoop
In file included from /virtual/main.c:17:
In file included from include/net/sock.h:46:
In file included from include/linux/netdevice.h:44:
In file included from include/uapi/linux/neighbour.h:6:
In file included from include/linux/netlink.h:9:
In file included from include/net/scm.h:9:
In file included from include/linux/security.h:35:
include/linux/bpf.h:409:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_task_work'
409 | return sizeof(struct bpf_task_work);
| ^ ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:409:24: note: forward declaration of 'struct bpf_task_work'
409 | return sizeof(struct bpf_task_work);
| ^
include/linux/bpf.h:443:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_task_work'
443 | return __alignof__(struct bpf_task_work);
| ^ ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:443:29: note: forward declaration of 'struct bpf_task_work'
443 | return __alignof__(struct bpf_task_work);
| ^
2 errors generated.
Traceback (most recent call last):
File "/usr/src/tmp/bcc-buildroot/usr/share/bcc/tools/bindsnoop", line 468, in
b = BPF(text=bpf_text)
File "/usr/src/tmp/bcc-buildroot/usr/lib64/python3/site-packages/bcc/__init__.py", line 507, in __init__
raise Exception("Failed to compile BPF module %s" % (src_file or ""))
Exception: Failed to compile BPF module
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure by running the provided bindsnoop command on Linux 6.18.7, then inspect the generated BPF source and the referenced include/linux/bpf.h definitions. Trace how bindsnoop reaches the incomplete bpf_task_work type and verify that the tool compiles and starts successfully on the reported kernel.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux, python
- Domain
- observability-sre, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100