Project

General

Profile

Actions

Bug #63308

closed
JY JY

crash: ZonedAllocator::ZonedAllocator

Bug #63308: crash: ZonedAllocator::ZonedAllocator

Added by Jrchyang Yu about 3 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
Due date:
% Done:

0%

Source:
Community (user)
Backport:
quincy, reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v18.0.0-6838-g54fea2eefdc
Released In:
v19.2.0~1374
Upkeep Timestamp:
2025-07-11T21:11:25+00:00

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.


Related issues 2 (0 open — 2 closed)

Copied to bluestore - Backport #63315: reef: crash: ZonedAllocator::ZonedAllocatorResolvedKonstantin Shalygin

Actions
Copied to bluestore - Backport #63316: quincy: crash: ZonedAllocator::ZonedAllocatorResolvedKonstantin Shalygin

Actions

IF Updated by Igor Fedotov about 3 years ago Actions #1

  • Status changed from New to Pending Backport
  • Backport set to quincy, reef

IF Updated by Igor Fedotov about 3 years ago Actions #2

  • Pull request ID set to 54155

UB Updated by Upkeep Bot about 3 years ago Actions #3

  • Copied to Backport #63315: reef: crash: ZonedAllocator::ZonedAllocator added

UB Updated by Upkeep Bot about 3 years ago Actions #4

  • Copied to Backport #63316: quincy: crash: ZonedAllocator::ZonedAllocator added

KS Updated by Konstantin Shalygin over 2 years ago Actions #6

  • Assignee set to Jrchyang Yu
  • Target version set to v19.1.0

KS Updated by Konstantin Shalygin over 2 years ago Actions #7

  • Status changed from Pending Backport to Resolved
  • Source set to Community (user)

UB Updated by Upkeep Bot over 1 year ago Actions #8

  • Merge Commit set to 54fea2eefdc987fa89da9867f53e83b2dd7d6b43
  • Fixed In set to v18.0.0-6838-g54fea2eefdc
  • Released In set to v19.2.0~1374
  • Upkeep Timestamp set to 2025-07-11T21:11:25+00:00
Actions

Also available in: PDF Atom