When LLVM's Optimizer Breaks Your eBPF Program

This is a weird bug I ran into while working on the ebpf. A call to the built-in function ‘memset’ is not supported, and the confusing part was that I was using __builtin_memset . Here is the code. #include 'vmlinux.h' #include <bpf/bpf_helpers.h> #include <bpf/bpf_core_read.h> #define PATH_MAX 1024 struct path_key { char container_path[PATH_MAX]; // 1024 bytes char directory_path[PATH_MAX]; //…