Project

General

Profile

Actions

Bug #76466

closed
SS AA

OSD Assertion Failure: ErasureCode.cc: 252: FAILED ceph_assert(chunk.is_contiguous())

Bug #76466: OSD Assertion Failure: ErasureCode.cc: 252: FAILED ceph_assert(chunk.is_contiguous())

Added by Sridhar Seshasayee 7 months ago. Updated 3 months ago.

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

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-2667-gf9b268c675
Released In:
Upkeep Timestamp:
2026-08-26T07:37:30+00:00

Description

/a/skanta-2026-04-09_03:57:47-rados-wip-bharath16-testing-2026-04-08-1405-distro-default-trial/141122

NOTE:
This appears to be new.
An older tracker with the same assertion failure was fixed on main; See https://tracker.ceph.com/issues/72710

Test Description:
rados/singleton/{all/ec-esb-fio mon_election/connectivity msgr-failures/few msgr/async-v1only objectstore/{bluestore/{alloc$/{bitmap} base mem$/{low} onode-segment$/{512K} write$/{v2/{compr$/{yes$/{zlib}} v2}}}} rados supported-random-distro/{centos_9.stream}}

Backtrace:

/ceph/rpmbuild/BUILD/ceph-21.0.0-339-ge4f1db16/src/erasure-code/ErasureCode.cc: 252: FAILED ceph_assert(chunk.is_contiguous())

 ceph version 21.0.0-339-ge4f1db16 (e4f1db16ea5f5ee2e7dd2ccfc281e2a7b9d7d871) umbrella (dev - RelWithDebInfo)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x11d) [0x78a641]
 2: /usr/lib64/ceph/erasure-code/libec_isa.so(+0xf6ff) [0x7fcbf41136ff]
 3: (ceph::ErasureCode::encode(std::set<int, std::less<int>, std::allocator<int> > const&, ceph::buffer::v15_2_0::list const&, std::map<int, ceph::buffer::v15_2_0::list, std::less<int>, std::allocator<std::pair<int const, ceph::buffer::v15_2_0::list> > >*)+0xa7) [0x7fcbf411e3d7]
 4: (ECLegacy::ECUtilL::encode(ECLegacy::ECUtilL::stripe_info_t const&, std::shared_ptr<ceph::ErasureCodeInterface>&, ceph::buffer::v15_2_0::list&, std::set<int, std::less<int>, std::allocator<int> > const&, std::map<int, ceph::buffer::v15_2_0::list, std::less<int>, std::allocator<std::pair<int const, ceph::buffer::v15_2_0::list> > >*)+0x166) [0xc91fd6]
 5: ceph-osd() [0x16c6f8f]
 6: ceph-osd() [0xca2d7f]
 7: (ECLegacy::ECTransactionL::generate_transactions(PGTransaction*, ECLegacy::ECTransactionL::WritePlan&, std::shared_ptr<ceph::ErasureCodeInterface>&, pg_t, ECLegacy::ECUtilL::stripe_info_t const&, std::map<hobject_t, interval_map<unsigned long, ceph::buffer::v15_2_0::list, ECLegacy::bl_split_merge, std::map, false>, std::less<hobject_t>, std::allocator<std::pair<hobject_t const, interval_map<unsigned long, ceph::buffer::v15_2_0::list, ECLegacy::bl_split_merge, std::map, false> > > > const&, std::vector<pg_log_entry_t, std::allocator<pg_log_entry_t> >&, std::map<hobject_t, interval_map<unsigned long, ceph::buffer::v15_2_0::list, ECLegacy::bl_split_merge, std::map, false>, std::less<hobject_t>, std::allocator<std::pair<hobject_t const, interval_map<unsigned long, ceph::buffer::v15_2_0::list, ECLegacy::bl_split_merge, std::map, false> > > >*, std::map<shard_id_t, ceph::os::Transaction, std::less<shard_id_t>, std::allocator<std::pair<shard_id_t const, ceph::os::Transaction> > >*, std::set<hobject_t, std::less<hobject_t>, std::allocator<hobject_t> >*, std::set<hobject_t, std::less<hobject_t>, std::allocator<hobject_t> >*, DoutPrefixProvider*, ceph_release_t)+0xcad) [0xca4ded]
 8: ceph-osd() [0xca53ab]
 9: (ECLegacy::ECCommonL::RMWPipeline::try_reads_to_commit()+0xb2b) [0xc7954b]
 10: (ECLegacy::ECCommonL::RMWPipeline::check_ops()+0x24) [0xc80e34]
 11: (ECLegacy::ECCommonL::ReadPipeline::kick_reads()+0x4e) [0xc735de]
 12: ceph-osd() [0xc700b0]
 13: (ECLegacy::ECCommonL::ReadPipeline::complete_read_op(ECLegacy::ECCommonL::ReadOp&)+0x263) [0xc67643]
 14: (ECLegacy::ECBackendL::handle_sub_read_reply(pg_shard_t, ECSubReadReply&, ZTracer::Trace const&)+0x18f4) [0xc98144]
 15: (ECLegacy::ECBackendL::_handle_message(boost::intrusive_ptr<OpRequest>)+0x95) [0xc8d0e5]
 16: ceph-osd() [0xb04e5d]
 17: (PGBackend::handle_message(boost::intrusive_ptr<OpRequest>)+0x4d) [0xb10bbd]
 18: (PrimaryLogPG::do_request(boost::intrusive_ptr<OpRequest>&, ThreadPool::TPHandle&)+0x6d9) [0xa3edb9]
 19: (OSD::dequeue_op(boost::intrusive_ptr<PG>, boost::intrusive_ptr<OpRequest>, ThreadPool::TPHandle&)+0x1af) [0x96957f]
 20: (ceph::osd::scheduler::PGOpItem::run(OSD*, OSDShard*, boost::intrusive_ptr<PG>&, ThreadPool::TPHandle&)+0x69) [0xbee389]
 21: (OSD::ShardedOpWQ::_process(unsigned int, unsigned int, ceph::heartbeat_handle_d*)+0x8fa) [0x990faa]
 22: (ShardedThreadPool::shardedthreadpool_worker(unsigned int, unsigned int)+0x32d) [0xf0164d]
 23: ceph-osd() [0xedbc17]
 24: /lib64/libc.so.6(+0x8b2fa) [0x7fcbf8a8b2fa]
 25: /lib64/libc.so.6(+0x1103d0) [0x7fcbf8b103d0]

    -3> 2026-04-09T06:24:22.732+0000 7fcbdde72640 -1 *** Caught signal (Aborted) **
 in thread 7fcbdde72640 thread_name:tp_osd_tp

