Skip to content

Fix remaining 4 DOCX failures from issue #84#93

Merged
developer0hye merged 1 commit intomainfrom
ralph/phase20-fix-remaining-docx
Mar 1, 2026
Merged

Fix remaining 4 DOCX failures from issue #84#93
developer0hye merged 1 commit intomainfrom
ralph/phase20-fix-remaining-docx

Conversation

@developer0hye
Copy link
Owner

Summary

  • Fix stack overflow on deeply nested tables (5000+ levels) in the docx-rs fork by adding a thread-local depth counter with RAII guard pattern (MAX_TABLE_DEPTH = 32)
  • Add ReaderError::TableDepthExceeded error variant to distinguish depth-limit errors from other XML parse errors
  • Propagate depth-exceeded errors from TableCell::read() while keeping tolerance for other table parse errors
  • Add fixture tests for all 4 remaining DOCX files from issue upstream: docx-rs parse failures on valid DOCX files #84:
    • tdf171025_pageAfter.docx — ODT file with .docx extension (clean parse error)
    • tdf171038_pageAfter.docx — ODT file with .docx extension (clean parse error)
    • math-malformed_xml.docx — intentionally malformed XML (clean parse error)
    • deep-table-cell.docx — 5000+ nested tables (clean error via depth limit, no stack overflow)
  • Remove deep-table-cell.docx from the bulk conversion DENYLIST

Test plan

  • All 4 new fixture tests pass (smoke + structure for each)
  • cargo test --workspace passes (all tests green)
  • cargo fmt --all -- --check passes
  • cargo clippy --workspace -- -D warnings passes
  • docx-rs fork unit tests pass (271 tests, including 2 new depth-limit tests)

Related: #84

🤖 Generated with Claude Code

Add fixture tests for the last 4 DOCX files from issue #84:
- tdf171025_pageAfter.docx — ODT with .docx extension (clean error)
- tdf171038_pageAfter.docx — ODT with .docx extension (clean error)
- math-malformed_xml.docx — malformed XML (clean error)
- deep-table-cell.docx — 5000+ nested tables (clean error via depth limit)

Remove deep-table-cell.docx from the bulk conversion DENYLIST since the
docx-rs fork depth-limit fix prevents stack overflow.

Related: #84

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye developer0hye merged commit 52ac387 into main Mar 1, 2026
14 checks passed
@developer0hye developer0hye deleted the ralph/phase20-fix-remaining-docx branch March 1, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant