From ff0cf9b4331c39b97b525eaa12f4e073ca4a8290 Mon Sep 17 00:00:00 2001 From: Lars Amsel Date: Thu, 3 Jun 2021 13:14:08 +0200 Subject: rfnoc: Fix post action behavior of nodes When a node has an action callback assigned this must be cleared along with the block removal. Otherwise a post action callback might try to modify node that are already removed which results in an undefined behavior. In particular this one fixes the Unexpected error [ERROR] [CTRLEP] Caught exception during async message handling: map::at when running the multi_usrp_test.py --- host/lib/rfnoc/graph.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/host/lib/rfnoc/graph.cpp b/host/lib/rfnoc/graph.cpp index 92cf9e8bf..931777629 100644 --- a/host/lib/rfnoc/graph.cpp +++ b/host/lib/rfnoc/graph.cpp @@ -212,6 +212,8 @@ void graph_t::disconnect(node_ref_t src_node, node_ref_t dst_node, graph_edge_t UHD_LOG_TRACE(LOG_ID, "Removing block " << src_node->get_unique_id() << ":" << edge_info.src_port); node_accessor.clear_resolve_all_callback(src_node); + node_accessor.set_post_action_callback( + src_node, [](const res_source_info&, action_info::sptr) {}); } // Re-look up the vertex descriptor for dst_node, as the act of removing @@ -222,6 +224,8 @@ void graph_t::disconnect(node_ref_t src_node, node_ref_t dst_node, graph_edge_t UHD_LOG_TRACE(LOG_ID, "Removing block " << dst_node->get_unique_id() << ":" << edge_info.dst_port); node_accessor.clear_resolve_all_callback(dst_node); + node_accessor.set_post_action_callback( + dst_node, [](const res_source_info&, action_info::sptr) {}); } } -- cgit v1.2.3