Skip to content

Release v0.5.8 (httpz epoll recv-on-freed-Conn fix)#123

Merged
kwsantiago merged 1 commit into
mainfrom
fix/httpz-epoll-uaf
Jun 29, 2026
Merged

Release v0.5.8 (httpz epoll recv-on-freed-Conn fix)#123
kwsantiago merged 1 commit into
mainfrom
fix/httpz-epoll-uaf

Conversation

@kwsantiago

Copy link
Copy Markdown
Contributor

Fixes #120: a recurring SIGSEGV during normal operation under connection churn.

http.zig's epoll worker closed a finished connection's socket on a worker thread (to implicitly drop it from epoll), then recycled the Conn later via processSignal. That close raced epoll_wait, so the fd could stay armed past the recycle and a later batch delivered a .recv for freed memory -> getState on a null/recycled HTTPConn (fault at the _state offset). Confirmed reproducing on v0.5.7 every few hours.

The fix removes the fd from epoll and closes it on the loop thread, before disown recycles the Conn (mirroring the synchronous EPOLL_CTL_DEL that HTTPConn.disown already does for res.disown()).

Pinned to a temporary privkeyio http.zig fork (0c6cd82, = upstream 8dc6441 + the one fix). Upstream PR karlseguin/http.zig#216; will repoint to upstream and drop the fork once it merges.

  • httpz pin -> privkeyio fork 0c6cd82
  • version 0.5.7 -> 0.5.8 + CHANGELOG

Verified: http.zig 125-test suite passes; wisp unit tests pass; survived 4000 connect/GET/close + partial-close churn cycles with no crash, then clean shutdown.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kwsantiago, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7122d218-2e62-4c57-b1a2-659164600c51

📥 Commits

Reviewing files that changed from the base of the PR and between 89c11b0 and befa5df.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • build.zig.zon
  • src/main.zig
  • src/nip11.zig
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/httpz-epoll-uaf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kwsantiago kwsantiago merged commit c820359 into main Jun 29, 2026
4 checks passed
@kwsantiago kwsantiago deleted the fix/httpz-epoll-uaf branch June 29, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] httpz epoll .recv segfault: getState on null/freed HTTPConn (worker disown lacks EPOLL_CTL_DEL)

1 participant