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

Fix arena allocation size in NewEmptyInternalIterator #4905

Closed
wants to merge 2 commits into from

Conversation

rbrasga
Copy link
Contributor

@rbrasga rbrasga commented Jan 22, 2019

NewEmptyInternalIterator with arena mistakenly used EmptyIterator to allocate the size from area but then initialized it to a totally different object: EmptyInternalIterator. The patch fixes that.

@siying
Copy link
Contributor

siying commented Jan 22, 2019

@rbrasga thank you for reporting and fixing the problem!
@maysamyabandeh can you take a look? I'm not sure the way to handle template is correct.

rbrasga and others added 2 commits March 29, 2019 13:57
The unit test for DBIteratorTest TableFilter causes a segfault when destructing EmptyInternalIterator(Arena) [at least on my system].

The object being destructed twice was here: db/table_cache.cc:236 - return NewEmptyInternalIterator(arena);

The root cause turned out to be here: table/iterator.cc:204 - auto mem = arena->AllocateAligned(sizeof(EmptyIterator));

//EmptyInternalIterator was created using sizeof(EmptyIterator), it should be created using EmptyInternalIterator, which resolved the segfault on my system.
@maysamyabandeh maysamyabandeh changed the title Segfault during DBIteratorTest TableFilter Fix arena allocation size in NewEmptyInternalIterator Mar 29, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maysamyabandeh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@maysamyabandeh merged this pull request in 127a850.

riversand963 added a commit to riversand963/rocksdb that referenced this pull request Apr 17, 2019
Summary: facebook#4905 removed the implementation of `NewEmptyIterator` but kept its
declaration in the public header. This breaks some systems that depend on
RocksDB if the systems use `NewEmptyIterator`. Therefore, add it back to fix.

Test Plan:
```
$make clean && make -j32 all && sleep 1 && make check
```
facebook-github-bot pushed a commit that referenced this pull request Apr 17, 2019
Summary:
#4905 removed the implementation of `NewEmptyIterator` but kept its
declaration in the public header. This breaks some systems that depend on
RocksDB if the systems use `NewEmptyIterator`. Therefore, add it back to fix. cc maysamyabandeh please remind me if I miss anything here. Thanks
Pull Request resolved: #5203

Differential Revision: D14968382

Pulled By: riversand963

fbshipit-source-id: 5fb86e99c8cfaf9f7a9473cdb1355d7558ff6e01
riversand963 added a commit that referenced this pull request Apr 17, 2019
Summary:
#4905 removed the implementation of `NewEmptyIterator` but kept its
declaration in the public header. This breaks some systems that depend on
RocksDB if the systems use `NewEmptyIterator`. Therefore, add it back to fix. cc maysamyabandeh please remind me if I miss anything here. Thanks
Pull Request resolved: #5203

Differential Revision: D14968382

Pulled By: riversand963

fbshipit-source-id: 5fb86e99c8cfaf9f7a9473cdb1355d7558ff6e01
vagogte pushed a commit to vagogte/rocksdb that referenced this pull request Jun 18, 2019
Summary:
NewEmptyInternalIterator with arena mistakenly used EmptyIterator to allocate the size from area but then initialized it to a totally different object: EmptyInternalIterator. The patch fixes that.
Pull Request resolved: facebook#4905

Differential Revision: D14689840

Pulled By: maysamyabandeh

fbshipit-source-id: af64fd8ee93d5a4ad54691c792e5ecc5efabc887
vagogte pushed a commit to vagogte/rocksdb that referenced this pull request Jun 18, 2019
Summary:
facebook#4905 removed the implementation of `NewEmptyIterator` but kept its
declaration in the public header. This breaks some systems that depend on
RocksDB if the systems use `NewEmptyIterator`. Therefore, add it back to fix. cc maysamyabandeh please remind me if I miss anything here. Thanks
Pull Request resolved: facebook#5203

Differential Revision: D14968382

Pulled By: riversand963

fbshipit-source-id: 5fb86e99c8cfaf9f7a9473cdb1355d7558ff6e01
junhanLee95 pushed a commit to junhanLee95/rocksdb that referenced this pull request Oct 24, 2022
Summary:
facebook#4905 removed the implementation of `NewEmptyIterator` but kept its
declaration in the public header. This breaks some systems that depend on
RocksDB if the systems use `NewEmptyIterator`. Therefore, add it back to fix. cc maysamyabandeh please remind me if I miss anything here. Thanks
Pull Request resolved: facebook#5203

Differential Revision: D14968382

Pulled By: riversand963

fbshipit-source-id: 5fb86e99c8cfaf9f7a9473cdb1355d7558ff6e01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants