From bee55f1466e2f40564f56db39ddbcce5455e92c6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:34:49 +0000 Subject: [PATCH] Fix race condition in smt_tactic::collect_statistics Co-authored-by: levnach <5377127+levnach@users.noreply.github.com> --- src/smt/tactic/smt_tactic_core.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/smt/tactic/smt_tactic_core.cpp b/src/smt/tactic/smt_tactic_core.cpp index 7d01ce2ce..b0b4252d0 100644 --- a/src/smt/tactic/smt_tactic_core.cpp +++ b/src/smt/tactic/smt_tactic_core.cpp @@ -101,8 +101,9 @@ public: void collect_statistics(statistics & st) const override { - if (m_ctx) - m_ctx->collect_statistics(st); // ctx is still running... + smt::kernel * local_ctx = m_ctx; // Capture pointer to avoid race condition + if (local_ctx) + local_ctx->collect_statistics(st); // ctx is still running... else st.copy(m_stats); }