Astra finds 14-year-old libuv memory leak
After investigating intermittent ChatGPT desktop crashes on macOS, developer Peter Steinberger prompted AI agent Astra to inspect system crash logs and trace native stack traces down to a 14-year-old memory leak in libuv's Darwin filesystem watcher. Pull request #5283 resolves the bug by releasing uncollected Core Foundation objects and C path buffers across exit paths in `uv__fsevents_reschedule`, halting quadratic memory growth during watch churn.
Autonomous AI agents are shifting from surface-level code completion to deep systems engineering, proving that LLMs with environment access can track down obscure low-level C bugs that survived human review for over a decade.
- –**Autonomous OS-level triage**: Given only a high-level crash prompt, Astra navigated macOS diagnostic logs, analyzed native symbols, and traversed dependency source trees to isolate the fault without manual debugging.
- –**Classic Core Foundation trap**: The leak stemmed from `CFArrayCreate` with NULL callbacks failing to manage element lifetimes, leaving temporary `CFString` objects and C path buffers unreleased during `FSEventStream` rebuilds.
- –**Widespread downstream blast radius**: Because libuv powers Node.js, Electron, and Chromium runtimes, this watch-churn leak silently accumulated memory across numerous long-running desktop and backend tools.
- –**Production-grade validation**: Backed by deterministic ASan/UBSan regression tests and custom allocator hooks, the PR establishes a high standard for agent-assisted upstream open-source contributions.
DISCOVERED
1h ago
2026-09-22
PUBLISHED
2h ago
2026-09-22
RELEVANCE
AUTHOR
steipete