From: myoungwon oh Date: Mon, 2 Dec 2024 10:02:08 +0000 (+0000) Subject: crimson/osd/ops_executer: prevent access to null pointers caused by gcc bug X-Git-Tag: testing/wip-vshankar-testing-20241219.063429-debug~92^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b5665cfac472edefbf45a16f726663c6709a68a9;p=ceph-ci.git crimson/osd/ops_executer: prevent access to null pointers caused by gcc bug This commit assigns the parameter eariler to work around a coroutine related gcc bug that causes a null pointer access. Signed-off-by: Yingxin Cheng Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/osd/ops_executer.h b/src/crimson/osd/ops_executer.h index 94b64ccebb1..51436f19da7 100644 --- a/src/crimson/osd/ops_executer.h +++ b/src/crimson/osd/ops_executer.h @@ -517,14 +517,21 @@ OpsExecuter::flush_changes_n_do_ops_effects( ceph_assert(log_rit->version == osd_op_params->at_version); } + /* + * This works around the gcc bug causing the generated code to incorrectly + * execute unconditionally before the predicate. + * + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101244 + */ + auto clone_obc = cloning_ctx + ? std::move(cloning_ctx->clone_obc) + : nullptr; auto [_submitted, _all_completed] = co_await mut_func( std::move(txn), std::move(obc), std::move(*osd_op_params), std::move(log_entries), - cloning_ctx - ? std::move(cloning_ctx->clone_obc) - : nullptr); + std::move(clone_obc)); submitted = std::move(_submitted); all_completed = std::move(_all_completed);