dropbox / goebpf

Library to work with eBPF programs from Go
Other
1.13k stars 86 forks source link

Crash on PerfEvents Stop() #79

Open bogdanvbalan opened 1 year ago

bogdanvbalan commented 1 year ago

Calling perf.Stop() immediately after calling perf.StartForAllProcessesAndCPUs() will lead to a crash. This can be reproduced in the xdp_dump example by adding perf.Stop() call after the successful perf.StartForAllProcessesAndCPUs() call. The initial use case where it was observed was having multiple perf maps, initializing multiple PerfEvents, one for each map, and calling Stop() on the init sequence for the PerfEvents that were already started.

belyalov commented 1 year ago

You're very welcome to make a pull request if you know how to reproduce and fix it.. :)