You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, when I try to update the sketch, the program suddenly stop, and show:Vector Subscript out of range.
First, I run it on Ubuntu 16.04, but the program stoped and the terminal only to display:Floating point exception (core dumped). I have added c++11 optional.
For convenience, I run it on Visual Studio 2017, but it was stopped too. When the program is running, a windows show: Debug Assertion Failed : Vector subscript out of range.
And I find the array.find() of unordered_map leads to the failure. I find that the hash value may be negtive when the type of hash functions's returned value transform(from usigned int to long long), and the vector subscript may be out of range. So I limit the hash value to be positive, even decrease the hash value, but it dosen't work.
I test Object for equality and Object for hash, they seemly work well.
this is my code:
`int main(int argc, char** argv) {
LDSketch_t* lds = LDSketch_init(10000, 4, 1, 64, 1024*1024, 0);
dyn_tbl_key_t key;
memcpy(key.key, "abc", lds->lgn / 8);
dyn_tbl_t *test = (dyn_tbl_t*)safe_calloc(10000 * 4, sizeof(long long), std::string("tbl->tbl").c_str());
LDSketch_update(lds, key.key, (long long)5);//stop and out of range
printf("%ld", test->array.find(key));//stop and out of range
LDSketch_destroy(lds);
system("PAUSE");
return 0;
}`
The text was updated successfully, but these errors were encountered:
Hello, when I try to update the sketch, the program suddenly stop, and show:Vector Subscript out of range.
First, I run it on Ubuntu 16.04, but the program stoped and the terminal only to display:Floating point exception (core dumped). I have added c++11 optional.
For convenience, I run it on Visual Studio 2017, but it was stopped too. When the program is running, a windows show: Debug Assertion Failed : Vector subscript out of range.
And I find the array.find() of unordered_map leads to the failure. I find that the hash value may be negtive when the type of hash functions's returned value transform(from usigned int to long long), and the vector subscript may be out of range. So I limit the hash value to be positive, even decrease the hash value, but it dosen't work.
I test Object for equality and Object for hash, they seemly work well.
this is my code:
`int main(int argc, char** argv) {
}`
The text was updated successfully, but these errors were encountered: