One SCIP document that cannot be read fails the whole compiler-tier pass
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 20/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp, python, typescript
- 領域
- backend
調査の方向性
Start with scripts/scip_harness/scip_to_delta.py, where each document is parsed with ParseFromString from the vendored scripts/scip_harness/vendor/scip_pb2.py, and run the reproduction snippet in the issue to see the DecodeError. Done means an undecodable document is skipped and logged while the delta keeps the other documents, its prior compiler rows read as stale, a truncated index still fails, and an operator setting can restore the fail-the-pass behaviour. Linked pull request #1704 is already open against this, so check it before starting.
索引モデルが issue の本文から書いたものです。
説明
Company
Independent
Component
Code index
Describe what's wrong
One SCIP document that python-protobuf cannot decode fails the whole compiler-tier pass, on every pass. scripts/scip_harness/scip_to_delta.py parses each document with ParseFromString, and a document with a string field that is not valid UTF-8 raises DecodeError: String field had bad UTF-8. The converter exits non-zero, the harness fails, the tier writes no delta and its watermark stays where it was. The next pass indexes the same tree and fails on the same document.
We hit it on the TypeScript tier: scip-typescript wrote a few such documents in a large index, and no pass for that repository completed. Every compiler tier and the full index run through the same converter, so any of them can fail this way on one document.
Does it reproduce on the latest release or main?
Yes
How to reproduce
From a checkout of main, with the server's virtualenv:
import importlib.util, subprocess, sys
spec = importlib.util.spec_from_file_location("scip_pb2", "scripts/scip_harness/vendor/scip_pb2.py")
pb = importlib.util.module_from_spec(spec)
spec.loader.exec_module(pb)
index = pb.Index()
for path, name in (("src/a.cpp", "f"), ("src/bad.cpp", "ZZBADUTF8ZZ")):
doc = index.documents.add()
doc.relative_path = path
occ = doc.occurrences.add()
occ.symbol = f"scip-clang cxx . . DB/{name}(aa)."
occ.symbol_roles = pb.SymbolRole.Definition
occ.range.extend([0, 5, 6])
raw = index.SerializeToString().replace(b"ZZBADUTF8ZZ", b"\xff\xfeBADUTF8ZZ")
open("/tmp/bad.scip", "wb").write(raw)
subprocess.run([sys.executable, "scripts/scip_harness/scip_to_delta.py", "--index", "/tmp/bad.scip",
"--commit", "h" * 40, "--source-root", "", "--full", "--dry-run", "/tmp/delta.json"])
The run exits 1 and writes no delta, although src/a.cpp is a valid document.
Expected behavior
A file that cannot be processed does not fail the repository's pass. The document that cannot be decoded or converted is skipped and logged, and the delta carries the other documents. The file keeps the compiler rows of its last successful conversion, and they read as stale until a later pass converts it. A full run does not retire them. An index that cannot be read to its end (truncated or corrupt framing) still fails the run. One setting lets an operator fail the pass on such a document instead, as now.
Error message and logs
google.protobuf.message.DecodeError: Error parsing message with type 'scip.Document': String field had bad UTF-8
Environment
Loom 1.3.0 (main 26f8753bc), Python 3.12, protobuf 7.36.2 from the server's virtualenv. Reproduced with the snippet above on main. First seen on a self-managed deployment of the 1.3 line, TypeScript tier, index written by scip-typescript.
How this was found
I found and reproduced it myself
Redaction
- I removed tokens, keys, passwords and personal or customer data from everything above.
- 主要言語
- Python
- スター
- 263
- フォーク
- 47
- 平均マージ
- 14時間 21分
- マージ済み PR(30日)
- 873
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ClickHouse/loom のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
ClickHouse/loom#2014 ·
メンテナーはふだん 1 日以内に返信
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help text対応中かも @VanshajPoonia が今日担当しました。 オープンbug good first issue help wanted up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
ClickHouse/loom#1988 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A compiler-tier checkout fetch from a shallow mirror never records its head対応中かも @KaloyanNaumov が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
ClickHouse/loom#2016 ·
メンテナーはふだん 1 日以内に返信
-
Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limit対応中かも @KaloyanNaumov が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
ClickHouse/loom#2012 ·
メンテナーはふだん 1 日以内に返信
-
loom participant retire cannot retire an orphaned participant after container replacement or host reboot対応中かも @l0K1ngg が今日担当しました。 オープンbug help wanted up-for-grabs
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
ClickHouse/loom#2007 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
ClickHouse/loom の issue をすべて見る
似ている issue
-
DMB documentation good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ubuntu/ubuntu-project-docs#921 ·
メンテナーはふだん 1 日以内に返信
-
⏳ Pending feedback 🐛 Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
jumpserver/jumpserver#18282 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
accepted
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
future-agi/future-agi#5274 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
GenericMappingTools/pygmt#5014 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信