]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
multiget: fix memory issues due to vector auto resizing (#5279)
authorZhongyi Xie <xiez@fb.com>
Fri, 3 May 2019 22:55:48 +0000 (15:55 -0700)
committeranand76 <anand76@devvm1373.frc2.facebook.com>
Fri, 24 May 2019 20:19:06 +0000 (13:19 -0700)
commit70dca18c9615038bd926aeea5fc4e8770a6f865d
tree8c3d8004d22f57b59ce5fe3154e89299a01f26c3
parent5f703af1eaa8aca77c6897e25c26b65104aba364
multiget: fix memory issues due to vector auto resizing (#5279)

Summary:
This PR fixes three memory issues found by ASAN
* in db_stress, the key vector for MultiGet is created using `emplace_back` which could potentially invalidates references to the underlying storage (vector<string>) due to auto resizing. Fix by calling reserve in advance.
* Similar issue in construction of GetContext autovector in version_set.cc
* In multiget_context.h use T[] specialization for unique_ptr that holds a char array
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5279

Differential Revision: D15202893

Pulled By: miasantreble

fbshipit-source-id: 14cc2cda0ed64d29f2a1e264a6bfdaa4294ee75d
db/version_set.cc
table/multiget_context.h
tools/db_stress.cc