No process-level heap cap: OOM aborts (rc 134); sandbox max_bytes misses general growth
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c
調査の方向性
Start by reading docs/PRINCIPLES.md and the existing sandbox_run max_bytes behavior, then trace the eigs_alloc chokepoint and run the supplied OOM reproduction. Compare the proposed cap, error, charging, and trace behavior with the sandbox requirements. Done includes a catchable named error, non-134 exit, stopped sandbox growth, a clean handles_full.eigs run, overhead measurements, and synchronized updates to docs/SPEC.md, docs/BUILTINS.md, docs/EMBEDDING.md, and docs/llms.txt.
索引モデルが issue の本文から書いたものです。
説明
Gap
There is no process-level heap cap. An embedder, a CI harness or an agent running generated .eigs cannot bound a whole run's memory. The only tools are OS limits, and both are poor fits:
ulimit -v(RLIMIT_AS) counts reserved address space, not use. Each thread reserves an 8 MiB stack and a 64 MiB malloc arena up front. Measured in #1318:tests/handles_full.eigspeaks at 21 MB RSS, yet it was killed under a 1.5 GB-vcap. That produced false one-sided rows in a differential harness.- cgroups (
systemd-run -p MemoryMax=, container limits) work, but they end in a SIGKILL from outside. The program never sees an error, and the harness cannot tell an OOM from a crash without extra machinery.
When memory does run out, the runtime aborts. Repro on main 94c4c5b:
xs is []
s is "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
i is 0
loop while i < 100000000:
xs is append of [xs, s + (str of i)]
i is i + 1
print of "done"
$ ( ulimit -v 300000; src/eigenscript oom.eigs; echo rc=$? )
eigenscript: out of memory (requested 64 bytes)
Aborted (core dumped)
rc=134
sandbox_run's max_bytes is the one budget that exists (#739), and it has two limits:
- It is reachable only from inside a program, around an assembled chunk. It cannot cover a whole run.
- It charges only the size-controlled allocators (
zeros/fill/buffer/range/concat) and the zlib codecs. General growth like theappendloop above is not charged, so even a sandboxed run can exhaust the host.
Prior art (for the decision)
- Runtime-level heap caps that raise a named error: JVM
-Xmx(OutOfMemoryError), V8--max-old-space-size, the allocator limit in Lua'slua_newstate, wasm max memory pages. - Harness-level RSS monitors: libFuzzer
-rss_limit_mbreports OOM as its own outcome. - AFL documents that its RLIMIT_AS limit (
-m) must benoneunder ASan, which is the same failure as above.
Decision needed
- The knob: an env flag (
EIGS_MAX_HEAP=<bytes>, parsed like the othereigs_env_flagknobs), a CLI flag, an embed API field, or all three. - What gets charged: every
eigs_alloc(a chokepoint charge, which catches theappendloop), or live bytes net of frees (which needs the counter decremented on free). - What happens at the cap: an
rt_errorof a new kind (catchable bytry, a clean exit code distinct from 134), and what the trace tape records. - Whether
sandbox_run'smax_bytesbecomes the same mechanism scoped to the run, which would close its second limitation above.
Done when
- The decision above is recorded in this issue, citing a principle from docs/PRINCIPLES.md.
- Running the repro above with the cap set to 64 MiB ends in a named, documented error with a non-134 exit code, and the program can catch it with
try. - The same program under
sandbox_runwithmax_bytesset is stopped by the budget. It returns{ok: 0}, and the host does not abort. -
tests/handles_full.eigsruns clean under a cap well above its measured peak (for example 64 MiB), proving thread reservations are not charged. - Measured overhead with the cap unset is recorded, taken from the perf-attribution paired samples or the CodSpeed instruction count on the DMG target.
- docs/SPEC.md, docs/BUILTINS.md (
sandbox_run), docs/EMBEDDING.md and docs/llms.txt describe the knob, all in the same PR.
- 主要言語
- C
- スター
- 3
- フォーク
- 7
- 平均マージ
- 3時間 58分
- マージ済み PR(30日)
- 105
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
InauguralSystems/EigenScript のほかの issue
-
area:lint-tooling bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
InauguralSystems/EigenScript#1340 ·
メンテナーはふだん 1 日以内に返信
-
area:stdlib found-by:code-review kind:silent-wrong
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
InauguralSystems/EigenScript#1338 ·
メンテナーはふだん 1 日以内に返信
-
area:lint-tooling found-by:critic kind:docs-drift
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
InauguralSystems/EigenScript#1335 ·
メンテナーはふだん 1 日以内に返信
-
area:ci found-by:critic kind:gate-defect
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
InauguralSystems/EigenScript#1311 ·
メンテナーはふだん 1 日以内に返信
-
enrolment: decide test_gc_runner_controls.py (exempt vs enrol) and whether floors need a ratchetオープンarea:gates found-by:critic kind:decision
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
InauguralSystems/EigenScript#1280 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
InauguralSystems/EigenScript の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
ClickHouse/pg_clickhouse#383 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
johnsonjh/emu2-cpm86#68 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Zenmap CrashオープンZenmap
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
BasedHardware/omi#19306 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
fastfetch-cli/fastfetch#2619 ·
メンテナーはふだん 1 日以内に返信