cmd/fsck: `--ui=false` Exits 0 on Corrupted Logs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with cmd/fsck/main.go:76–101 and tessera/fsck/fsck.go:167, then build ./cmd/fsck and reproduce the corrupted-log case with --ui=false. Add a test that executes the fsck binary against a corrupted fixture and verifies diagnostics plus a non-zero exit; done also requires issuer checks to be included without premature cancellation.
索引モデルが issue の本文から書いたものです。
説明
[discovered w/ the help of Claude]
Problem
fsck --ui=false always exits 0 even on corruption, discarding errors before they reach $?. In 2 of 3 failure modes, no diagnostic is printed, making --ui=false unusable as an automated CI/pipeline gate.
Impact Matrix (Fault Injection on Static-CT Log)
| Corruption Type | Detected Internally | Output Diagnostic | Exit Code |
|---|---|---|---|
Bit flip (tile/0/042) |
Yes (hash mismatch) | None | 0 |
Truncation (tile/data/042) |
Yes (bundle parse error) | None | 0 |
Missing issuer (issuer/<hex>) |
Yes (fetch failure) | WARN only |
0 |
Underlying detection logic in tessera/fsck is sound; only cmd/fsck error reporting fails.
Root Causes
- Early Return Bypasses
eg.Wait()(main.go:92–101):
f.Checkcompletion invokes deferredcancel(), closingctx.Done(). The non-TUI loop executescase <-ctx.Done(): return, exitingmaindirectly and skippingeg.Wait(),os.Exit(1), andslog.Info("OK"). - Disconnected Issuer Status:
Successfully fsck'd log(tessera/fsck/fsck.go:167) reflects tree verification only, omitting concurrentcheckIssuersTaskstatus. - LIFO Defer Prematurely Cancels Context (
main.go:76–81):
defer cancel()runs beforedefer lsc.Close(), cancelingctxwhile issuer workers may still be drainingissuersToCheck, potentially truncating checks on large logs or causing spurious HTTPcontext cancelederrors. - Regression test: No test currently invokes the cmd/fsck binary — all existing fsck coverage calls Check() directly and inspects the returned error, which is why this went unnoticed. Add a test that execs the built binary against a corrupted fixture with --ui=false and asserts a non-zero exit.
Minimal Reproduction
go build -o /tmp/fsck-ct ./cmd/fsck
# Corrupt single byte in a mirrored log tile:
cp -r /path/to/log /tmp/broken
printf '\x01' | dd of=/tmp/broken/tile/0/042 bs=1 seek=100 conv=notrunc
# Run without TUI:
/tmp/fsck-ct --monitoring_url=file:///tmp/broken \
--origin=<origin> --public_key=<key> --ui=false
echo $? # Returns 0 with no error diagnostics (BUG)
- 主要言語
- Go
- スター
- 41
- フォーク
- 20
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
transparency-dev/tesseract のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
transparency-dev/tesseract#879 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
transparency-dev/tesseract#851 ·
メンテナーはふだん 1 日以内に返信
-
Remove support for precert signing certificates対応中かも @phbnf が 4 日前に担当しました。 オープンbug
transparency-dev/tesseract#995 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
internal/ct: return errors from NewLog instead of calling os.Exit(1)対応中かも @phbnf が 25 日前に担当しました。 オープンbug
transparency-dev/tesseract#976 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Migrate Tessera MTC Log and Mirror code to the TesseraCT repo再び着手できるかも @phbnf が 34 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
transparency-dev/tesseract#962 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
transparency-dev/tesseract の issue をすべて見る
似ている issue
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
[UI] Guard webApis against undefined window in SSR environments対応中かも @madhavzanwar が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
kind/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
automated-analysis code-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/gh-aw-mcpg#17105 ·
メンテナーはふだん 1 日以内に返信