GC zeal counter erroneously causes an allocation requiring >1 page of growth to fail
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reproducing with RUSTFLAGS="--cfg gc_zeal" cargo run wast -Ogc-zeal-alloc-counter=1 foo.wast and comparing against the run without the zeal flag; the wast file in the body is the whole reproducer. Then read the zeal allocation path that synthesizes the out-of-memory error and the GC heap growth routine that reads bytes_needed from it, since the two disagree when the reported need is 0. Done means the multi-page array.new_default of 65500 elements succeeds under zeal while still forcing growth and collection each allocation.
索引モデルが issue の本文から書いたものです。
説明
This test:
(module
(type $a (array (mut i8)))
(func (export "alloc") (param i32) (result i32)
(array.len (array.new_default $a (local.get 0)))))
(assert_return (invoke "alloc" (i32.const 65500)) (i32.const 65500))
fails with:
$ RUSTFLAGS="--cfg gc_zeal" cargo run wast -Ogc-zeal-alloc-counter=1 foo.wast
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s
Running `target/debug/wasmtime wast -Ogc-zeal-alloc-counter=1 foo.wast`
Error: failed to run script file 'foo.wast'
Caused by:
0: failed directive on foo.wast:6
1: error while executing at wasm backtrace:
0: 0x29 - wasm-function[0]
at ./foo.wast:4:17
2: GC heap out of memory: no capacity for allocation of 131072 bytes
but passes with:
$ RUSTFLAGS="--cfg gc_zeal" cargo run wast foo.wast
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
Running `target/debug/wasmtime wast -Ccollector=drc -Wgc foo.wast`
GC heap growth is based on the bytes_needed of the error, but GC zeal injects an error with bytes_needed == 0, so if more than one page is needed the re-attempted allocation after growth still fails, causing the entire allocation to fail.
cc @fitzgen
- 主要言語
- Rust
- スター
- 18.9k
- フォーク
- 2k
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 238
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bytecodealliance/wasmtime のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bytecodealliance/wasmtime#15536 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bytecodealliance/wasmtime#15455 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
wasi-preview1-component-adapter: fd_write does not invalidate cached InputStream, causing stale reads対応中かも @dpfens が 13 日前に担当しました。 オープンwasi
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bytecodealliance/wasmtime#15296 ·
メンテナーはふだん 1 日以内に返信
-
bug wasm-proposal:exceptions wasmtime:debugging
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bytecodealliance/wasmtime#14102 ·
メンテナーはふだん 1 日以内に返信
-
wasm-proposal:gc
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
bytecodealliance/wasmtime#13808 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
bytecodealliance/wasmtime の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area: plugins bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
clipy-recorder/clipy#1039 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
valkey-io/valkey-glide#7975 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
gofractally/psibase#2379 ·
メンテナーはふだん 3 日以内に返信
-
Qwen stream parser: a chunk with "error": null is treated as a stream error対応中かも @Beehtrix が今日担当しました。 オープンarea:models bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
brekkylab/ailoy#681 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信