One SCIP document that cannot be read fails the whole compiler-tier pass

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

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

@KaloyanNaumov がすでに取り組んでいます。

2026年11月28日 から。

  • #1704 @KaloyanNaumov による — オープン

評価

難易度
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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

ClickHouse/loom のほかの issue

ClickHouse/loom の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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