Repository navigation
Fix ART iterator re-seeding root after remove - #1705
Closed
hardikkaurani wants to merge 1 commit into
Closed
hardikkaurani wants to merge 1 commit into
hardikkaurani wants to merge 1 commit into
Conversation
Signed-off-by: Hardik Kaurani <[email protected]>
Contributor
Author
|
Hi @jesperpedersen, I opened this small fix for |
Member
|
Rebased and merged. Thanks for your contribution ! |
Member
|
Please, cross-port to the other projects |
Contributor
Author
|
@jesperpedersen Cross-ported the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pgmoneta_art_iterator_next()previously seeded the BFS queue fromtree->rootwheneveriter->count == 0. Becausepgmoneta_art_iterator_remove()decrementsiter->count, removing the first yielded key resetsiter->countto0and causespgmoneta_art_iterator_next()to pushtree->rootontoiter->queagain mid-traversal—leading to duplicate visits and a use-after-free iftree->rootlater collapses and is freed.bool startedonstruct art_iterator.test_art_iterator_remove_collapseintest/testcases/test_art.c.Verification
clang-format.