Skip to content
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

Got a "double free or corruption" when destroy a deserialized SuRF in BitvectorRank #11

Open
iele opened this issue Nov 22, 2019 · 0 comments

Comments

@iele
Copy link

iele commented Nov 22, 2019

Test Code:

#include
#include
#include "include/surf.hpp"
using namespace surf;
int main() {
std::vectorstd::string keys = {
"f",
"far",
"fast",
"s",
"top",
"toy",
"trie",
};
// basic surf
SuRF* surf = new SuRF(keys);
surf = SuRF::deSerialize(surf->serialize());
std::cout << "destory surf" << std::endl;
surf->destroy();
return 0;
}

Got a core dumped
image

Maybe the issue happens when destroy BitVectorRank:

void destroy()
{
delete[] bits_;
delete[] rank_lut_;
}

@iele iele changed the title Got a double free or corruption when destroy a deserialized SuRF in BitvectorRank Got a "double free or corruption" when destroy a deserialized SuRF in BitvectorRank Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant