rocksdb/util
Yu Zhang 2207a66fe5 Make autovector call default constructor explicitly before move/copy (#12499)
Summary:
Make `autovector` constructs the stack based element in place before move or copy another `autovector`'s stack based elements. This is already done in  the move/copy version of `autovector::push_back` when adding item to the stack based memory
8e6e8957fb/util/autovector.h (L269-L285)

The ` values_ = reinterpret_cast<pointer>(buf_);` statement is not sufficient to ensure the class's member variables are properly constructed. I'm able to reproduce this consistently in a unit test in this change: https://github.com/facebook/rocksdb/compare/main...jowlyzhang:fix_sv_install with unit test:
`./tiered_compaction_test --gtest_filter="\*FastTrack\*"

With below stack trace P1203997597 showing the `std::string` copy destination is invalid, which indicates the object in the destination `autovector` is not constructed properly.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/12499

Test Plan: Existing unit tests.

Reviewed By: anand1976

Differential Revision: D55662354

Pulled By: jowlyzhang

fbshipit-source-id: 581ceb11155d3dd711998607ec6950c0e327556a
2024-04-04 12:33:05 -07:00
..
aligned_buffer.h
async_file_reader.cc
async_file_reader.h
atomic.h
autovector.h
autovector_test.cc
bloom_impl.h
bloom_test.cc
build_version.cc.in
cast_util.h
channel.h
cleanable.cc
coding.cc
coding.h
coding_lean.h
coding_test.cc
compaction_job_stats_impl.cc
comparator.cc
compression.cc
compression.h
compression_context_cache.cc
compression_context_cache.h
concurrent_task_limiter_impl.cc
concurrent_task_limiter_impl.h
core_local.h
coro_utils.h
crc32c.cc
crc32c.h
crc32c_arm64.cc
crc32c_arm64.h
crc32c_ppc.c
crc32c_ppc.h
crc32c_ppc_asm.S
crc32c_ppc_constants.h
crc32c_test.cc
data_structure.cc
defer.h
defer_test.cc
distributed_mutex.h
duplicate_detector.h
dynamic_bloom.cc
dynamic_bloom.h
dynamic_bloom_test.cc
fastrange.h
file_checksum_helper.cc
file_checksum_helper.h
file_reader_writer_test.cc
filelock_test.cc
filter_bench.cc
gflags_compat.h
hash.cc
hash.h
hash128.h
hash_containers.h
hash_map.h
hash_test.cc
heap.h
heap_test.cc
kv_map.h
log_write_bench.cc
math.h
math128.h
murmurhash.cc
murmurhash.h
mutexlock.h
overload.h
ppc-opcode.h
random.cc
random.h
random_test.cc
rate_limiter.cc
rate_limiter_impl.h
rate_limiter_test.cc
repeatable_thread.h
repeatable_thread_test.cc
ribbon_alg.h
ribbon_config.cc
ribbon_config.h
ribbon_impl.h
ribbon_test.cc
set_comparator.h
single_thread_executor.h
slice.cc
slice_test.cc
slice_transform_test.cc
status.cc
stderr_logger.cc
stderr_logger.h
stop_watch.h
string_util.cc
string_util.h
string_util_test.cc
thread_guard.h
thread_list_test.cc
thread_local.cc
thread_local.h
thread_local_test.cc
thread_operation.h
threadpool_imp.cc
threadpool_imp.h
timer.h
timer_queue.h
timer_queue_test.cc
timer_test.cc
udt_util.cc
udt_util.h
udt_util_test.cc
user_comparator_wrapper.h
vector_iterator.h
work_queue.h
work_queue_test.cc
write_batch_util.cc
write_batch_util.h
xxhash.cc
xxhash.h
xxph3.h