Re: [Boost-bugs] [Boost C++ Libraries] #3848: Boost.Exception and transporting exceptions between threads

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3848: Boost.Exception and transporting exceptions between threads
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-02-04 13:51:31


#3848: Boost.Exception and transporting exceptions between threads
--------------------------------------------------+-------------------------
  Reporter: Nikki Chumakov <nikkikom@…> | Owner: emildotchevski
      Type: Bugs | Status: closed
 Milestone: | Component: exception
   Version: Boost 1.40.0 | Severity: Problem
Resolution: fixed | Keywords: exception thread safety
--------------------------------------------------+-------------------------

Comment(by Nikki Chumakov <nikkikom@…>):

 Thank you.

 Also I'm getting a lot of errors when translating latest svn boost with
 g++ 4.4.2 20091222 (Red Hat 4.4.2-20) (GCC) in с++0x mode.

 {{{
 g++ -std=c++0x -O6 -s -I. -I../boost/trunk -o t test.cc -lltdl
 In file included from ../boost/trunk/boost/exception_ptr.hpp:9,
                  from ../boost/trunk/boost/exception/all.hpp:30,
                  from ./service/error.h:6,
                  from ./service/library.h:7,
                  from test.cc:4:
 ../boost/trunk/boost/exception/detail/exception_ptr.hpp: In function
 â€˜boost::exception_ptr boost::exception_detail::get_bad_alloc()’:
 ../boost/trunk/boost/exception/detail/exception_ptr.hpp:80: error: call of
 overloaded ‘copy_exception(const boost::exception_detail::bad_alloc_&)’ is
 ambiguous
 ../boost/trunk/boost/exception/detail/exception_ptr.hpp:38: note:
 candidates are: boost::exception_ptr boost::copy_exception(const T&) [with
 T = boost::exception_detail::bad_alloc_]
 /usr/lib/gcc/x86_64-redhat-
 linux/4.4.2/../../../../include/c++/4.4.2/exception_ptr.h:152: note:
 std::__exception_ptr::exception_ptr std::copy_exception(_Ex) [with _Ex =
 boost::exception_detail::bad_alloc_]
 ../boost/trunk/boost/exception/detail/exception_ptr.hpp: In function
 â€˜boost::exception_ptr
 boost::exception_detail::current_exception_unknown_exception()’:
 ../boost/trunk/boost/exception/detail/exception_ptr.hpp:221: error: call
 of overloaded ‘copy_exception(boost::unknown_exception)’ is ambiguous
 ../boost/trunk/boost/exception/detail/exception_ptr.hpp:38: note:
 candidates are: boost::exception_ptr boost::copy_exception(const T&) [with
 T = boost::unknown_exception]
 /usr/lib/gcc/x86_64-redhat-
 linux/4.4.2/../../../../include/c++/4.4.2/exception_ptr.h:152: note:
 std::__exception_ptr::exception_ptr std::copy_exception(_Ex) [with _Ex =
 boost::unknown_exception]
 ../boost/trunk/boost/exception/detail/exception_ptr.hpp: In function
 â€˜boost::exception_ptr
 boost::exception_detail::current_exception_unknown_boost_exception(const
 boost::exception&)’:
 ../boost/trunk/boost/exception/detail/exception_ptr.hpp:228: error: call
 of overloaded ‘copy_exception(boost::unknown_exception)’ is ambiguous

 etc... etc...
 }}}

 I would suggest the following patch, it works great:

 {{{
 --- boost/exception/detail/exception_ptr.hpp 2010-02-03
 20:08:23.114427338 +0300
 +++ /usr/local/include/boost/exception/detail/exception_ptr.hpp 2010-02-04
 05:57:37.490551407 +0300
 @@ -73,7 +73,7 @@
          exception_ptr
          get_bad_alloc()
              {
 - static exception_ptr e = copy_exception(
 + static exception_ptr e = boost::copy_exception(
                  bad_alloc_() <<
                  throw_function("boost::current_exception()") <<
                  throw_file(__FILE__) <<
 @@ -209,23 +209,23 @@
          current_exception_std_exception( T const & e1 )
              {
              if( boost::exception const * e2 = get_boost_exception(&e1) )
 - return
 copy_exception(current_exception_std_exception_wrapper<T>(e1,*e2));
 + return
 boost::copy_exception(current_exception_std_exception_wrapper<T>(e1,*e2));
              else
 - return
 copy_exception(current_exception_std_exception_wrapper<T>(e1));
 + return
 boost::copy_exception(current_exception_std_exception_wrapper<T>(e1));
              }

          inline
          exception_ptr
          current_exception_unknown_exception()
              {
 - return copy_exception(unknown_exception());
 + return boost::copy_exception(unknown_exception());
              }

          inline
          exception_ptr
          current_exception_unknown_boost_exception( boost::exception const
 & e )
              {
 - return copy_exception(unknown_exception(e));
 + return boost::copy_exception(unknown_exception(e));
              }

          inline
 @@ -235,7 +235,7 @@
              if( boost::exception const * be = get_boost_exception(&e) )
                  return current_exception_unknown_boost_exception(*be);
              else
 - return copy_exception(unknown_exception(e));
 + return boost::copy_exception(unknown_exception(e));
              }

          inline
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3848#comment:8>
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 : 2017-02-16 18:50:02 UTC