From 0b0702ae19d2e84be1a894a1ed254586240d1956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Kardos?= Date: Tue, 20 Feb 2024 17:03:59 +0100 Subject: [PATCH] extra debug info --- src/testing/interleaver.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/testing/interleaver.cpp b/src/testing/interleaver.cpp index 0323503..4982372 100644 --- a/src/testing/interleaver.cpp +++ b/src/testing/interleaver.cpp @@ -174,7 +174,7 @@ std::vector stabilize(std::span> threads) do { const auto elapsed = std::chrono::high_resolution_clock::now() - start; if (elapsed > 200ms) { - throw std::logic_error("deadlock"); + throw std::logic_error("deadlock - still running"); } states = get_states(threads); } while (!is_stable(states)); @@ -182,7 +182,7 @@ std::vector stabilize(std::span> threads) while (!is_unblocked(states)) { const auto elapsed = std::chrono::high_resolution_clock::now() - start; if (elapsed > 200ms) { - throw std::logic_error("deadlock"); + throw std::logic_error("deadlock - all blocked"); } states = get_states(threads); } @@ -307,6 +307,8 @@ path run_next_interleaving(tree& tree, std::span> swarm) current_node = &tree.next(transition_node, resumed); } catch (std::exception&) { + const auto locked_states = get_states(swarm); + path.steps.push_back({ swarm_state(locked_states), -1 }); std::cerr << path.dump() << std::endl; std::terminate(); }