Opened 7 years ago

Closed 7 years ago

#11444 closed Bugs (duplicate)

BOOST_CHECK triggers debug assertion on VS C++ 2015 RC when called from within lambda

Reported by: xxn-boost-bugs@… Owned by: Gennadiy Rozental
Milestone: To Be Determined Component: test
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

I have been trying to use boost tests on with VS C++ 2015 in conjunction with boost asio and a few lambdas. It seems like there is a problem with calling BOOST_CHECK from within a lambda that has previously been dispatched via boost::asio. The calls always look like this:

BOOST_CHECK(foo([] {BOOST_CHECK(false);});

where foo dispatches the lambda some time (depending on network transfers) after the call to foo.

This is an example stack trace for such an assertion:

 	msvcp140d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Zeile 17	C++
>	test_modbus.exe!std::_String_const_iterator<std::_String_val<std::_Simple_types<char> > >::operator+=(int _Off) Zeile 164	C++
 	test_modbus.exe!std::_String_iterator<std::_String_val<std::_Simple_types<char> > >::operator+=(int _Off) Zeile 369	C++
 	test_modbus.exe!std::_String_iterator<std::_String_val<std::_Simple_types<char> > >::operator+(int _Off) Zeile 375	C++
 	test_modbus.exe!std::_Transform1<char *,std::_String_iterator<std::_String_val<std::_Simple_types<char> > >,char (__cdecl*)(char)>(char * _First, char * _Last, std::_String_iterator<std::_String_val<std::_Simple_types<char> > > _Dest, char (char) * _Func, std::random_access_iterator_tag __formal, std::random_access_iterator_tag __formal) Zeile 1049	C++
 	test_modbus.exe!std::_Transform1<char *,std::_String_iterator<std::_String_val<std::_Simple_types<char> > >,char (__cdecl*)(char)>(char * _First, char * _Last, std::_String_iterator<std::_String_val<std::_Simple_types<char> > > _Dest, char (char) * _Func, std::integral_constant<bool,1> __formal) Zeile 1061	C++
 	test_modbus.exe!std::transform<std::_String_iterator<std::_String_val<std::_Simple_types<char> > >,std::_String_iterator<std::_String_val<std::_Simple_types<char> > >,char (__cdecl*)(char)>(std::_String_iterator<std::_String_val<std::_Simple_types<char> > > _First, std::_String_iterator<std::_String_val<std::_Simple_types<char> > > _Last, std::_String_iterator<std::_String_val<std::_Simple_types<char> > > _Dest, char (char) * _Func) Zeile 1086	C++
 	test_modbus.exe!boost::unit_test::unit_test_log_t::operator<<(const boost::unit_test::log::begin & b) Zeile 271	C++
 	test_modbus.exe!boost::test_tools::tt_detail::check_impl(const boost::test_tools::predicate_result & pr, const boost::unit_test::lazy_ostream & check_descr, boost::unit_test::basic_cstring<char const > file_name, unsigned int line_num, boost::test_tools::tt_detail::tool_level tl, boost::test_tools::tt_detail::check_type ct, unsigned int num_of_args, ...) Zeile 162	C++
 	test_modbus.exe!channel_modbus_client::parallel_write::test_method::__l10::<lambda>() Zeile 378	C++

Change History (1)

comment:1 by Gennadiy Rozental, 7 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.