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

Đang mở
#1,701 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@KaloyanNaumov đang làm issue này rồi.

Từ ngày 28/11/2026.

  • #1704 của @KaloyanNaumov — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, python, typescript
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Python
Star
263
Fork
47
Merge trung bình
14 giờ 21 phút
Pull request đã merge (30 ngày)
873

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ClickHouse/loom

Tất cả issue của ClickHouse/loom

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.