summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2024-04-16 11:34:26 +0200
committerTor Egge <Tor.Egge@online.no>2024-04-16 11:34:26 +0200
commit5e6fca96505e0a181f528be2eb7f25ec7673b758 (patch)
treed37ae6302fb72f5b6f5e33a8a45d968ffc505fdf
parent68d2a130c8780a4a55b84e8cadd977a80efa5bab (diff)
Add comments about overflows.
-rw-r--r--searchlib/src/tests/diskindex/pagedict4/pagedict4_long_words_test.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/searchlib/src/tests/diskindex/pagedict4/pagedict4_long_words_test.cpp b/searchlib/src/tests/diskindex/pagedict4/pagedict4_long_words_test.cpp
index 10eee82d6d4..dba7980a4b7 100644
--- a/searchlib/src/tests/diskindex/pagedict4/pagedict4_long_words_test.cpp
+++ b/searchlib/src/tests/diskindex/pagedict4/pagedict4_long_words_test.cpp
@@ -46,6 +46,26 @@ make_word(int i)
/*
* A long word that don't fit into a 4 KiB 'page' causes a fallback to
* overflow handling where the word is put in the .ssdat file.
+ *
+ * Many long words causes excessive growth of the .ssdat file, with
+ * overflow potentials when the whole file is read into a buffer.
+ *
+ * 4 GiB size: Overflow in ComprFileReadBase::ReadComprBuffer for expression
+ * readUnits * cbuf.getUnitSize() when both are 32-bits.
+ * Testable by setting num_words to 900_Ki
+ *
+ * 16 GiB size: Overflow in ComprFileReadBase::ReadComprBuffer when
+ * readUnits is 32-bit signed.
+ * Some overflows in ComprFileDecodeContext API.
+ * Overflow in DecodeContext64Base::getBitPos
+ * Testable by setting num_words to 4_Mi
+ *
+ * 32 GiB size: Overflow when calling ComprFileReadContext::allocComprBuf when
+ * comprBufSize is 32-bit unsigned.
+ * Overflow in DecodeContext64Base::setEnd.
+ * Testable by setting num_words to 9_Mi
+ *
+ * These overflows are fixed.
*/
TEST(PageDict4LongWordsTest, test_many_long_words)
{