Bug #63308
opencrash: ZonedAllocator::ZonedAllocator
0%
Description
When I use the vstart command to start the ceph cluster to verify SMR related functions, a crash problem occurs during the startup process. The details are as follows:
Ceph Version : 17.2.6 (d7ff0d10654d2280e08f1ab989c7cdf3064446a5) quincy (stable)
cmake command : ./do_cmake.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DWITH_MGR_DASHBOARD_FRONTEND=OFF -DWITH_BLUEFS=ON -DWITH_SPDK=ON -DWITH_ZBD=ON
vstart command : MON=1 OSD=1 MDS=0 ../src/vstart.sh --new --localhost --bluestore --bluestore-devs /dev/sdb --bluestore-zoned
backtrace :
*** Caught signal (Floating point exception) **
in thread 7f2c35c97800 thread_name:ceph-osd
ceph version 17.2.6 (d7ff0d10654d2280e08f1ab989c7cdf3064446a5) quincy (stable)
1: /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f2c35dcc520]
2: (ZonedAllocator::ZonedAllocator(ceph::common::CephContext*, long, long, long, long, std::basic_string_view<char, std::char_traits<char> >)+0xc7) [0x55640f800da1]
3: (Allocator::create(ceph::common::CephContext*, std::basic_string_view<char, std::char_traits<char> >, long, long, long, long, std::basic_string_view<char, std::char_traits<char> >)+0x595) [0x55640f85d8b1]
4: (BlueStore::_create_alloc()+0x27c) [0x55640f6fb15a]
5: (BlueStore::mkfs()+0x11a0) [0x55640f7a98a2]
6: (OSD::mkfs(ceph::common::CephContext*, std::unique_ptr<ObjectStore, std::default_delete<ObjectStore> >, uuid_d, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)+0x289) [0x55640f0cfd41]
7: main()
8: /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f2c35db3d90]
9: __libc_start_main()
10: _start()
2023-10-24T09:22:33.696+0800 7f2c35c97800 -1 *** Caught signal (Floating point exception) **
in thread 7f2c35c97800 thread_name:ceph-osd
By looking at the code I found the following issue :
// src/os/bluestore/BlueStore.cc : BlueStore::_create_alloc()
#ifdef HAVE_LIBZBD
if (freelist_type == "zoned") {
Allocator *a = Allocator::create(
cct, cct->_conf->bluestore_allocator,
bdev->get_conventional_region_size(),
alloc_size,
0, 0,
"zoned_block");
if (!a) {
lderr(cct) << __func__ << " failed to create " << cct->_conf->bluestore_allocator
<< " allocator" << dendl;
delete alloc;
return -EINVAL;
}
shared_alloc.set(a, alloc_size);
} else
#endif
When calling Allocator::create(), the value passed in for the zone_size parameter is 0. When constructing ZonedAllocator, num_zones is calculated by size / zone_size. Since zone_size is 0, it causes a crash.
I raised https://github.com/ceph/ceph/pull/54155 to try to resolve this issue, please review.
Updated by Igor Fedotov 6 months ago
- Status changed from New to Pending Backport
- Backport set to quincy, reef
Updated by Backport Bot 6 months ago
- Copied to Backport #63315: reef: crash: ZonedAllocator::ZonedAllocator added
Updated by Backport Bot 6 months ago
- Copied to Backport #63316: quincy: crash: ZonedAllocator::ZonedAllocator added
Updated by Konstantin Shalygin 5 days ago
- Assignee set to jrchyang yu
- Target version set to v19.1.0