Fix chaintable check to include rowhash in ZSTD_reduceIndex()#2598
Fix chaintable check to include rowhash in ZSTD_reduceIndex()#2598senhuang42 merged 1 commit intofacebook:devfrom
Conversation
|
Would that make sense to add a test that cover this use case ? We already have a category "large data test". Alternatively, could we retrofit one of these tests to cover this case ? |
I think @terrelln mentioned that he might add some more fuzzer tests. #2601 adds a simple test that would catch this. |
The row hash strategy doesn't use a chainTable, similarly to
ZSTD_fast. Therefore, existing checks thatstrategy != ZSTD_fastwhose actual intent it was to check for a chaintable, are no longer accurate, and all existing sites must be migrated toZSTD_allocateChainTable(). I didn't see any more instances of this in the codebase.In this case,
ZSTD_reduceIndex()with row hash could actually end up trying to access memory outside thecctxin cases where thechainLogwas large enough (even though that's not a param row hash actually uses).ZSTD_reduceIndex()actually has just the right params for us to use, so the fix is fairly straightforward. Theparamspassed areappliedParams, so the matchfinder mode won't beZSTD_urm_auto(and we assert that inZSTD_allocateChainTable()).Repro of the bug: