[Boost-bugs] [Boost C++ Libraries] #5143: segfaults in ordered_index

Subject: [Boost-bugs] [Boost C++ Libraries] #5143: segfaults in ordered_index
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-31 09:59:38

#5143: segfaults in ordered_index
 Reporter: christoph.kluge@… | Owner: joaquin
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: multi_index
  Version: Boost 1.35.0 | Severity: Problem
 Keywords: |

 we are suffering segfaults in
 ordered_index_node_impl::increment line 254

 static void increment(pointer& x)
     while(x->left()!=pointer(0))x=x->left(); // XXX
     pointer y=x->parent();

 What, if x->left() becomes 0? Well, it does, over here! Shouldn't this


 ? What is this line of code supposed to do anyway, other than
 uselessly consuming CPU time? Why not write

     x = 0;

 instead, if this was meant? ordered_index_node_impl_base::left and
 ordered_index_node_impl_base::right do not have any side-effects.

 By the way, for the classes ordered_index_node_std_base and
 ordered_index_node_compressed_base, I don't see any of the POD data
 members getting initialized. A user-provided constructor is not
 defined. From the C++ Standard, IIRC, POD data members are not
 initialized by the implicitly-generated constructor and therefore have
 indeterminate values.

 This also applies to recent versions of boost, the trunk included. The
 code doesn't appear to have changed here.

 To me this looks like this is working only by chance. Has anyone ever
 bothered to review this code?


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