Commit b2d792cb authored by Jan's avatar Jan Committed by GitHub

Fixes SEGFAUL in libbcc when actually setting a lost_cb

When setting a lost_cb, the reference to the ctypes function is not retained like the regular callback,
this leads to a SEGFAULT if the gc kills the lost_fn if a lost event occurs afterwards
parent 784057b1
......@@ -533,7 +533,7 @@ class PerfEventArray(ArrayBase):
self[self.Key(cpu)] = self.Leaf(fd)
self.bpf._add_kprobe((id(self), cpu), reader)
# keep a refcnt
self._cbs[cpu] = fn
self._cbs[cpu] = (fn, lost_fn)
def close_perf_buffer(self, key):
reader = self.bpf.open_kprobes.get((id(self), key))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment