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

Segmentation fault in RecSplit #7

Closed
jnalanko opened this issue Sep 19, 2020 · 2 comments
Closed

Segmentation fault in RecSplit #7

jnalanko opened this issue Sep 19, 2020 · 2 comments

Comments

@jnalanko
Copy link

jnalanko commented Sep 19, 2020

Hello,

I have the following code:

#include "sux/function/RecSplit.hpp"

using namespace sux::function;

int main() {
	vector<hash128_t> keys;
	for (int i = 0; i < 10000; i++) {
		keys.push_back(hash128_t(0, i));
	}
	RecSplit<8> RS(keys, 100);
}

Compiled with g++ -std=c++17, this crashes with a segmentation fault. If the loop goes up to only 1000, it works. Why is that? Thanks.

@vigna
Copy link
Owner

vigna commented Sep 19, 2020

Please read the docs.

/** 128-bit hashes.
*

  • In the construction of RecSplit, keys are replaced with instances
  • of this class using SpookyHash, first thing.
  • Moreover, it is possible to build and query RecSplit instances using 128-bit
  • random hashes only (mainly for benchmarking purposes).
    */

@vigna vigna closed this as completed Sep 19, 2020
@jnalanko
Copy link
Author

Sorry and thank you!

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

2 participants