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-28 08:21:10


#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 Simon Etter <ettersi@…>):

 Regarding comment:6: Let's say it is a consequence of my bug. The point is
 that `pd1` does ''not'' point to `&l1[0][0]`. Rather it points to what I
 called `&tll_.back()`. Since `tll_` was only a temporary and is deleted by
 now, dereferencing `pd1` results once again in undefined behaviour.

 On your machine, it seems that sometimes your "lucky" and `l1[0][0]` gets
 allocated at the location where `tll_[0]` was, which is the one `pd1`
 points to. On my machine, I am not that lucky and the assert fires every
 time. So if you want to do debugging, I suggest you look for a machine
 that behaves as mine. I use g++ version 4.8.1 with the `--std=c++11`
 switch running on a Ubuntu 14.04. If you need further information, you
 know where to find me :-)

 Yes, the addresses of the `dummy` objects (`x`, in your pseudocode) get
 moved twice. But the first move is covered by the resetobjectaddress(x),
 so this does not cause a problem. The problem is the second move, for
 which you only call resetobjectaddress(t), but you should also be calling
 {{{
 for each x in t
     resetobjectaddress(x)
 }}}

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