fix: catch upstream panics, add zip pre-flight, and guard against OOM#79
Closed
developer0hye wants to merge 4 commits intomainfrom
Closed
fix: catch upstream panics, add zip pre-flight, and guard against OOM#79developer0hye wants to merge 4 commits intomainfrom
developer0hye wants to merge 4 commits intomainfrom
Conversation
- Wrap parser.parse() with catch_unwind in convert_bytes() so panics from umya-spreadsheet / docx-rs become ConvertError::Parse instead of propagating to the caller. Applies to both normal and streaming XLSX paths. - Add MAX_COND_FMT_CELLS guard in cond_fmt.rs to skip conditional formatting rules with ranges exceeding 1M cells, preventing OOM from billion-cell iteration loops. - Cap sheet dimensions to 10,000 rows × 1,000 cols in xlsx.rs to prevent unbounded row iteration for extreme-dimension spreadsheets. - Add upstream_panics_return_error integration test verifying that known-panicking fixtures return Err instead of panicking. Related: #77 Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Validates all zip entries before handing data to upstream parsers. Rejects archives with entries exceeding 512 MB uncompressed size (blocks shared-string bombs) and invalid zip data (not OOXML). Also warm font cache in small-tier perf tests to eliminate flaky failures from cold-cache overhead in parallel test execution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Upstream umya-spreadsheet hangs/OOMs on this complex workbook, causing CI timeouts. Denylisting prevents it from blocking bulk tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Documents each denylisted fixture with source, size, and the specific reason it is excluded from bulk testing (fuzzer corruption, XML bombs, shared-string OOM, extreme dimensions, upstream hangs). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Owner
Author
|
Superseded by #86 which expanded the denylist and added catch_unwind. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parser.parse()andparse_streaming()withstd::panic::catch_unwindso upstream panics inumya-spreadsheet/docx-rsreturnConvertError::Parseinstead of crashing the processbug62181.xlsx(upstream OOM in umya-spreadsheet)Test plan
upstream_panics_return_error— verifieschart_hyperlink.xlsxandcheck-boolean.xlsxreturnErrinstead of panickinginvalid_zip_returns_error— verifies non-zip data is rejectedranges_exceed_limit_*— 3 unit tests for the cond_fmt guardtest_denylist_filtering— verifies denylist matching logicRelated: #77
🤖 Generated with Claude Code