AI Agent Uncovers ~14-Year-Old Memory Leak in libuv's macOS fsevents Path

steipete · x · 2026-09-23

After ChatGPT kept crashing on macOS 27, developer steipete's AI agent Astra traced the issue to a 14-year-old libuv bug: repeatedly adding/removing macOS filesystem watches leaks the temporary path list when rebuilding the shared FSEventStream — successful rebuilds skip cleanup while the error path wrongly assumes a NULL-callback CFArray frees its strings and the original C buffer. PR #5283 releases all allocations on every exit from uvfseventsreschedule with no API/ABI changes; Bun issue #29935 independently confirmed the same leak.

Related event: AI agent traces ChatGPT crashes to 14-year-old libuv bug(2 posts)→

Original post →

More from coding & agent

coding & agent channel →