Closed GKxxUCAS closed 4 weeks ago
Thank you submitting the issue!
I've confirmed that calling clear with numel == 0
causes invalid-null-argument error.
Can be reproduced via:
faiss::AlignedTableTightAlloc<int> atta;
atta.clear();
closing since the fix https://github.com/facebookresearch/faiss/pull/3997 has landed.
In
faiss/utils/AlignedTable.h
, in the classAlignedTableTightAlloc
, we can see from the functionresize
that the pointer memberptr
may be set to null. The copy constructor has taken this into consideration and has performed a checkif (numel > 0)
before passingptr
tomemcpy
(which was added in 74ee67a). However, the functionclear
does not seem to have realized this.Maybe a check should also be performed in
clear
before callingmemset
?