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

Non-atomic keylenx_has_ksuf check could lead to assertion failure #33

Open
huangyihe opened this issue Feb 2, 2019 · 2 comments
Open

Comments

@huangyihe
Copy link

The following two lines of code in scan seems to be giving us issues:

if (n_->keylenx_has_ksuf(keylenx))
keylen = ka.assign_store_suffix(n_->ksuf(kp));

Basically if the content of n_->keylenx_ changes between the check and the n_->ksuf() call, the precondition check in ksuf() might fail because the precondition check loads the latest value. Is this a bug?

@kohler
Copy link
Owner

kohler commented Feb 5, 2019

Ugh.

@thawk105
Copy link

How about change
"keylen = ka.assign_store_suffix(n_->ksuf(kp));"
into
"keylen = ka.assign_store_suffix((n_->ksuf_ ? n_->ksuf_->get(kp) : n_->iksuf_[0].get(kp)));"
?

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

3 participants