fuweid / embedshim

Provide task runtime implementation with pidfd and eBPF sched_process_exit tracepoint to manage deamonless container with low overhead.
Apache License 2.0
117 stars 11 forks source link

program handle_sched_process_exit: apply CO-RE relocations: bad magic number '[159 235 1 0]' in record at byte 0x0 #35

Open 113xiaoji opened 9 months ago

113xiaoji commented 9 months ago

Background

When loading the shim plugin, the following error is reported:

time="2024-01-21T11:07:44.731463684+08:00" level=warning msg="failed to load plugin io.containerd.runtime.v1.embed" error="program handle_sched_process_exit: apply CO-RE relocations: bad magic number '[159 235 1 0]' in record at byte 0x0"

Adding a print statement in exitsnoop.bpf.c seems to circumvent the issue:

 rt = (struct task_info *)bpf_map_lookup_elem(&tracing_tasks, &pid);
    if (!rt)
            // todo Adding this print avoids the 'apply CO-RE relocations: bad magic number' error, specific cause to be located
            bpf_printk("rt is: %p\n",rt);
        return 0;