-
Notifications
You must be signed in to change notification settings - Fork 55
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
Infinite loop when parsing bdb table #37
Comments
It seems like the pages that are entering this if-statement are just fully zero'd-out, so their page type is 0 |
I would appreciate it if someone could ack this issue and say if they plan to take a look or if this is likely to linger until more consumers +1 it |
Contributions welcome |
Hello |
Sure |
We are seeing this issue and investigating |
Shouldn't this be part of the loop post statement? Otherwise the line mentioned by @daveharmon will cause an infinite loop. Alternatively, we can break out of the loop when we see that the page isn't an overflow page (e.g. it's a new page, so we are done parsing the overflow page?), but I'm not 100% sure of the semantics here. |
Seems like Jfrog has forked the library with a timeout fix: https://github.com/jfrog/go-rpmdb |
I need a contribution. |
@knqyf263 can you please accept the fix? |
Honestly, I don't think adding timeout is ideal. We should detect the infinite loop somehow. |
The infinite loop is when it hits the The reason I did not modify the hash table parsing is I don't know if this is expected behavior. If you think it's incorrect db file, we can just error when it hits
and change the
|
The other option is to add the loop update clause to before the
|
@wagoodman Do you know something about it? |
At https://github.com/knqyf263/go-rpmdb/blob/master/pkg/bdb/hash_page.go#L70
I believe this continue statement without any changes to the loop variables is causing an infinite loop for some types of corrupted bdb databases.
I am able to pretty consistently recreate this issue, though I am unable to give you an example at this time.
Adding "currentPageNo = currentPage.NextPageNo`" breaks the loop and causes this library to detect the corruption, though I'm not totally sure if that's the right solution. Please let me know.
The text was updated successfully, but these errors were encountered: