fix: avoid panic when repdef serializes empty offsets#5890
fix: avoid panic when repdef serializes empty offsets#5890westonpace merged 1 commit intolance-format:mainfrom
Conversation
|
PTAL @westonpace . |
westonpace
left a comment
There was a problem hiding this comment.
This is a good fix for repdef, thanks! Did you run into this scenario with actual data? Or is it theoretical? I wonder if we had checks for empty arrays higher in the code somewhere?
You're right that lance/rust/lance-file/src/writer.rs Lines 385 to 397 in 556851b The panic I encountered was triggered through the lance/rust/lance-encoding/src/encoder.rs Lines 689 to 698 in 556851b |
Inspired by issue #5141 regarding fuzz testing for the file format, I wrote a simple local fuzzer. This panic occurred while generating seed files. |
|
BTW, could you help review this PR #5867 when you have a moment? |
Fixes panic on empty list offsets (
[0]).The assertion
expected_len - 1underflows whenexpected_len == 0. We early-return because zero values produce no rep/def levels.