RZ Updated by Radoslaw Zarzynski 7 months ago ยท Edited Actions #1

@Alex Ainscow: any recent merge that could affect the legacy backend?

LF Updated by Laura Flores 7 months ago Actions #2

Bump up

AA Updated by Alex Ainscow 7 months ago Actions #3

This looks the same as https://tracker.ceph.com/issues/72710. The "fix" was in this build, so it looks like the problem still exists.

AA Updated by Alex Ainscow 7 months ago Actions #4

While it may look like a similar bug exists in Fast EC (see the function below the one that asserted), this function is not actually called.

FastEC has introduced a mechanism which avoids rebuilding non-contiguous buffers, by calling the plugin on ranges that are already known to be contiguous (and doing it as many times as necessary).

This test enables "elastic shared blobs" - could this be breaking the assumptions made by this function?

AA Updated by Alex Ainscow 7 months ago Actions #5

The immediate problem, I think, is caused by this code:

  bool buffer::list::rebuild_aligned_size_and_memory(unsigned align_size,
                            unsigned align_memory,
                            unsigned max_buffers)
  {
    bool had_to_rebuild = false;

    if (max_buffers && _num > max_buffers && _len > (max_buffers * align_size)) {
      align_size = round_up_to(round_up_to(_len, max_buffers) / max_buffers, align_size);
    }
    auto p = std::begin(_buffers);
    auto p_prev = _buffers.before_begin();
    while (p != std::end(_buffers)) {
      // keep anything that's already align and sized aligned
      if (p->is_aligned(align_memory) && p->is_n_align_sized(align_size)) { <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        /*cout << " segment " << (void*)p->c_str()
           << " offset " << ((unsigned long)p->c_str() & (align - 1))
           << " length " << p->length()
           << " " << (p->length() & (align - 1)) << " ok" << std::endl;
        */
        p_prev = p++;
        continue;
      }

The highlighted line will allow a "rebuilt" buffer to keep any zero-sized buffer pointers, thus defeating the assert in ErasureCode.cc!

The problem is that buffer lists really should not have zero-sized buffer pointers in them!

AA Updated by Alex Ainscow 7 months ago Actions #6

But beyond that, I am lost... The logs don't clearly point at any issues. We could work around it by getting the rebuild buffer code to drop any zero-sized buffers, but it would be much better to figure out what is causing the zero length buffers.

I don't think we can easily say if this is a recent regression.

If we see this alot, then we can start adding more debug to go after it.

AA Updated by Alex Ainscow 7 months ago Actions #7

  • Pull request ID set to 69023

LF Updated by Laura Flores 6 months ago Actions #8

  • Status changed from New to Fix Under Review
  • Assignee set to Alex Ainscow

RZ Updated by Radoslaw Zarzynski 6 months ago Actions #9

PR is waiting for QA.

UB Updated by Upkeep Bot 3 months ago Actions #10

  • Status changed from Fix Under Review to Resolved
  • Merge Commit set to f9b268c675c7182ff95e634ece84ba3678004fcd
  • Fixed In set to v21.3.0-2667-gf9b268c675
  • Upkeep Timestamp set to 2026-08-26T07:37:30+00:00
Actions

Also available in: PDF Atom