Commit b801218
authored
IVF-PQ tests: fix segfault when accessing empty lists (#838)
Check if the `index.lists()[label]` is not an empty shared pointer before accessing its content in tests.
If the list size is zero, the list shared pointer can be `.reset()` during deserialization/resizing. Hence IVF-Flat and IVF-PQ can sometimes have empty shared pointers in their `.lists()` members. In case of IVF-PQ, we've had a piece of tests where this wasn't checked before accessing. As a result, we have been observing occasional CI failures with segfaults - when the IVF-PQ index was very unbalanced, i.e. had empty lists.
So far, the affected test is the only place I could identify where the access to the list pointer is unprotected (either via explicit check or by the invariant list_size > 0).
Authors:
- Artem M. Chirkin (https://github.com/achirkin)
- Corey J. Nolet (https://github.com/cjnolet)
Approvers:
- Bradley Dice (https://github.com/bdice)
- Tamas Bela Feher (https://github.com/tfeher)
URL: #8381 parent d2adc6f commit b801218
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
288 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
| |||
0 commit comments