Project

General

Profile

Actions

Bug #70619

closed

ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs free) on 0x611000570d40

Added by Milind Changire 12 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
EC Pools
Target version:
-
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Tags (freeform):
Fixed In:
v20.0.0-867-gddeeecd562
Released In:
v20.2.0~727
Upkeep Timestamp:
2025-11-01T01:13:56+00:00

Description

https://pulpito.ceph.com/mchangir-2025-03-22_04:08:06-fs:functional-wip-mchangir-use-libc-for-segfault-main-debug-distro-default-smithi/

following excerpt about Erasure Code is from teuthology.log
please see if it is relevant and a valid concern

2025-03-22T04:27:58.210 INFO:tasks.ceph.osd.3.smithi102.stderr:=================================================================
2025-03-22T04:27:58.210 INFO:tasks.ceph.osd.3.smithi102.stderr:==42899==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs free) on 0x611000570d40
2025-03-22T04:27:58.253 DEBUG:teuthology.orchestra.run.smithi102:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 env ASAN_OPTIONS=detect_leaks=0,detect_odr_violation=0,alloc_dealloc_mismatch=0 LD_PRELOAD=/lib64/libasan.so.6 ceph --cluster ceph osd pool set cephfs_data_ec allow_ec_overwrites true
2025-03-22T04:27:58.442 INFO:tasks.ceph.osd.3.smithi102.stderr:    #0 0x7efdc30b46b7 in free (/lib64/libasan.so.6+0xb46b7)
2025-03-22T04:27:58.442 INFO:tasks.ceph.osd.3.smithi102.stderr:    #1 0x7efd9e2e5f26 in ErasureCodeIsaTableCache::setEncodingTable(int, int, int, unsigned char*) (/usr/lib64/ceph/erasure-code/libec_isa.so+0x3bf26)
2025-03-22T04:27:58.442 INFO:tasks.ceph.osd.3.smithi102.stderr:    #2 0x7efd9e2f0fae in ErasureCodeIsaDefault::prepare() (/usr/lib64/ceph/erasure-code/libec_isa.so+0x46fae)
2025-03-22T04:27:58.442 INFO:tasks.ceph.osd.3.smithi102.stderr:    #3 0x7efd9e2bfa3e in ErasureCodeIsa::init(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&, std::ostream*) (/usr/lib64/ceph/erasure-code/libec_isa.so+0x15a3e)
2025-03-22T04:27:58.442 INFO:tasks.ceph.osd.3.smithi102.stderr:    #4 0x7efd9e2ff510 in ErasureCodePluginIsa::factory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&, std::shared_ptr<ceph::ErasureCodeInterface>*, std::ostream*) (/usr/lib64/ceph/erasure-code/libec_isa.so+0x55510)
2025-03-22T04:27:58.442 INFO:tasks.ceph.osd.3.smithi102.stderr:    #5 0x55a7ef19b395 in ceph::ErasureCodePluginRegistry::factory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&, std::shared_ptr<ceph::ErasureCodeInterface>*, std::ostream*) (/usr/bin/ceph-osd+0x4dcb395)
2025-03-22T04:27:58.442 INFO:tasks.ceph.osd.3.smithi102.stderr:    #6 0x55a7eb9089d8 in PGBackend::build_pg_backend(pg_pool_t const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, PGBackend::Listener*, coll_t, boost::intrusive_ptr<ObjectStore::CollectionImpl>&, ObjectStore*, ceph::common::CephContext*) (/usr/bin/ceph-osd+0x15389d8)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #7 0x55a7eb4b63ec in PrimaryLogPG::PrimaryLogPG(OSDService*, std::shared_ptr<OSDMap const>, PGPool const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, spg_t) (/usr/bin/ceph-osd+0x10e63ec)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #8 0x55a7eaef1cc7 in OSD::_make_pg(std::shared_ptr<OSDMap const>, spg_t) (/usr/bin/ceph-osd+0xb21cc7)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #9 0x55a7eaef8d69 in OSD::handle_pg_create_info(std::shared_ptr<OSDMap const> const&, PGCreateInfo const*) (/usr/bin/ceph-osd+0xb28d69)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #10 0x55a7eafeb9ed in OSD::ShardedOpWQ::_process(unsigned int, ceph::heartbeat_handle_d*) (/usr/bin/ceph-osd+0xc1b9ed)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #11 0x55a7ed04c9aa in ShardedThreadPool::shardedthreadpool_worker(unsigned int) (/usr/bin/ceph-osd+0x2c7c9aa)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #12 0x55a7ed04d338 in ShardedThreadPool::WorkThreadSharded::entry() (/usr/bin/ceph-osd+0x2c7d338)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #13 0x55a7ecf92b46 in Thread::entry_wrapper() (/usr/bin/ceph-osd+0x2bc2b46)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #14 0x55a7ecf92b82 in Thread::_entry_func(void*) (/usr/bin/ceph-osd+0x2bc2b82)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #15 0x7efdc1e8a3b1 in start_thread (/lib64/libc.so.6+0x8a3b1)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:    #16 0x7efdc1f0f42f in __GI___clone3 (/lib64/libc.so.6+0x10f42f)
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:
2025-03-22T04:27:58.443 INFO:tasks.ceph.osd.3.smithi102.stderr:0x611000570d40 is located 0 bytes inside of 256-byte region [0x611000570d40,0x611000570e40)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:allocated by thread T817 here:
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #0 0x7efdc30b64d7 in operator new[](unsigned long) (/lib64/libasan.so.6+0xb64d7)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #1 0x7efd9e2f0e32 in ErasureCodeIsaDefault::prepare() (/usr/lib64/ceph/erasure-code/libec_isa.so+0x46e32)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #2 0x7efd9e2bfa3e in ErasureCodeIsa::init(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&, std::ostream*) (/usr/lib64/ceph/erasure-code/libec_isa.so+0x15a3e)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #3 0x7efd9e2ff510 in ErasureCodePluginIsa::factory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&, std::shared_ptr<ceph::ErasureCodeInterface>*, std::ostream*) (/usr/lib64/ceph/erasure-code/libec_isa.so+0x55510)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #4 0x55a7ef19b395 in ceph::ErasureCodePluginRegistry::factory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&, std::shared_ptr<ceph::ErasureCodeInterface>*, std::ostream*) (/usr/bin/ceph-osd+0x4dcb395)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #5 0x55a7eb9089d8 in PGBackend::build_pg_backend(pg_pool_t const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, PGBackend::Listener*, coll_t, boost::intrusive_ptr<ObjectStore::CollectionImpl>&, ObjectStore*, ceph::common::CephContext*) (/usr/bin/ceph-osd+0x15389d8)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #6 0x55a7eb4b63ec in PrimaryLogPG::PrimaryLogPG(OSDService*, std::shared_ptr<OSDMap const>, PGPool const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, spg_t) (/usr/bin/ceph-osd+0x10e63ec)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #7 0x55a7eaef1cc7 in OSD::_make_pg(std::shared_ptr<OSDMap const>, spg_t) (/usr/bin/ceph-osd+0xb21cc7)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #8 0x55a7eaef8d69 in OSD::handle_pg_create_info(std::shared_ptr<OSDMap const> const&, PGCreateInfo const*) (/usr/bin/ceph-osd+0xb28d69)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #9 0x55a7eafeb9ed in OSD::ShardedOpWQ::_process(unsigned int, ceph::heartbeat_handle_d*) (/usr/bin/ceph-osd+0xc1b9ed)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #10 0x55a7ed04c9aa in ShardedThreadPool::shardedthreadpool_worker(unsigned int) (/usr/bin/ceph-osd+0x2c7c9aa)
2025-03-22T04:27:58.444 INFO:tasks.ceph.osd.3.smithi102.stderr:    #11 0x55a7ed04d338 in ShardedThreadPool::WorkThreadSharded::entry() (/usr/bin/ceph-osd+0x2c7d338)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #12 0x55a7ecf92b46 in Thread::entry_wrapper() (/usr/bin/ceph-osd+0x2bc2b46)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #13 0x55a7ecf92b82 in Thread::_entry_func(void*) (/usr/bin/ceph-osd+0x2bc2b82)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #14 0x7efdc1e8a3b1 in start_thread (/lib64/libc.so.6+0x8a3b1)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:Thread T817 created by T0 here:
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #0 0x7efdc30587d5 in pthread_create (/lib64/libasan.so.6+0x587d5)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #1 0x55a7ecf92d3c in Thread::try_create(unsigned long) (/usr/bin/ceph-osd+0x2bc2d3c)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #2 0x55a7ecf92f76 in Thread::create(char const*, unsigned long) (/usr/bin/ceph-osd+0x2bc2f76)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #3 0x55a7ed04d5aa in ShardedThreadPool::start_threads() (/usr/bin/ceph-osd+0x2c7d5aa)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #4 0x55a7ed04de31 in ShardedThreadPool::start() (/usr/bin/ceph-osd+0x2c7de31)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #5 0x55a7eaea5fb3 in OSD::init() (/usr/bin/ceph-osd+0xad5fb3)
2025-03-22T04:27:58.445 INFO:tasks.ceph.osd.3.smithi102.stderr:    #6 0x55a7ead2bf82 in main (/usr/bin/ceph-osd+0x95bf82)
2025-03-22T04:27:58.446 INFO:tasks.ceph.osd.3.smithi102.stderr:    #7 0x7efdc1e295cf in __libc_start_call_main (/lib64/libc.so.6+0x295cf)
2025-03-22T04:27:58.446 INFO:tasks.ceph.osd.3.smithi102.stderr:
2025-03-22T04:27:58.446 INFO:tasks.ceph.osd.3.smithi102.stderr:SUMMARY: AddressSanitizer: alloc-dealloc-mismatch (/lib64/libasan.so.6+0xb46b7) in free
2025-03-22T04:27:58.446 INFO:tasks.ceph.osd.3.smithi102.stderr:==42899==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
Actions #2

