Hi Marcus,
Thanks for your comment. Unfortunately I won't be able to try this for a
while (due to an unexpected stay-home order after COVID close contact),
but I tried something similar earlier, so I will explain that.
I created and configured a USRP object, used it, and then created a new
one, assigning it to the same shared_ptr. In this case, the shared_ptr
goes out of scope and gets destroyed, but the application keeps running
and tries to use the new object. In that case, I sometimes get an
additional error saying something like "attempting to reconnect Rfnoc
block", but ultimately (maybe after another destruction/recreation
cycle) it fails with the same error I sent earlier. Basically, the error
seems to be triggered by the destruction of a streamer object, and
whatever rfnoc cleanup that entails internally. Could it be that I
should wait/sleep after destroying a streamer to let the rfnoc magic
complete before attempting to create a new streamer or quitting the
application?
P.S. also note that the code I sent earlier does not print "t1 dead,
OK", meaning that it crashes before the return statement.
Thanks,
Viktor
On 7/7/21 11:49 PM, Marcus D. Leech wrote:
On 07/07/2021 09:09 AM, Viktor Erdelyi wrote:
Hi all,
I get an undecipherable assertion failure when running the following
simple code using a 1Gbps Ethernet link. The error happens when t1
goes out of scope, every time I run the application. What am I missing?
int main(int argc, char *argv[]) {
uhd::device_addr_t devAddresses("addr=192.168.10.2");
auto usrp = uhd::usrp::multi_usrp::make(devAddresses);
uhd::stream_args_t stream_args("fc32", "sc16");
stream_args.channels.push_back(0);
{
auto t1 = usrp->get_tx_stream(stream_args);
std::cout << "t1 alive" << std::endl;
}
std::cout << "t1 dead, OK" << std::endl;
return 0;
}
The output and the error is as follows:
[INFO] [UHD] linux; GNU C++ version 11.0.1 20210324 (Red Hat
11.0.1-0); Boost_107500; UHD_4.0.0.0
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 1472 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
t1 alive
[WARNING] [0/Radio#0] Attempting to set tick rate to 0. Skipping.
/usr/include/c++/11/bits/stl_vector.h:1045: std::vector<_Tp,
_Alloc>::reference std::vector<_Tp,
_Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp =
boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,
boost::vecS, boost::bidirectionalS,
boost::property<uhd::rfnoc::detail::graph_t::vertex_property_t,
uhd::rfnoc::node_t*>,
boost::property<uhd::rfnoc::detail::graph_t::edge_property_t,
uhd::rfnoc::graph_edge_t> >, boost::vecS, boost::vecS,
boost::bidirectionalS,
boost::property<uhd::rfnoc::detail::graph_t::vertex_property_t,
uhd::rfnoc::node_t*>,
boost::property<uhd::rfnoc::detail::graph_t::edge_property_t,
uhd::rfnoc::graph_edge_t>, boost::no_property,
boost::listS>::config::stored_vertex; _Alloc =
std::allocator<boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,
boost::vecS, boost::bidirectionalS,
boost::property<uhd::rfnoc::detail::graph_t::vertex_property_t,
uhd::rfnoc::node_t*>,
boost::property<uhd::rfnoc::detail::graph_t::edge_property_t,
uhd::rfnoc::graph_edge_t> >, boost::vecS, boost::vecS,
boost::bidirectionalS,
boost::property<uhd::rfnoc::detail::graph_t::vertex_property_t,
uhd::rfnoc::node_t*>,
boost::property<uhd::rfnoc::detail::graph_t::edge_property_t,
uhd::rfnoc::graph_edge_t>, boost::no_property,
boost::listS>::config::stored_vertex>; std::vector<_Tp,
_Alloc>::reference =
boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,
boost::vecS, boost::bidirectionalS,
boost::property<uhd::rfnoc::detail::graph_t::vertex_property_t,
uhd::rfnoc::node_t*>,
boost::property<uhd::rfnoc::detail::graph_t::edge_property_t,
uhd::rfnoc::graph_edge_t> >, boost::vecS, boost::vecS,
boost::bidirectionalS,
boost::property<uhd::rfnoc::detail::graph_t::vertex_property_t,
uhd::rfnoc::node_t*>,
boost::property<uhd::rfnoc::detail::graph_t::edge_property_t,
uhd::rfnoc::graph_edge_t>, boost::no_property,
boost::listS>::config::stored_vertex&; std::vector<_Tp,
_Alloc>::size_type = long unsigned int]: Assertion '__n <
this->size()' failed.
./quickRun.sh: line 8: 47138 Aborted (core dumped)
./$OUTNAME
Environment:
Fedora 34 x64
UHD 4.0.0.0
USRP X310 w/ UBX-160 x 2
Thanks,
Viktor
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
What happens if you sleep for perhaps 1 second prior to exiting?
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]