db_bench: Multiple locations/paths assume a single DB but execution may reach them (Segmentation Fault)
db_bench may run in a single db mode (the default) or in a multi-db mode (-num_multi_db). db_bench maintains separate variables, one for the single db case and one for the multi-db case. Whenever there is a need to reference a db (the single db or one of the multiple db-s), the code needs to access the applicable variable. The other one must not be accessed. Attempting to access the other one will result in a segmentation fault.
Some of the code paths / benchmarks support both single and multi-db. Some effectively support only the single db case. However, in some of the scenarios in which only the single-db case is supported, the code fails to verify that it is indeed a single-db case, and will access the single-db variable, resulting in a segmentation fault.
For example:
./db_bench -benchmarks fillseq -num 100 -trace_file trace.udi -num_multi_db 2
./db_bench -benchmarks fillseq,timeseries -num 100 -num_multi_db 2 -threads 2
./db_bench -benchmarks verify -truth_db /tmp/rocksdbtest-1000/dbbench/0 -num_multi_db 2
This list is not exhaustive. The code needs to be reviewed carefully. All references to these variables need to be considered and fixed if necessary.