6 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
The author details a kernel bug that caused their machine to freeze when using async-profiler, despite previously working versions. They trace the issue to a specific kernel commit, explore its mechanics, and discover a workaround using a different profiling option. The article also covers the author's process of debugging the kernel using QEMU.
If you do, here's more
The author recounts a frustrating experience with a Linux kernel bug that caused their machine to freeze while using async-profiler, a tool for analyzing CPU performance. After a long period of stability, the issue arose when the author attempted to investigate latency spikes in QuestDB, leading to complete system freezes whenever they tried to attach the profiler. Despite testing older versions of QuestDB, the problem persisted, pointing to an environmental issue rather than a bug in the application itself.
Upon further investigation, the author discovered a report from Francesco Nigro, who faced the same freezing issue on Fedora, both using the same kernel version (6.17). By booting an older Ubuntu version, the profiler worked without problems. The author identified a kernel patch that addressed the bug, which originated from a commit intended to fix a different issue but inadvertently introduced a deadlock in the handling of cpu-clock events. This deadlock occurred when the kernel tried to cancel a timer while already executing its callback, resulting in unresponsive CPUs and system freezes.
The article explains how async-profiler operates using the perf_events subsystem, relying on high-resolution timers to sample application performance. The author highlights the specific sequence of operations that lead to the deadlock during profiling. A kernel patch corrected the issue by replacing a blocking function with a non-blocking alternative and introducing a deferred stop signal. This allowed the kernel to avoid waiting indefinitely for a callback to complete, thus preventing the system from freezing when using async-profiler.
Questions about this article
No questions yet.