id summary reporter owner description type status milestone component version severity resolution keywords cc 2929 boost::function cause runtime stack overflow Dmitriy Iassenev Douglas Gregor "the bug described below is presented in all the boost versions starting from 1.36 and to development trunk {{{ #include void main() { boost::function f( &main ); boost::function g; g.assign ( f, std::allocator() ); } }}} this code sample being compiled under MSVC 8.0 SP1 give the following warning warning C4717: 'boost::detail::function::functor_wrapper,std::allocator >::functor_wrapper,std::allocator >' : recursive on all control paths, function will cause runtime stack overflow if we run the sample, it does cause stack overflow with the following call stack: ... test_boost.exe!boost::detail::function::functor_wrapper,std::allocator >::functor_wrapper,std::allocator >(const boost::detail::function::functor_wrapper,std::allocator > & __that={...}) + 0x39 bytes C++ test_boost.exe!boost::detail::function::functor_wrapper,std::allocator >::functor_wrapper,std::allocator >(const boost::detail::function::functor_wrapper,std::allocator > & __that={...}) + 0x39 bytes C++ test_boost.exe!std::_Construct,std::allocator >,boost::detail::function::functor_wrapper,std::allocator > >(boost::detail::function::functor_wrapper,std::allocator > * _Ptr=0x00185008, const boost::detail::function::functor_wrapper,std::allocator > & _Val={...}) Line 53 + 0x33 bytes C++ test_boost.exe!std::allocator,std::allocator > >::construct(boost::detail::function::functor_wrapper,std::allocator > * _Ptr=0x00185008, const boost::detail::function::functor_wrapper,std::allocator > & _Val={...}) Line 156 + 0xd bytes C++ test_boost.exe!boost::detail::function::basic_vtable0::assign_functor_a,std::allocator >(boost::function f={...}, boost::detail::function::function_buffer & functor={...}, std::allocator a={...}, boost::mpl::bool_<0> __formal={...}) Line 591 + 0x60 bytes C++ test_boost.exe!boost::detail::function::basic_vtable0::assign_to_a,std::allocator >(boost::function f={...}, boost::detail::function::function_buffer & functor={...}, std::allocator a={...}, boost::detail::function::function_obj_tag __formal={...}) Line 615 C++ test_boost.exe!boost::detail::function::basic_vtable0::assign_to_a,std::allocator >(boost::function f={...}, boost::detail::function::function_buffer & functor={...}, std::allocator a={...}) Line 497 + 0x47 bytes C++ test_boost.exe!boost::function0::assign_to_a,std::allocator >(boost::function f={...}, std::allocator a={...}) Line 949 + 0x3d bytes C++ test_boost.exe!boost::function0::assign,std::allocator >(boost::function f={...}, std::allocator a={...}) Line 802 + 0x34 bytes C++ test_boost.exe!main() Line 8 C++ " Bugs closed Boost 1.39.0 function Boost 1.38.0 Showstopper fixed boost function stack overflow