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
116 stars 10 forks source link

pkg/exitsnoop: hold raw_tp link to prevent from GC #17

Closed fuweid closed 2 years ago

fuweid commented 2 years ago

The cilium/ebpf defines sys.FD's SetFinalizer to close fd when GC. Since the exec process's exit code needs memory-type exitsnoop, we should keep the reference on the raw_tp link. Otherwise, the exitsnoop will be gone and process's exit code will be wrong.

Signed-off-by: Wei Fu fuweid89@gmail.com