On Monday, June 29th, 2026 at 8:24 PM, Ruben Perez via Boost <boost@lists.boost.org> wrote:
Hi all,
The continuation version of io_context::executor_type::post [1] seems to cause an invalid read when submitting operations that don't inherit from continuation_op. try_from_continuation [2] will attempt to read a magic number. In continuation_op, the magic is before the continuation member [3]. If the submitted operation doesn't inherit from continuation_op, this leads to reading potentially unmapped memory.
Reproducer (build with -fsanitize=address):
struct my_awaitable { capy::continuation* cont;
bool await_ready() const { return false; } std::coroutine_handle<> await_suspend( std::coroutine_handle<> h, capy::io_env const* env) noexcept { cont->h = h; env->executor.post(*cont); return std::noop_coroutine(); }
int await_resume() const { return 42; } };
capy::task<void> co_main() { auto cont = std::make_unique<capy::continuation>(); my_awaitable aw{cont.get()}; int v = co_await aw; std::cout << "The value is: " << v << std::endl; }
I've also raised an issue in the repo [4].
I'll have a look at the issue now. Fix will likely land in develop-2.