Skip to content

Inconsistent /tmp/kheaders directory makes bcc fail #4213

@ncfavier

Description

@ncfavier

I just spent way too long debugging why execsnoop failed with this error:

<built-in>:1:10: fatal error: './include/linux/kconfig.h' file not found
#include "./include/linux/kconfig.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Traceback (most recent call last):
  File "/nix/store/7dgdpsd8lrclqzl4s5vmlm8hwm0y91d2-bcc-0.24.0/share/bcc/tools/.execsnoop-wrapped", line 228, in <module>
    b = BPF(text=bpf_text)
  File "/nix/store/7dgdpsd8lrclqzl4s5vmlm8hwm0y91d2-bcc-0.24.0/lib/python3.10/site-packages/bcc/__init__.py", line 475, in __init__
    raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
Exception: Failed to compile BPF module <text>

The reason was that I had a directory /tmp/kheaders-5.18.15 containing nothing but an empty include/uapi directory. I have no idea how this happened. rm -r /tmp/kheaders-5.18.15 fixed it.

A few ideas on what needs to be done:

I'm on Linux 5.18.15, NixOS unstable, BCC 0.24.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions