Skip to content

test(forge): prove --git-memory-limit stops an oversized push on Linux - #333

Merged
tonibergholm-codento merged 2 commits into
mainfrom
test/forge-git-memory-limit
Nov 9, 2026
Merged

tonibergholm-codento merged 2 commits into
mainfrom
test/forge-git-memory-limit

Conversation

@tonibergholm-codento

Copy link
Copy Markdown
Collaborator

--git-memory-limit sets RLIMIT_DATA on each git child, but nothing had shown it working at runtime; #316 tracked that gap. This adds a Linux-only test.

  • A server with a 64 MiB limit refuses a push of a 128 MiB blob. git inflates a blob of that size in memory to hash it, so the push fails with git's Out of memory, malloc failed and moves no ref. The test asserts that message.
  • Control: the same push lands on a server with the default limit, and a small push works under the 64 MiB limit.
  • docs/THREAT-MODEL.md cites the test. It also says macOS doesn't enforce the limit, and that a cgroup on the service is the host-wide bound on Linux.

Proof: 3 of 3 runs pass in a rust:1.96.1 Linux container (git 2.47.3), and the limited push printed remote: fatal: Out of memory, malloc failed (tried to allocate 134217729 bytes). fmt and clippy pass. CI's ubuntu job runs the test.

Reviewed with sol-loop: 1 round with gpt-6.1-sol on high. Sol verdict: approved

Created with Claude Opus 5.5 in T3 Code (Claude Code harness).

A server started with a 64 MiB RLIMIT_DATA refuses a push of a 128 MiB blob
(git inflates it in memory to hash it) with git's out-of-memory error and no
ref change; the same push lands under the default limit. Linux only, since
macOS does not enforce RLIMIT_DATA.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ecf95643-2e2f-48a2-bb67-63fd402d9493
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T11:36:29.214885Z 9fe12f3 PR opened
🔒 Security Review ✅ Completed 2026-11-09T11:37:48.492685Z 9fe12f3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tonibergholm-codento
tonibergholm-codento merged commit 70af454 into main Nov 9, 2026
11 checks passed
@tonibergholm-codento
tonibergholm-codento deleted the test/forge-git-memory-limit branch November 9, 2026 11:48
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.

2 participants