Skip to content

RelationshipsOverlay.merge 對解析後重複的 relationship id fatalError——一份畸形 .docx 讓任何序列化路徑 SIGTRAP 整個 process(follow-up finding from che-word-mcp#199 verify R2) #139

Description

@kiki830621

Problem

RelationshipsOverlay.mergeSources/OOXMLSwift/IO/RelationshipsOverlay.swift:56)用 Dictionary(uniqueKeysWithValues: typedRels.map { ($0.id, $0) }) 建索引。word/_rels/document.xml.rels 只要有兩條 relationship 的 id 在 XML 解析後相同——純粹寫兩次 Id="rId5",或 Id="rId5"Id="rId5"(NSXML 在 parse 期就解碼)——這行就 Fatal error: Duplicate values for key: 'rId5',process 以 SIGTRAP 結束。

che-word-mcp#199 verify R2 的 DA 實測:save_document 對同檔本來就 crash(gate 在 base 就呼叫 writeData);#199 把唯讀的 list_images 也接上 writeData 後,list 也會把整個 MCP server 打死。che-word-mcp 端會在序列化前預檢重複 id 當緩解,但 library 不該對可從磁碟讀入的資料 fatalError

Type

bug

Expected

merge 對重複 id 拋可捕捉的錯誤(具名 part 與 id),或以「後者覆蓋前者/保留第一條」的明確政策合併並在報告中具名;reader 端亦可在讀入時就拒絕/去重。

Actual

fatalError,整個 process 終止。


Source: surfaced during /idd-verify che-word-mcp#199 R2 (Step 5b follow-up triage). Verify report: PR PsychQuant/che-word-mcp#218 (Verify R2 comment)
Refs PsychQuant/che-word-mcp#199

Current Status

Phase: needs-fix
Last updated: 2026-09-06 by idd-verify (R3 → fix round 3 landed; R4 running) — unattended /idd-all, cluster PR #141

Key Decisions

Blocking

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions