Closed ywang-wnlo closed 1 year ago
again
Received signal 11 (Segmentation fault)
#0 /home/femu/rocksdb/db_bench(+0x4ca4d9) [0x55776b5824d9] ?? ??:0
#1 /home/femu/rocksdb/db_bench(+0x4be693) [0x55776b576693] ?? ??:0
#2 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc2b3) [0x7f486e90b2b3] ?? ??:0
#3 /lib/x86_64-linux-gnu/libc.so.6(+0x94b43) [0x7f486e592b43] ?? ??:0
#4 /lib/x86_64-linux-gnu/libc.so.6(+0x126a00) [0x7f486e624a00] ?? ??:0
$ objdump -x db_bench | grep 00000000004ca
00000000004ca210 g F .text 0000000000000212 _ZN7rocksdb16ZonedBlockDevice10EncodeJsonERSo
00000000004ca0f0 g F .text 0000000000000119 _ZN7rocksdb16ZonedBlockDevice21SetZoneDeferredStatusENS_8IOStatusE
00000000004ca430 g F .text 0000000000000537 _ZN7rocksdb16ZonedBlockDevice14LogGarbageInfoEv
00000000004ca970 g F .text 0000000000000a29 _ZN7rocksdb16ZonedBlockDevice14AllocateIOZoneENS_3Env17WriteLifeTimeHintENS_6IOTypeEPPNS_4ZoneE
$ objdump -x db_bench | grep 00000000004be
000000000004be48 l F .text 000000000000003f _ZN7rocksdb25SimulatedHybridFileSystem15NewWritableFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11FileOptionsEPSt10unique_ptrINS_14FSWritableFileESt14default_deleteISD_EEPNS_14IODebugContextE.cold
000000000004be88 l F .text 00000000000001d2 _ZN7rocksdb25SimulatedHybridFileSystemC2ERKSt10shared_ptrINS_10FileSystemEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEib.cold
00000000004bea60 g F .text 0000000000000433 _ZN7rocksdb5ZenFS18DecodeSnapshotFromEPNS_5SliceE
00000000004beea0 g F .text 00000000000005d3 _ZN7rocksdb5ZenFS20DecodeFileUpdateFromEPNS_5SliceEb
00000000004be400 g F .text 0000000000000655 _ZN7rocksdb5ZenFS8GCWorkerEv
Segmentation fault seems in GCWorker->LogGarbageInfo
Fix Segmentation fault while enable zenfs gc.
in LogGarbageInfo
double garbage_rate =
double(z->wp_ - z->start_ - z->used_capacity_) / z->max_capacity_;
assert(garbage_rate > 0);
int idx = int((garbage_rate + 0.1) * 10);
zone_gc_stat[idx]++;
When zone become full, the wp_
will be negative value, so change to use max_capacity_
The pull request is submited!
Segmentation fault while enable zenfs gc
by objdump