Re: [Boost-bugs] [Boost C++ Libraries] #13006: serialization optional doesn't initialize stack_construct causes crashes

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13006: serialization optional doesn't initialize stack_construct causes crashes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-05-03 20:48:41


#13006: serialization optional doesn't initialize stack_construct causes crashes
-------------------------------------+---------------------------
  Reporter: rob.vandennieuwenhof@… | Owner: ramey
      Type: Bugs | Status: new
 Milestone: Boost 1.65.0 | Component: serialization
   Version: Boost 1.64.0 | Severity: Regression
Resolution: | Keywords:
-------------------------------------+---------------------------

Comment (by ramey):

 hmmmm - this looks like the implementation was changed in oct 11 2013 to
 the current one to one using stack_allocate. Of course now I don't
 remember the motivation for this change. I'm pretty skeptical that
 changing it back would result in a net gain. I'm guessing that the
 correct fix is more likely something like:

 {{{
 if (version < ?){
         detail::stack_construct<Archive, T> aux(ar, item_version);
         ar >> boost::serialization::make_nvp("value", aux.reference());
         t.reset(aux.reference());
 }
 else{
     detail::stack_allocate<T> tp;
     ar >> boost::serialization::make_nvp("value", tp.reference());
     t.reset(boost::move(tp.reference()));
     ar.reset_object_address(
         t.get_ptr(),
         & tp.reference()
     );
 }}}

 Would that have fixed your issue? - I would be interested in your thoughts
 on this.

 Robert Ramey

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/13006#comment:1>
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-05-03 20:57:54 UTC