Updated by Bill Scales 12 months ago

  • Category set to EC Pools
  • Assignee set to Alex Ainscow
Actions #3

Updated by Alex Ainscow 12 months ago

This was introduced in commit 6a88e090a4e8a64b70e7d5135d839c954bd509e3.

Strangely, the commit message claims it does the exact opoosite:

erasure-code: use new/delete to alloc/free coefficients array

before this change, we allocate coefficients table with
`malloc()` in `ErasureCodeIsaDefault::prepare()`, but free them using
`delete`. this is identified by LeakSanitizer, and it reports

Looks like they missed the free in the report above.

So the history is:

  • 2014/10/9: 5b41dacfd9377d732e22a2b55ac618db97194a62 - Introduces the problem (malloc + free/delete)
  • 2024/30/3: 6a88e090a4e8a64b70e7d5135d839c954bd509e3 - Partial fix to issue (Changes delete -> delete[], keeps free as is.

So I think some kind of fix needs backporting here.

Actions #4

Updated by Alex Ainscow 12 months ago

Radoslaw Zarzynski wrote in #note-1:

Related https://github.com/ceph/ceph/pull/58052?

This is related insomuch as it means the problem is going to be seen more frequently, but it did not introduce the issue.

Actions #5

Updated by Alex Ainscow 12 months ago

  • Assignee changed from Alex Ainscow to Kefu Chai
Actions #6

Updated by Kefu Chai 12 months ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 62480
Actions #7

Updated by Kefu Chai 12 months ago

  • Status changed from Fix Under Review to Resolved
Actions #8

Updated by Upkeep Bot 8 months ago

  • Merge Commit set to ddeeecd562981d4a93a9b7d9ed1c22a8117ea471
  • Fixed In set to v20.0.0-867-gddeeecd5629
  • Upkeep Timestamp set to 2025-07-09T19:08:09+00:00
Actions #9

Updated by Upkeep Bot 8 months ago

  • Fixed In changed from v20.0.0-867-gddeeecd5629 to v20.0.0-867-gddeeecd562
  • Upkeep Timestamp changed from 2025-07-09T19:08:09+00:00 to 2025-07-14T18:12:51+00:00
Actions #10

Updated by Upkeep Bot 5 months ago

  • Released In set to v20.2.0~727
  • Upkeep Timestamp changed from 2025-07-14T18:12:51+00:00 to 2025-11-01T01:13:56+00:00
Actions

Also available in: Atom PDF