Skip to content

Update bdb.#20

Merged
nodech merged 3 commits into
bcoin-org:masterfrom
nodech:segfault-and-tests
Sep 1, 2023
Merged

Update bdb.#20
nodech merged 3 commits into
bcoin-org:masterfrom
nodech:segfault-and-tests

Conversation

@nodech
Copy link
Copy Markdown
Member

@nodech nodech commented Aug 9, 2023

This is based on and closes #16

Main goal:

  • Fix segfaults that can happen when db is closed and any method is called. Now they instead return errors (throw exception for sync/return err via callback)

Other issues:

Note:

nodech added 2 commits August 9, 2023 13:31
Since last leveldown ports and discontinuation of leveldown (move to abstract), it's highly unlikely we will do full ports like before. Now we can make the changes permanent.
Add guards on calls to check if the database is open, other than iterator which are closed themselves.
@nodech
Copy link
Copy Markdown
Member Author

nodech commented Aug 10, 2023

Two memleaks were introduced by this PR and one was old (NewBloomFilterPolicy was not freed). Fixed both

@nodech nodech force-pushed the segfault-and-tests branch from 4f808f9 to d940132 Compare August 10, 2023 11:54
@nodech
Copy link
Copy Markdown
Member Author

nodech commented Aug 11, 2023

Iterators only method that is actively being used (Next) is behind the nexting_ guard. So it should be safe to use. If we want to make Seek async and add Prev then we will need to generalize this little bit more.

@nodech nodech marked this pull request as ready for review August 11, 2023 10:41
@nodech nodech merged commit 29087f9 into bcoin-org:master Sep 1, 2023
@nodech nodech deleted the segfault-and-tests branch October 5, 2024 08:44
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

Successfully merging this pull request may close these issues.

1 participant