-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OverflowError in method 'AnnIndex_AddWithMetaData' when running test script #34
Comments
I have the same error in OSX and python 3.7.3. |
This is a very strange error. I looked into the swig generated CoreInterface_pwrap.cpp, and everything seems to be fine. |
Also getting the same error. Here's some context including the stack trace
|
I have the same issue with ubuntu 18.04, swig 4.0, cmake 3.14.4 and python 3.6.0. it also occurs when trying to build with docker as well |
returns the same error
despite converting argument 4 to float in the first example |
Same here, running the docker version |
This issue only appears in python3. After adding m = m.encode() before BuildWithMetaData and AddWithMetaData, this error will disappear... |
@MaggieQi doesn't work in Python 3.6 - the interpretor reports problems with argument 4 which is the p_num. I doubt doing anything with the metadata, which is argument 3 would fix it - unless the error is related to argument 3 buffer overflowing and writing to argument 4.... I think the SPTAG developers team has made a very bad decision exposing the library using C++ classes. SWIG has limited support for C++ and this may result in other problems - not to mention using a C++ class reference as parameter (ByteArray)... |
The m.encode() trick seems to be working. As to how the metadata is represented in the C++, there seem to be issues of overflows when the strings used are too long. I was getting seg faults all over the place with strings longer than a few hundred characters. |
Tried multiple times, still doesn't work for me. What's your enviornment? I think it's better to change the C++ implementation of AddWithMetaData to take raw char* buffers. Swig might be confused with the different constructors of ByteArray. |
You are probably right about it being better to fix the underlying problem. I am on
|
It is a good suggestion! I will try to remove the ByteArray from the Wrapper part. |
Describe the bug
OverflowError: in method 'AnnIndex_AddWithMetaData', argument 4 of type 'int'
when running the Python test script from "Get Started"
To Reproduce
Create a new Python file in the Release directory, copy&paste the Python test script from "Get Started".
Additional context
My environment:
Ubuntu 18.04, Kernel 4.15.0 x86_64
Tried swig 3.0 & 4.0
cmake 3.14.4
gcc 7.4.0
python 3.6
The text was updated successfully, but these errors were encountered: