Bug #81777
closedFeature #75023: Support for Erasure Coded Metadata Pools
osd: EC CALL op coroutine that completes without yielding leaks its stack
100%
Description
`PrimaryLogPG::do_op()` runs a CALL op on a pool with EC optimizations in a coroutine owned by `coro_resumer`, and the coroutine body ends with `on_coroutine_complete()`, which resets `coro_resumer`. Since https://github.com/ceph/ceph/pull/71327, `CoroHandles` keeps only a `weak_ptr`, so when the op completes without yielding, that reset destroys the coroutine while it still runs on its own stack. The fiber is never unwound, and its 128KB stack leaks once per such op. This is the first bug described in https://tracker.ceph.com/issues/79515; PR 71327 fixed the second one (`on_change()`) but kept this reset.
`rados/verify` valgrind jobs on main report it on every OSD:
Leak_DefinitelyLost malloc allocate create_control_block<boost::coroutines2::detail::push_coroutine<void>::control_block, boost::context::basic_fixedsize_stack<boost::context::stack_traits>, PrimaryLogPG::do_op(OpRequestRef&)::<lambda(yield_token_t&)> >
Teuthology reports only the first valgrind error found, which on main is usually the monitor CRYPTO_malloc leak (https://tracker.ceph.com/issues/79831), so this one is hidden. Examples with it on the OSDs behind the monitor error:
- /a/yuriw-2026-10-12_20:51:29-rados-wip-yuri10-testing-20261012.162444-main-distro-default-trial/629993
- /a/skanta-2026-10-03_10:12:06-rados-wip-bharath19-testing-20261002.123021-main-distro-default-trial/604377
With the monitor leak suppressed it is the reported failure, for example:
- https://pulpito-ng.ceph.com/aainscow-2026-10-14_13:56:33-rados:verify-wip-aainscow-rados-qa-fixes-261014-distro-default-trial/ (jobs 637177, 637178)
On a long-running cluster it costs about 128KB of OSD memory per EC CALL op that does not need an async read (for example RBD object-map updates), so OSD RSS grows without bound under such workloads.
AA Updated by Alex Ainscow about 2 months ago
- Related to Bug #79515: osd: coroutine lifecycle bugs in PrimaryLogPG/ECBackend added
AA Updated by Alex Ainscow about 2 months ago
- Pull request ID set to 72704
AA Updated by Alex Ainscow about 2 months ago
- Status changed from New to Fix Under Review
MW Updated by Matty Williams about 2 months ago
- Assignee set to Matty Williams
MW Updated by Matty Williams about 2 months ago
- Parent task set to #75023
LF Updated by Laura Flores about 1 month ago
Fix still under review.
MW Updated by Matty Williams about 1 month ago
- % Done changed from 0 to 80
- Pull request ID changed from 72704 to 73193
MW Updated by Matty Williams about 1 month ago
- Has duplicate Bug #82192: osd: an EC CALL op that runs again after an async read does its sync read on the handles of a finished coroutine added
KS Updated by Kamoltat (Junior) Sirivadhna about 1 month ago
Approved, needs-qa flagged.
KS Updated by Kamoltat (Junior) Sirivadhna 28 days ago
In-QA testing
MW Updated by Matty Williams 21 days ago
- % Done changed from 80 to 100
UB Updated by Upkeep Bot 20 days ago
- Copied to Backport #83143: umbrella: osd: EC CALL op coroutine that completes without yielding leaks its stack added
UB Updated by Upkeep Bot 20 days ago
- Status changed from Fix Under Review to Backporting
- Merge Commit set to 780624c4c32b13ab0cacba91318a229b00702084
- Fixed In set to v22.0.0-858-g780624c4c3
- Upkeep Timestamp set to 2026-11-13T13:33:23+00:00