From 658c5e3cc975c4114242e4eb54ee88733f39629d Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Tue, 26 May 2020 11:07:35 +0100 Subject: [PATCH] [TSAN] Fix off-by-one in socket.drop_policy test (#2786) Causing access of the counted_completion mutex after it goes out of scope. --- nano/core_test/socket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nano/core_test/socket.cpp b/nano/core_test/socket.cpp index bf50fa40..b16552ee 100644 --- a/nano/core_test/socket.cpp +++ b/nano/core_test/socket.cpp @@ -42,7 +42,7 @@ TEST (socket, drop_policy) }); auto client (std::make_shared (node, boost::none, nano::socket::concurrency::multi_writer)); - nano::util::counted_completion write_completion (total_message_count - 1); + nano::util::counted_completion write_completion (total_message_count); client->async_connect (boost::asio::ip::tcp::endpoint (boost::asio::ip::address_v4::loopback (), server_port), [client, total_message_count, node, &write_completion, &drop_policy](boost::system::error_code const & ec_a) {