Recent Linux kernels have bugs with the perf_event subsystem which can be triggered by PAPI. These bugs can lead to kernel panics and system crashes. The bugs have been fixed upstream but the fixes are only gradually getting into vendor kernels. If your code causes a crash, you should upgrade to a kernel with the fixes applied.
- Bug 1 involves "inherit" support. perf_event inherit support was only added to PAPI as of the recent 4.1.3 release. This bug causes a memory leak in the kernel that will eventually out-of-memory your machine with unfreeable memory. It is triggered by using the perf_event substrate to measure at least two events with the "inherit" option set, then running a multithreaded workload.
The fix for this will be in the forthcoming 2.6.39 Linux kernel, and the patch has been included in the relevant stable series trees (126.96.36.199, etc.). The changeset for the fix is:
- Bug 2 involves multiplexing support (PAPI will only use kernel multiplexing on kernels 2.6.33 and newer). If you use multiplexing on multithreaded workloads you can eventually see a kernel panic.
The fix for this will be in the forthcoming 2.6.39 Linux kernel, and the patch has been included in the relevant stable trees (188.8.131.52, etc.). The changeset for the fix is: