Re: [Boost-bugs] [Boost C++ Libraries] #10740: Multi-level containers do not cooperate with address tracking

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10740: Multi-level containers do not cooperate with address tracking
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-11-27 21:57:57


#10740: Multi-level containers do not cooperate with address tracking
-------------------------------------+-------------------------------------
  Reporter: Simon Etter | Owner: ramey
  <ettersi@…> | Status: closed
      Type: Bugs | Component: serialization
 Milestone: To Be Determined | Severity: Problem
   Version: Boost 1.56.0 | Keywords: Address tracking, STL
Resolution: invalid | containers
-------------------------------------+-------------------------------------

Comment (by ramey):

 " Since we would like future pointers to this "logical" object to point to
 &l_.back() and not &tll_, we tell the new address to the archive by
 calling reset_pointer_address(). At this point, the error happens: We
 would also have to tell the archive that we want future pointers to
 reference &l_.back().back() and not &tll_.back(). We cannot do this,
 however, because at this point in the code we don't know that tll_ (which
 corresponds to the variable s in the actual code) is in fact a vector."

 Not quite that simple

 given:
 std::vector<dummy> t1;
 std::vector<std::vector<dummy>> t2(t1)

 ia >> t2
     for each t in t2
         ia >> t
             for each x in t
                 ia >> x
                 resetobjectaddress (x) // moves pointer to everythingf t1
             resetobjectaddress(t) // moves pointers to everything under t2

 note that the addresses in t1 get moved twice !
 std::vector<dummy> t

 So this is pretty subtle - the fact that sometimes it works and sometimes
 it doesn't means it's going to be a bitch to find.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10740#comment:7>
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:17 UTC