✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: December 15, 2025
  • 6 min read

Async‑Profiler Kernel Bug in Linux 6.17 Freezes QuestDB – Workarounds & Insights

The async‑profiler kernel bug in Linux 6.17 freezes the entire system when QuestDB is profiled, and the immediate workaround is to run async‑profiler with the -e ctimer option or downgrade to a kernel version prior to 6.17.


Async Profiler Kernel Bug Illustration

Async‑Profiler Kernel Bug Cripples QuestDB on Linux 6.17 – Diagnosis, Debugging, and Mitigation

Why This Matters to Database Engineers and DevOps Teams

QuestDB is renowned for ultra‑low‑latency time‑series workloads, but a recent kernel‑level regression has rendered async‑profiler unusable on the latest Linux distributions. The freeze occurs even before any user‑space process can respond, making it a critical issue for performance analysts who rely on heatmaps and flame graphs to tune query pipelines.

This article delivers a MECE‑structured deep‑dive: we outline the bug, dissect the root cause, walk through the debugging workflow, and provide concrete mitigation steps. Along the way, we’ll show how UBOS’s low‑code platform overview can help you automate profiling pipelines without hitting the same dead‑end.

1️⃣ Summary of the Async‑Profiler Kernel Bug

The bug manifests as a complete system freeze when async‑profiler attaches to any Java process that uses perf_event with the default cpu‑clock event. QuestDB, being a Java‑based engine, triggers the bug as soon as the profiler tries to sample threads. The freeze is reproducible on any distribution shipping Linux 6.17 (e.g., Ubuntu 25.10, Fedora 40) and is independent of QuestDB version.

  • System becomes unresponsive to keyboard, mouse, and SSH.
  • Only a hard reset restores operation.
  • Root cause: a deadlock in the hrtimer_cancel() path of the perf_events subsystem.

2️⃣ Technical Analysis – What’s Happening Inside the Kernel?

Async‑profiler relies on the Linux perf_events API to generate periodic cpu‑clock interrupts. The workflow is:

  1. Open a perf_event file descriptor per thread.
  2. Arm the event with PERF_EVENT_IOC_REFRESH(1) for a one‑shot sample.
  3. When the timer expires, the kernel’s high‑resolution timer (hrtimer) fires and delivers a signal.
  4. The signal handler records the stack trace and re‑arms the event.

In Linux 6.17, commit 18dbcbfabfff introduced a regression while fixing a different issue. The problematic code path looks like this:

static void cpu_clock_event_stop(struct perf_event *event, int flags) {
    hrtimer_cancel(&event->hrtimer);
    // … other cleanup …
}

hrtimer_cancel() is a blocking call that spins until the timer callback finishes. When cpu_clock_event_stop() is invoked from inside the very same callback (the perf_swevent_hrtimer() function), the kernel ends up waiting for itself, creating an infinite deadlock. Because the deadlock occurs in interrupt context with preemption disabled, the CPU cannot schedule any other work, leading to a full system freeze.

The fix, merged in later kernel releases, replaces hrtimer_cancel() with the non‑blocking hrtimer_try_to_cancel() and adds a PERF_HES_STOPPED flag to safely abort the timer without waiting. Until those patches land in your distro, the only safe path is to avoid the perf_events code path altogether.

3️⃣ Workaround – Using the ctimer Event Mode

Async‑profiler offers an alternative event source: ctimer. This mode uses a kernel‑space CPU timer that does not rely on perf_events, thereby sidestepping the deadlock entirely.

Command‑line example:

./profiler.sh -e ctimer -f heatmap -d 30 -o questdb-profile.svg

For QuestDB users, the recommended steps are:

  1. Update async‑profiler to the latest release (≥ 2.9) which includes -e ctimer documentation.
  2. Modify your startup script to include -e ctimer when launching QuestDB with profiling enabled.
  3. Verify that the perf_event_paranoid sysctl is set to -1 only if you must use perf_events; otherwise keep the default for security.

If you cannot change the profiler flags (e.g., third‑party tooling), consider downgrading the kernel to 6.16 or applying the back‑ported patch from the upstream repository.

4️⃣ Debugging the Freeze – Tools and Methodology

Reproducing a kernel deadlock requires a controlled environment. The following toolchain proved essential:

  • QEMU – Full system virtualization with a built‑in GDB server.
  • GDB – Live kernel debugging, allowing inspection of hrtimer structures.
  • perf – To confirm that the cpu‑clock event is the trigger.
  • UBOS Workflow Automation Studio – Used to script the VM provisioning and automate the repeatable steps (Workflow automation studio).

The debugging flow:

  1. Create a fresh Ubuntu 25.10 VM with qemu-img create and install the OS.
  2. Install QuestDB and async‑profiler.
  3. Set /proc/sys/kernel/perf_event_paranoid=-1 to enable perf_events.
  4. Launch QuestDB with -p (profiler) and attach async‑profiler.
  5. Observe the freeze, then reconnect GDB via target remote :1234.
  6. Inspect the call stack – you’ll see hrtimer_cancel() looping inside perf_swevent_hrtimer().

The Web app editor on UBOS helped prototype a small UI that toggles the -e ctimer flag, making the mitigation instantly testable for non‑technical stakeholders.

5️⃣ Impact on QuestDB Deployments & Practical Recommendations

For production environments, the freeze translates to:

  • Unexpected downtime during performance‑tuning windows.
  • Potential data ingestion loss if the freeze occurs during high‑throughput ingestion.
  • Increased operational overhead for incident response (hard reboots).

Recommended action plan:

  1. Audit kernel versions across all QuestDB nodes. Anything ≥ 6.17 needs attention.
  2. Standardize profiling scripts to include -e ctimer. Store them in the UBOS templates for quick start library for consistency.
  3. Leverage UBOS AI marketing agents to automatically generate alerts when a profiling job fails (AI marketing agents).
  4. Consider kernel back‑port patches via your distro’s security channel or compile a custom kernel with the fix.
  5. Test in staging using the UBOS partner program sandbox to validate the mitigation before production rollout.

If you need a ready‑made profiling dashboard, the AI SEO Analyzer template can be repurposed to ingest QuestDB metrics and display heatmaps without invoking async‑profiler directly.

Conclusion & Next Steps

The async‑profiler kernel bug is a classic example of how a seemingly unrelated kernel commit can cripple high‑performance databases. By understanding the why (the hrtimer_cancel() deadlock) and the how (using -e ctimer or applying the patch), you can keep QuestDB humming at nanosecond latency.

Ready to future‑proof your profiling workflow? Explore the Enterprise AI platform by UBOS for automated observability pipelines, or jump straight into a pre‑configured AI Article Copywriter template to generate performance reports at scale.

Stay ahead of kernel regressions – subscribe to our UBOS newsletter and get real‑time alerts on critical Linux updates.


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.