[Boost-bugs] [Boost C++ Libraries] #13561: boost::detail::nullary_function causes stack overflow when copied

Subject: [Boost-bugs] [Boost C++ Libraries] #13561: boost::detail::nullary_function causes stack overflow when copied
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-05-04 09:44:58


#13561: boost::detail::nullary_function causes stack overflow when copied
-------------------------------------------------+-------------------------
 Reporter: yhirsch@… | Owner: Anthony
                                                 | Williams
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost 1.67.0 | Severity: Showstopper
 Keywords: |
  stack,overflow,thread,future,nullary,function |
-------------------------------------------------+-------------------------
 Hi,

 It seems as though boost::detail::nullary_function implement a perfect
 forwarding constructor incorrectly, which causes a stack overflow:

 Here is a simple example:

 {{{
 #!C++
 #include <boost/thread/detail/nullary_function.hpp>
 #include <boost/system/detail/error_code.ipp>

 int main(int argc, char* argv[])
 {
     boost::detail::nullary_function<void ()> f1;
     auto f2 = f1;
 }
 }}}

 This ends up invoking nullary_function.hpp:81 which keeps invoking iself
 recursively, resulting in a stack overflow.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13561>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-05-04 09:48:40 UTC