Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Reference cycles can cause infinte loops

オープン
#336 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

まず issue の ASL の例を実行し、サイクルによってスタックオーバーフローが発生する Return (Local3) での参照解決を追跡します。関連する store の動作については issue #313 を読んでください。完了条件は、循環参照が無限にループしたりスタックオーバーフローを引き起こしたりしなくなり、提示された例を対象とするリグレッションテストがあることです。

索引モデルが issue の本文から書いたものです。

説明

I think this is a low priority for reasons at the end.

The following ASL demonstrates the issue:

DefinitionBlock("", "DSDT", 1, "RSACPI", "Refs", 1) {
    Method(MAIN) {
        Local0 = 1
        Local1 = RefOf(Local0)
        Local2 = RefOf(Local1)
        Local0 = RefOf(Local2)

        // This line doesn't cause an infinite loop, it just stores a reference
        Local3 = Local0

        // The following line causes an infinite loop trying to get the value
        Return (Local3)
    }
}

This actually fails with thread 'main' (19208) has overflowed its stack.

At present it isn't possible to test stores to the cycle (e.g. Local0 = 2 instead of Local3 = Local0), but the fix for issue #313 would unblock this - in that case Stores also cause infinite loops, but without the stack overflow.

Why is this a low priority?

  • Surely no-one would write ASL like this? (insert "right? right?" meme here)
  • uACPI also hangs in this case
  • acpiexec just exits the process with no error messages

So this crate failing is not out line with other implementations (although I didn't test Windows). I think this should be a straightforward fix - just add a loop counter when unwrapping references?

There's a more complex fix - raising errors when trying to create cycles - but IMO it's not worth the extra complexity.

主要言語
Rust
スター
245
フォーク
93
平均マージ
3日 3時間
マージ済み PR(30日)
19

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-osdev/acpi のほかの issue

rust-osdev/acpi の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。