internal/task: protect the leaking GC free stack list from stack overflow
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go, wasm
調査の方向性
Start in src/internal/task/task_asyncify_stack_leaking.go, where the free list stores next and size in the first two words of each freed stack, and read allocStack, which pops from that list. Decide between the two fixes the issue lists; the magic-value check is the smaller change, and it needs a runtimeFatal("stack overflow") call on mismatch. Done means a corrupted list entry is caught in allocStack with a fatal error, and the existing task tests still pass.
索引モデルが issue の本文から書いたものです。
説明
With #5981, the leaking GC with the asyncify scheduler keeps the stacks of exited goroutines on a free list for reuse. The list entry (next and size) is stored in the first two words of each free stack, in src/internal/task/task_asyncify_stack_leaking.go.
If a stack overflow goes past the canary of a running goroutine, it writes into the heap memory below that stack. Before #5981, that memory was other heap objects or dead stacks. Now it can be the list entry of a free stack. The next allocStack then follows a bad next pointer and gives that address to a new goroutine as its stack. The memory corruption then occurs far from the overflow, and it is difficult to find the cause.
The risk is small. Stacks grow down to the canary at the base, so the overflow must go past its own canary and then through the full free stack below it (64 KiB on wasip1) before it reaches the list entry. An overflow of that size also corrupts other heap objects without the free list. But with the free list, the corruption occurs silently in the allocator, and not in user data.
Possible fixes:
- Store a magic value in each free list entry and check it in
allocStack. CallruntimeFatal("stack overflow")if it changed. This is cheap and keeps the current design. - Keep the free list outside the stack memory, for example in a separate array of stack bases.
- 主要言語
- Go
- スター
- 17.8k
- フォーク
- 1.1k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 380
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tinygo-org/tinygo のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6727 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
tinygo-org/tinygo#6711 ·
メンテナーはふだん 1 日以内に返信
-
Builds are not reproducible: cgo snippet paths in debug info対応中かも @tridev-tej が 1 日前に担当しました。 オープンenhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6619 ·
メンテナーはふだん 1 日以内に返信
-
Fix the targets that tinygo build -target rejects対応中かも @narguis が 2 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
tinygo-org/tinygo#6617 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
tinygo-org/tinygo#6312 ·
メンテナーはふだん 1 日以内に返信
tinygo-org/tinygo の issue をすべて見る
似ている issue
-
release
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
github/gh-aw-mcpg#17603 ·
メンテナーはふだん 1 日以内に返信
-
help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
oras-project/oras-go#1827 ·
メンテナーはふだん 1 日以内に返信
-
docs: database/sql Sessions example never commits its batch, and its "Full Example" link is a 404オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
ClickHouse/clickhouse-go#2185 ·
メンテナーはふだん 1 日以内に返信
-
bug needs triage receiver/podman
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-collector-contrib#53700 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
tagvalue.Read fails with "token too long" on lines over 64 KiB対応中かも @G26karthik が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
spdx/tools-golang#319 ·