[boost141/el5] - Backport the upstream patch for fixing of memory leaks in Boost.Serialization (backported from boo

Robert Scheck robert at fedoraproject.org
Thu Feb 19 19:38:49 UTC 2015


commit 67170a17acc65bb74f5fa4cb2496716bd0b3e6d6
Author: Robert Scheck <robert at fedoraproject.org>
Date:   Thu Feb 19 20:37:42 2015 +0100

    - Backport the upstream patch for fixing of memory leaks in Boost.Serialization (backported from boost-1.41.0-19)
    - Add an upstream patch for BOOST_ENABLE_THREADS (backported from boost-1.41.0-20)
    - Fix the building of Python module for Boost-MPI and ship it (backported from boost-1.41.0-21)
    - Fix shared_ptr and Boost.Thread to work with recent GCC and C++11 (backported from boost-1.41.0-22 and boost-1.41.0-23)
    - Fix conformance problems in Boost.Interprocess, Boost.Intrusive and Boost.Graph (backported from boost-1.41.0-23)
    - Fix the conformance problems in Boost.Numeric (uBLAS) and Boost.CircularBuffer (backported from boost-1.41.0-24)

 __init__.py                                        |   9 +
 boost-1.41.0-circular_buffer-adl.patch             |  43 +++++
 boost-1.41.0-graph-conformance.patch               | 128 ++++++++++++++
 boost-1.41.0-gthreads.patch                        |  15 ++
 boost-1.41.0-interprocess-conformance-maxval.patch |  49 ++++++
 boost-1.41.0-interprocess-conformance.patch        |  62 +++++++
 boost-1.41.0-intrusive-conformance.patch           |  27 +++
 boost-1.41.0-mpi-python.patch                      |  41 +++++
 boost-1.41.0-numeric-conformance.patch             |  47 ++++++
 boost-1.41.0-serialization-leak.patch              | 185 +++++++++++++++++++++
 boost-1.41.0-shared_ptr-deleted-copy.patch         |  11 ++
 boost-1.41.0-thread-rvalue-fixes.patch             |  21 +++
 boost141.spec                                      | 103 ++++++++----
 13 files changed, 709 insertions(+), 32 deletions(-)
---
diff --git a/__init__.py b/__init__.py
new file mode 100644
index 0000000..2e73922
--- /dev/null
+++ b/__init__.py
@@ -0,0 +1,9 @@
+import sys
+if sys.platform == 'linux2':
+    import DLFCN as dl
+    flags = sys.getdlopenflags()
+    sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
+    import mpi
+    sys.setdlopenflags(flags)
+else:
+    import mpi
diff --git a/boost-1.41.0-circular_buffer-adl.patch b/boost-1.41.0-circular_buffer-adl.patch
new file mode 100644
index 0000000..a9795dc
--- /dev/null
+++ b/boost-1.41.0-circular_buffer-adl.patch
@@ -0,0 +1,43 @@
+From 2bd298dec79bd30aa0d54a5ca1d519cb9a36a230 Mon Sep 17 00:00:00 2001
+From: Jan Gaspar <jano_gaspar at yahoo.com>
+Date: Mon, 26 Apr 2010 09:40:08 +0000
+Subject: [PATCH] circular_buffer: applied patch to remove workaround for DEC
+ C++ compiler - now all compilers will use 
+ this->invalidate_iterators_except
+
+[SVN r61570]
+---
+ include/boost/circular_buffer/space_optimized.hpp |    8 --------
+ 1 files changed, 0 insertions(+), 8 deletions(-)
+
+diff --git a/include/boost/circular_buffer/space_optimized.hpp b/include/boost/circular_buffer/space_optimized.hpp
+index 33008e8..9c76afe 100644
+--- a/include/boost/circular_buffer/space_optimized.hpp
++++ b/include/boost/circular_buffer/space_optimized.hpp
+@@ -1260,11 +1260,7 @@ private:
+                 ensure_reserve(new_capacity, new_size));
+         }
+ #if BOOST_CB_ENABLE_DEBUG
+-# if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(70190006))
+         this->invalidate_iterators_except(end());
+-# else
+-        invalidate_iterators_except(end());
+-# endif
+ #endif
+     }
+ 
+@@ -1284,11 +1280,7 @@ private:
+         circular_buffer<T, Alloc>::set_capacity(
+             ensure_reserve(new_capacity, size()));
+ #if BOOST_CB_ENABLE_DEBUG
+-# if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(70190006))
+         this->invalidate_iterators_except(end());
+-# else
+-        invalidate_iterators_except(end());
+-# endif
+ #endif
+     }
+ 
+-- 
+1.7.6.5
+
diff --git a/boost-1.41.0-graph-conformance.patch b/boost-1.41.0-graph-conformance.patch
new file mode 100644
index 0000000..c0eaf44
--- /dev/null
+++ b/boost-1.41.0-graph-conformance.patch
@@ -0,0 +1,128 @@
+From 21c9b6e553361819b086179e37604f8db55a3415 Mon Sep 17 00:00:00 2001
+From: Douglas Gregor <doug.gregor at gmail.com>
+Date: Thu, 29 Apr 2010 00:42:35 +0000
+Subject: [PATCH] Various standards-conformation fixes for Boost.Graph. Fixes
+ #4157
+
+[SVN r61666]
+---
+ include/boost/graph/eccentricity.hpp |    6 ++++--
+ test/kolmogorov_max_flow_test.cpp    |   26 +++++++++++++-------------
+ 2 files changed, 17 insertions(+), 15 deletions(-)
+
+diff --git a/include/boost/graph/eccentricity.hpp b/include/boost/graph/eccentricity.hpp
+index 4d4ddbc..6043477 100644
+--- a/include/boost/graph/eccentricity.hpp
++++ b/include/boost/graph/eccentricity.hpp
+@@ -53,7 +53,7 @@ all_eccentricities(const Graph& g, const DistanceMatrix& dist, EccentricityMap e
+     typedef typename property_traits<EccentricityMap>::value_type Eccentricity;
+     BOOST_USING_STD_MIN();
+     BOOST_USING_STD_MAX();
+-
++    
+     Eccentricity
+             r = numeric_values<Eccentricity>::infinity(),
+             d = numeric_values<Eccentricity>::zero();
+@@ -68,7 +68,7 @@ all_eccentricities(const Graph& g, const DistanceMatrix& dist, EccentricityMap e
+         r = min BOOST_PREVENT_MACRO_SUBSTITUTION (r, e);
+         d = max BOOST_PREVENT_MACRO_SUBSTITUTION (d, e);
+     }
+-    return make_pair(r, d);
++    return std::make_pair(r, d);
+ }
+ 
+ template <typename Graph, typename EccentricityMap>
+@@ -81,6 +81,8 @@ radius_and_diameter(const Graph& g, EccentricityMap ecc)
+     typedef typename graph_traits<Graph>::vertex_iterator VertexIterator;
+     function_requires< ReadablePropertyMapConcept<EccentricityMap, Vertex> >();
+     typedef typename property_traits<EccentricityMap>::value_type Eccentricity;
++    BOOST_USING_STD_MIN();
++    BOOST_USING_STD_MAX();
+ 
+     VertexIterator i, end;
+     tie(i, end) = vertices(g);
+diff --git a/test/kolmogorov_max_flow_test.cpp b/test/kolmogorov_max_flow_test.cpp
+index 8786afc..4d087e4 100644
+--- a/boost-1.41.0/libs/graph/test/kolmogorov_max_flow_test.cpp
++++ b/boost-1.41.0/libs/graph/test/kolmogorov_max_flow_test.cpp
+@@ -242,12 +242,12 @@ class kolmogorov_test:public detail::kolmogorov<Graph,EdgeCapacityMap,ResidualCa
+           typename std::list<tVertex>::const_iterator it = find(tSuper::m_orphans.begin(), tSuper::m_orphans.end(), v);
+           // a node is active, if its in the active_list AND (is has_a_parent, or its already in the orphans_list or its the sink, or its the source)
+           bool is_active = (tSuper::m_in_active_list_map[v] && (tSuper::has_parent(v) || it != tSuper::m_orphans.end() ));
+-          if(get_tree(v) != tColorTraits::gray() && !is_active){
++          if(this->get_tree(v) != tColorTraits::gray() && !is_active){
+             typename graph_traits<Graph>::out_edge_iterator ei,e_end;
+             for(tie(ei, e_end) = out_edges(v, tSuper::m_g); ei != e_end; ++ei){
+               const tVertex& other_node = target(*ei, tSuper::m_g);
+-              if(get_tree(other_node) != get_tree(v)){
+-                if(get_tree(v) == tColorTraits::black())
++              if(this->get_tree(other_node) != this->get_tree(v)){
++                if(this->get_tree(v) == tColorTraits::black())
+                   BOOST_CHECK(tSuper::m_res_cap_map[*ei] == 0);
+                 else
+                   BOOST_CHECK(tSuper::m_res_cap_map[tSuper::m_rev_edge_map[*ei]] == 0);
+@@ -257,20 +257,20 @@ class kolmogorov_test:public detail::kolmogorov<Graph,EdgeCapacityMap,ResidualCa
+         }
+ 
+         void invariant_five(const tVertex& v) const{
+-          BOOST_CHECK(get_tree(v) != tColorTraits::gray() || tSuper::m_time_map[v] <= tSuper::m_time);
++          BOOST_CHECK(this->get_tree(v) != tColorTraits::gray() || tSuper::m_time_map[v] <= tSuper::m_time);
+         }
+ 
+         void invariant_six(const tVertex& v) const{
+-          if(get_tree(v) == tColorTraits::gray() || tSuper::m_time_map[v] != tSuper::m_time)
++          if(this->get_tree(v) == tColorTraits::gray() || tSuper::m_time_map[v] != tSuper::m_time)
+             return;
+           else{
+             tVertex current_node = v;
+             tDistanceVal distance = 0;
+-            tColorValue color = get_tree(v);
++            tColorValue color = this->get_tree(v);
+             tVertex terminal = (color == tColorTraits::black()) ? tSuper::m_source : tSuper::m_sink;
+             while(current_node != terminal){
+               BOOST_CHECK(tSuper::has_parent(current_node));
+-              tEdge e = get_edge_to_parent(current_node);
++              tEdge e = this->get_edge_to_parent(current_node);
+               ++distance;
+               current_node = (color == tColorTraits::black())? source(e, tSuper::m_g) : target(e, tSuper::m_g);
+               if(distance > tSuper::m_dist_map[v])
+@@ -281,14 +281,14 @@ class kolmogorov_test:public detail::kolmogorov<Graph,EdgeCapacityMap,ResidualCa
+         }
+ 
+         void invariant_seven(const tVertex& v) const{
+-          if(get_tree(v) == tColorTraits::gray())
++          if(this->get_tree(v) == tColorTraits::gray())
+             return;
+           else{
+-            tColorValue color = get_tree(v);
++            tColorValue color = this->get_tree(v);
+             long time = tSuper::m_time_map[v];
+             tVertex current_node = v;
+             while(tSuper::has_parent(current_node)){
+-              tEdge e = get_edge_to_parent(current_node);
++              tEdge e = this->get_edge_to_parent(current_node);
+               current_node = (color == tColorTraits::black()) ? source(e, tSuper::m_g) : target(e, tSuper::m_g);
+               BOOST_CHECK(tSuper::m_time_map[current_node] >= time);
+             }
+@@ -296,15 +296,15 @@ class kolmogorov_test:public detail::kolmogorov<Graph,EdgeCapacityMap,ResidualCa
+         }//invariant_seven
+ 
+         void invariant_eight(const tVertex& v) const{
+-          if(get_tree(v) == tColorTraits::gray())
++          if(this->get_tree(v) == tColorTraits::gray())
+              return;
+           else{
+-            tColorValue color = get_tree(v);
++            tColorValue color = this->get_tree(v);
+             long time = tSuper::m_time_map[v];
+             tDistanceVal distance = tSuper::m_dist_map[v];
+             tVertex current_node = v;
+             while(tSuper::has_parent(current_node)){
+-              tEdge e = get_edge_to_parent(current_node);
++              tEdge e = this->get_edge_to_parent(current_node);
+               current_node = (color == tColorTraits::black()) ? source(e, tSuper::m_g) : target(e, tSuper::m_g);
+               if(tSuper::m_time_map[current_node] == time)
+                 BOOST_CHECK(tSuper::m_dist_map[current_node] < distance);
+-- 
+1.7.6.5
+
diff --git a/boost-1.41.0-gthreads.patch b/boost-1.41.0-gthreads.patch
new file mode 100644
index 0000000..a194cce
--- /dev/null
+++ b/boost-1.41.0-gthreads.patch
@@ -0,0 +1,15 @@
+diff -up boost-1.41.0.cmake0/boost/config/stdlib/libstdcpp3.hpp\~ boost-1.41.0.cmake0/boost/config/stdlib/libstdcpp3.hpp
+--- boost-1.41.0.cmake0/boost/config/stdlib/libstdcpp3.hpp~	2009-11-18 17:44:37.000000000 +0100
++++ boost-1.41.0.cmake0/boost/config/stdlib/libstdcpp3.hpp	2014-04-29 00:53:57.975139925 +0200
+@@ -31,7 +31,8 @@
+ 
+ #ifdef __GLIBCXX__ // gcc 3.4 and greater:
+ #  if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
+-        || defined(_GLIBCXX__PTHREADS)
++        || defined(_GLIBCXX__PTHREADS) \
++        || defined(_GLIBCXX_HAS_GTHREADS)
+       //
+       // If the std lib has thread support turned on, then turn it on in Boost
+       // as well.  We do this because some gcc-3.4 std lib headers define _REENTANT
+
+Diff finished.  Tue Apr 29 00:54:01 2014
diff --git a/boost-1.41.0-interprocess-conformance-maxval.patch b/boost-1.41.0-interprocess-conformance-maxval.patch
new file mode 100644
index 0000000..dd48391
--- /dev/null
+++ b/boost-1.41.0-interprocess-conformance-maxval.patch
@@ -0,0 +1,49 @@
+From c46d606b778ad3d11f7ff7a744ed35219690a1fc Mon Sep 17 00:00:00 2001
+From: Douglas Gregor <doug.gregor at gmail.com>
+Date: Thu, 29 Apr 2010 00:54:26 +0000
+Subject: [PATCH] Standards-conformance fix for Boost.Interprocess: max_value
+ needs to be declared before it is used, since ADL won't
+ look here.
+
+[SVN r61667]
+---
+ .../containers/container/detail/utilities.hpp      |   16 ++++++++--------
+ 1 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/include/boost/interprocess/containers/container/detail/utilities.hpp b/include/boost/interprocess/containers/container/detail/utilities.hpp
+index 6a0fd0e..1077938 100644
+--- a/include/boost/interprocess/containers/container/detail/utilities.hpp
++++ b/include/boost/interprocess/containers/container/detail/utilities.hpp
+@@ -24,6 +24,14 @@ namespace boost {
+ namespace container {
+ namespace containers_detail {
+ 
++template<class T>
++const T &max_value(const T &a, const T &b)
++{  return a > b ? a : b;   }
++
++template<class T>
++const T &min_value(const T &a, const T &b)
++{  return a < b ? a : b;   }
++
+ template <class SizeType>
+ SizeType
+    get_next_capacity(const SizeType max_size
+@@ -44,14 +52,6 @@ SizeType
+    return max_size;
+ }
+ 
+-template<class T>
+-const T &max_value(const T &a, const T &b)
+-{  return a > b ? a : b;   }
+-
+-template<class T>
+-const T &min_value(const T &a, const T &b)
+-{  return a < b ? a : b;   }
+-
+ template<class SmartPtr>
+ struct smart_ptr_type
+ {
+-- 
+1.7.6.5
+
diff --git a/boost-1.41.0-interprocess-conformance.patch b/boost-1.41.0-interprocess-conformance.patch
new file mode 100644
index 0000000..ef7d3d7
--- /dev/null
+++ b/boost-1.41.0-interprocess-conformance.patch
@@ -0,0 +1,62 @@
+From 502ebea876e52bbcf332794be577ef18384b0313 Mon Sep 17 00:00:00 2001
+From: Douglas Gregor <doug.gregor at gmail.com>
+Date: Thu, 29 Apr 2010 00:36:35 +0000
+Subject: [PATCH] Various standards-conformance fixes for Boost.Interprocess.
+
+[SVN r61665]
+---
+ .../container/detail/transform_iterator.hpp        |    2 +-
+ .../interprocess/detail/managed_memory_impl.hpp    |    4 ++--
+ .../interprocess/detail/transform_iterator.hpp     |    2 +-
+
+diff --git a/include/boost/interprocess/containers/container/detail/transform_iterator.hpp b/include/boost/interprocess/containers/container/detail/transform_iterator.hpp
+index 4e98c77..6ca8b69 100644
+--- a/include/boost/interprocess/containers/container/detail/transform_iterator.hpp
++++ b/include/boost/interprocess/containers/container/detail/transform_iterator.hpp
+@@ -51,7 +51,7 @@ struct operator_arrow_proxy<T&>
+    // This function is needed for MWCW and BCC, which won't call operator->
+    // again automatically per 13.3.1.2 para 8
+ //   operator T*() const { return &m_value; }
+-   mutable T &m_value;
++   T &m_value;
+ };
+ 
+ template <class Iterator, class UnaryFunction>
+diff --git a/include/boost/interprocess/detail/managed_memory_impl.hpp b/include/boost/interprocess/detail/managed_memory_impl.hpp
+index 8cf4e50..395b4d8 100644
+--- a/include/boost/interprocess/detail/managed_memory_impl.hpp
++++ b/include/boost/interprocess/detail/managed_memory_impl.hpp
+@@ -682,7 +682,7 @@ class basic_managed_memory_impl
+    template<class T>
+    typename allocator<T>::type
+       get_allocator()
+-   {   return mp_header->get_allocator<T>(); }
++   {   return mp_header->BOOST_NESTED_TEMPLATE get_allocator<T>(); }
+ 
+    //!This is the default deleter to delete types T
+    //!from this managed segment.
+@@ -697,7 +697,7 @@ class basic_managed_memory_impl
+    template<class T>
+    typename deleter<T>::type
+       get_deleter()
+-   {   return mp_header->get_deleter<T>(); }
++   {   return mp_header->BOOST_NESTED_TEMPLATE get_deleter<T>(); }
+ 
+    /// @cond
+    //!Tries to find a previous named allocation address. Returns a memory
+diff --git a/include/boost/interprocess/detail/transform_iterator.hpp b/include/boost/interprocess/detail/transform_iterator.hpp
+index f98c641..b6e1139 100644
+--- a/include/boost/interprocess/detail/transform_iterator.hpp
++++ b/include/boost/interprocess/detail/transform_iterator.hpp
+@@ -54,7 +54,7 @@ struct operator_arrow_proxy<T&>
+    // This function is needed for MWCW and BCC, which won't call operator->
+    // again automatically per 13.3.1.2 para 8
+ //   operator T*() const { return &m_value; }
+-   mutable T &m_value;
++   T &m_value;
+ };
+ 
+ template <class Iterator, class UnaryFunction>
+-- 
+1.7.6.5
+
diff --git a/boost-1.41.0-intrusive-conformance.patch b/boost-1.41.0-intrusive-conformance.patch
new file mode 100644
index 0000000..5dc3442
--- /dev/null
+++ b/boost-1.41.0-intrusive-conformance.patch
@@ -0,0 +1,27 @@
+From ba311e69cfb75ca0c24ce859992e13be9abf3a54 Mon Sep 17 00:00:00 2001
+From: Douglas Gregor <doug.gregor at gmail.com>
+Date: Thu, 29 Apr 2010 00:35:20 +0000
+Subject: [PATCH] Mutable references are ill-formed. Remove a sporadic
+ "mutable".
+
+[SVN r61664]
+---
+ .../boost/intrusive/detail/transform_iterator.hpp  |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/include/boost/intrusive/detail/transform_iterator.hpp b/include/boost/intrusive/detail/transform_iterator.hpp
+index a9de49e..15ef3ab 100644
+--- a/include/boost/intrusive/detail/transform_iterator.hpp
++++ b/include/boost/intrusive/detail/transform_iterator.hpp
+@@ -46,7 +46,7 @@ struct operator_arrow_proxy<T&>
+    // This function is needed for MWCW and BCC, which won't call operator->
+    // again automatically per 13.3.1.2 para 8
+ //   operator T*() const { return &m_value; }
+-   mutable T &m_value;
++   T &m_value;
+ };
+ 
+ template <class Iterator, class UnaryFunction>
+-- 
+1.7.6.5
+
diff --git a/boost-1.41.0-mpi-python.patch b/boost-1.41.0-mpi-python.patch
new file mode 100644
index 0000000..17712c7
--- /dev/null
+++ b/boost-1.41.0-mpi-python.patch
@@ -0,0 +1,41 @@
+--- ./libs/mpi/src/CMakeLists.txt	2009-11-18 17:44:37.000000000 +0100
++++ ./libs/mpi/src/CMakeLists.txt	2012-03-09 19:15:05.365549067 +0100
+@@ -68,7 +71,7 @@ if (NOT APPLE)
+       python/status.cpp
+       python/py_timer.cpp
+ 
+-      DEPENDS boost_python boost_mpi
++      DEPENDS boost_python boost_mpi boost_mpi_python boost_serialization
+       SHARED_COMPILE_FLAGS "-DBOOST_MPI_DYN_LINK=1 -DBOOST_MPI_PYTHON_DYN_LINK=1 -DBOOST_PYTHON_DYN_LINK=1"
+       LINK_FLAGS ${MPI_LINK_FLAGS}
+       LINK_LIBS ${MPI_LIBRARIES} ${PYTHON_LIBRARIES}
+--- ./tools/build/CMake/BoostCore.cmake	2012-03-08 22:18:12.463206955 +0100
++++ ./tools/build/CMake/BoostCore.cmake	2012-03-09 19:16:40.238345008 +0100
+@@ -1491,19 +1491,19 @@ endmacro(boost_add_executable)
+ #  Macro for building boost.python extensions
+ #
+ macro(boost_python_extension MODULE_NAME)
+-  parse_arguments(BPL_EXT 
+-    "" 
+-    "" 
+-    ${ARGN})
+-  
++  parse_arguments(BPL_EXT
++    "DEPENDS;COMPILE_FLAGS;LINK_FLAGS;LINK_LIBS;${BOOST_ADD_ARG_NAMES}"
++    "${BOOST_ADDLIB_OPTION_NAMES}"
++    ${ARGN}
++    )
++
+   boost_add_single_library(
+     ${MODULE_NAME}
+     ${BPL_EXT_DEFAULT_ARGS}
+     MODULE
+-    LINK_LIBS ${PYTHON_LIBRARIES}
+-    DEPENDS boost_python
++    LINK_LIBS ${PYTHON_LIBRARIES} ${BPL_EXT_LINK_LIBS}
++    DEPENDS boost_python ${BPL_EXT_DEPENDS}
+     SHARED
+     MULTI_THREADED
+-    DEBUG
+     )
+ endmacro()
diff --git a/boost-1.41.0-numeric-conformance.patch b/boost-1.41.0-numeric-conformance.patch
new file mode 100644
index 0000000..7975ba6
--- /dev/null
+++ b/boost-1.41.0-numeric-conformance.patch
@@ -0,0 +1,47 @@
+From 7d12da09a9c4c3d7a5d2fccac320997e3b6b69e7 Mon Sep 17 00:00:00 2001
+From: Douglas Gregor <doug.gregor at gmail.com>
+Date: Sun, 9 May 2010 01:40:22 +0000
+Subject: [PATCH] Merge standards-conformance fixes for Ublas
+
+[SVN r61868]
+---
+ include/boost/numeric/ublas/functional.hpp |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/include/boost/numeric/ublas/functional.hpp b/include/boost/numeric/ublas/functional.hpp
+index 85f14d0..3512e84 100644
+--- a/include/boost/numeric/ublas/functional.hpp
++++ b/include/boost/numeric/ublas/functional.hpp
+@@ -2016,25 +2016,25 @@ namespace boost { namespace numeric { namespace ublas {
+         static
+         BOOST_UBLAS_INLINE
+         size_type restrict1 (size_type i, size_type j, size_type size1, size_type size2) {
+-            return mutable_restrict1(i, j, size1, size2);
++            return basic_unit_lower<Z>::mutable_restrict1(i, j, size1, size2);
+         }
+         static
+         BOOST_UBLAS_INLINE
+         size_type restrict2 (size_type i, size_type j, size_type size1, size_type size2) {
+-            return mutable_restrict2(i, j, size1, size2);
++            return basic_unit_lower<Z>::mutable_restrict2(i, j, size1, size2);
+         }
+ 
+         // return an index between the first and (1+last) filled row
+         static
+         BOOST_UBLAS_INLINE
+         size_type global_restrict1 (size_type index1, size_type size1, size_type index2, size_type size2) {
+-            return global_mutable_restrict1(index1, size1, index2, size2);
++            return basic_unit_lower<Z>::global_mutable_restrict1(index1, size1, index2, size2);
+         }
+         // return an index between the first and (1+last) filled column
+         static
+         BOOST_UBLAS_INLINE
+         size_type global_restrict2 (size_type index1, size_type size1, size_type index2, size_type size2) {
+-            return global_mutable_restrict2(index1, size1, index2, size2);
++            return basic_unit_lower<Z>::global_mutable_restrict2(index1, size1, index2, size2);
+         }
+     };
+ 
+-- 
+1.7.6.5
+
diff --git a/boost-1.41.0-serialization-leak.patch b/boost-1.41.0-serialization-leak.patch
new file mode 100644
index 0000000..ace1a69
--- /dev/null
+++ b/boost-1.41.0-serialization-leak.patch
@@ -0,0 +1,185 @@
+diff -urp boost-1.41.0.cmake0/boost/archive/shared_ptr_helper.hpp boost-1.41.0.cmake0.pm/boost/archive/shared_ptr_helper.hpp
+--- boost-1.41.0.cmake0/boost/archive/shared_ptr_helper.hpp	2013-12-13 13:01:21.219200086 +0100
++++ boost-1.41.0.cmake0.pm/boost/archive/shared_ptr_helper.hpp	2013-12-13 12:50:18.772182683 +0100
+@@ -71,6 +71,16 @@ class shared_ptr_helper {
+         void operator()(void const *) const {}
+     };
+ 
++    struct void_deleter {
++        const boost::serialization::extended_type_info * m_eti;
++        void_deleter(const boost::serialization::extended_type_info *eti) :
++            m_eti(eti)
++        {}
++        void operator()(void *vp) const {
++            m_eti->destroy(vp);
++        }
++    };
++
+ #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+ public:
+ #else
+diff -urp boost-1.41.0.cmake0/boost/serialization/extended_type_info_no_rtti.hpp boost-1.41.0.cmake0.pm/boost/serialization/extended_type_info_no_rtti.hpp
+--- boost-1.41.0.cmake0/boost/serialization/extended_type_info_no_rtti.hpp	2009-11-18 17:44:37.000000000 +0100
++++ boost-1.41.0.cmake0.pm/boost/serialization/extended_type_info_no_rtti.hpp	2013-12-13 13:00:49.424011953 +0100
+@@ -31,6 +31,9 @@
+ #include <boost/serialization/factory.hpp>
+ #include <boost/serialization/throw_exception.hpp>
+ 
++// hijack serialization access
++#include <boost/serialization/access.hpp>
++
+ #include <boost/config/abi_prefix.hpp> // must be the last header
+ #ifdef BOOST_MSVC
+ #  pragma warning(push)
+@@ -141,7 +144,10 @@ public:
+         }
+     }
+     virtual void destroy(void const * const p) const{
+-        delete static_cast<T const *>(p) ;
++        boost::serialization::access::destroy(
++            static_cast<T const * const>(p)
++        );
++        //delete static_cast<T const * const>(p) ;
+     }
+ };
+ 
+diff -urp boost-1.41.0.cmake0/boost/serialization/extended_type_info_typeid.hpp boost-1.41.0.cmake0.pm/boost/serialization/extended_type_info_typeid.hpp
+--- boost-1.41.0.cmake0/boost/serialization/extended_type_info_typeid.hpp	2009-11-18 17:44:37.000000000 +0100
++++ boost-1.41.0.cmake0.pm/boost/serialization/extended_type_info_typeid.hpp	2013-12-13 13:00:49.425011958 +0100
+@@ -32,6 +32,9 @@
+ #include <boost/serialization/extended_type_info.hpp>
+ #include <boost/serialization/factory.hpp>
+ 
++// hijack serialization access
++#include <boost/serialization/access.hpp>
++
+ #include <boost/mpl/if.hpp>
+ 
+ #include <boost/config/abi_prefix.hpp> // must be the last header
+@@ -124,15 +127,11 @@ public:
+             return NULL;
+         }
+     }
+-    virtual void destroy(void const * const /* p */) const {
+-        // the only current usage of extended type info is in the
+-        // serialization library.  The statement below requires
+-        // that destructor of type T be public and this creates
+-        // a problem for some users.  So, for now, comment this
+-        // out 
+-        //delete static_cast<T const *>(p);
+-        // and trap any attempt to invoke this function
+-        assert(false);
++    virtual void destroy(void const * const p) const {
++        boost::serialization::access::destroy(
++            static_cast<T const * const>(p)
++        );
++        //delete static_cast<T const * const>(p);
+     }
+ };
+ 
+Только в boost-1.41.0.cmake0.pm/boost/serialization: extended_type_info_typeid.hpp.orig
+diff -urp boost-1.41.0.cmake0/boost/serialization/weak_ptr.hpp boost-1.41.0.cmake0.pm/boost/serialization/weak_ptr.hpp
+--- boost-1.41.0.cmake0/boost/serialization/weak_ptr.hpp	2009-11-18 17:44:37.000000000 +0100
++++ boost-1.41.0.cmake0.pm/boost/serialization/weak_ptr.hpp	2013-12-13 13:00:49.448012092 +0100
+@@ -29,7 +29,7 @@ inline void save(
+     const unsigned int /* file_version */
+ ){
+     const boost::shared_ptr<T> sp = t.lock();
+-        ar << boost::serialization::make_nvp("shared_ptr", sp);
++    ar << boost::serialization::make_nvp("weak_ptr", sp);
+ }
+ 
+ template<class Archive, class T>
+@@ -39,7 +39,7 @@ inline void load(
+     const unsigned int /* file_version */
+ ){
+     boost::shared_ptr<T> sp;
+-        ar >> boost::serialization::make_nvp("shared_ptr", sp);
++    ar >> boost::serialization::make_nvp("weak_ptr", sp);
+     t = sp;
+ }
+ 
+diff -urp boost-1.41.0.cmake0/libs/serialization/src/extended_type_info.cpp boost-1.41.0.cmake0.pm/libs/serialization/src/extended_type_info.cpp
+--- boost-1.41.0.cmake0/libs/serialization/src/extended_type_info.cpp	2009-11-18 17:44:37.000000000 +0100
++++ boost-1.41.0.cmake0.pm/libs/serialization/src/extended_type_info.cpp	2013-12-13 12:50:30.068347163 +0100
+@@ -78,6 +78,13 @@ class extended_type_info_arg : public ex
+     virtual const char * get_debug_info() const {
+         return get_key();
+     }
++    virtual void * construct(unsigned int /*count*/, ...) const{
++        assert(false);
++        return NULL;
++    }
++    virtual void destroy(void const * const /*p*/) const {
++        assert(false);
++    }
+ public:
+     extended_type_info_arg(const char * key) :
+         extended_type_info(0, key)
+Только в boost-1.41.0.cmake0.pm/libs/serialization/src: extended_type_info.cpp.orig
+diff -urp boost-1.41.0.cmake0/libs/serialization/src/extended_type_info_typeid.cpp boost-1.41.0.cmake0.pm/libs/serialization/src/extended_type_info_typeid.cpp
+--- boost-1.41.0.cmake0/libs/serialization/src/extended_type_info_typeid.cpp	2009-11-18 17:44:37.000000000 +0100
++++ boost-1.41.0.cmake0.pm/libs/serialization/src/extended_type_info_typeid.cpp	2013-12-13 12:50:40.613409575 +0100
+@@ -60,9 +60,6 @@ BOOST_SERIALIZATION_DECL(bool) 
+ extended_type_info_typeid_0::is_equal(
+     const boost::serialization::extended_type_info & rhs
+ ) const {
+-    // shortcut for common case
+-    if(this == & rhs)
+-        return true;
+     return static_cast<bool>(
+         * m_ti 
+         == *(static_cast<const extended_type_info_typeid_0 &>(rhs).m_ti)
+@@ -113,6 +110,13 @@ extended_type_info_typeid_0::type_unregi
+ class extended_type_info_typeid_arg : 
+     public extended_type_info_typeid_0
+ {
++    virtual void * construct(unsigned int /*count*/, ...) const{
++        assert(false);
++        return NULL;
++    }
++    virtual void destroy(void const * const /*p*/) const {
++        assert(false);
++    }
+ public:
+     extended_type_info_typeid_arg(const std::type_info & ti) :
+         extended_type_info_typeid_0(NULL)
+Только в boost-1.41.0.cmake0.pm/libs/serialization/src: extended_type_info_typeid.cpp.orig
+diff -urp boost-1.41.0.cmake0/libs/serialization/src/shared_ptr_helper.cpp boost-1.41.0.cmake0.pm/libs/serialization/src/shared_ptr_helper.cpp
+--- boost-1.41.0.cmake0/libs/serialization/src/shared_ptr_helper.cpp	2009-11-18 17:44:37.000000000 +0100
++++ boost-1.41.0.cmake0.pm/libs/serialization/src/shared_ptr_helper.cpp	2013-12-13 13:02:44.418692383 +0100
+@@ -61,15 +61,19 @@ shared_ptr_helper::get_od(
+     if(NULL == m_pointers)
+         m_pointers = new collection_type;
+ 
+-    shared_ptr<const void> sp(od, null_deleter()); 
+-    std::pair<collection_type::iterator, bool> result =
+-        m_pointers->insert(
+-            collection_type::value_type(od, sp)
+-        );
++    collection_type::iterator i = m_pointers->find(od);
++    if(i == m_pointers->end()){
++        shared_ptr<const void> sp(od, void_deleter(true_type));
++	std::pair<collection_type::iterator, bool> result =
++	    m_pointers->insert(collection_type::value_type(od, sp));
++        assert(result.second);
++        i = result.first;
++    }
++
+     od = void_upcast(
+         *true_type, 
+         *this_type,
+-        result.first->first
++        i->first
+     );
+     if(NULL == od)
+         boost::serialization::throw_exception(
+@@ -83,7 +83,7 @@ shared_ptr_helper::get_od(
+                 this_type->get_debug_info()
+             )
+         );
+-    return result_type(result.first, od);
++    return result_type(i, od);
+ }
+ 
+ //  #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
diff --git a/boost-1.41.0-shared_ptr-deleted-copy.patch b/boost-1.41.0-shared_ptr-deleted-copy.patch
new file mode 100644
index 0000000..1bbc7db
--- /dev/null
+++ b/boost-1.41.0-shared_ptr-deleted-copy.patch
@@ -0,0 +1,11 @@
+--- boost/smart_ptr/shared_ptr.hpp
++++ boost/smart_ptr/shared_ptr.hpp
+@@ -344,6 +344,8 @@ public:
+ 
+ #if defined( BOOST_HAS_RVALUE_REFS )
+ 
++    shared_ptr( shared_ptr const & r ) = default; // never throws
++
+     shared_ptr( shared_ptr && r ): px( r.px ), pn() // never throws
+     {
+         pn.swap( r.pn );
diff --git a/boost-1.41.0-thread-rvalue-fixes.patch b/boost-1.41.0-thread-rvalue-fixes.patch
new file mode 100644
index 0000000..a5a8450
--- /dev/null
+++ b/boost-1.41.0-thread-rvalue-fixes.patch
@@ -0,0 +1,21 @@
+--- boost/thread/detail/thread.hpp
++++ boost/thread/detail/thread.hpp
+@@ -40,6 +40,9 @@ namespace boost
+         {
+         public:
+ #ifdef BOOST_HAS_RVALUE_REFS
++            thread_data(const F& f_):
++                f(f_)
++            {}
+             thread_data(F&& f_):
+                 f(static_cast<F&&>(f_))
+             {}
+@@ -346,7 +349,7 @@ namespace boost
+ #ifdef BOOST_HAS_RVALUE_REFS
+     inline thread&& move(thread&& t)
+     {
+-        return t;
++        return static_cast<thread&&>(t);
+     }
+ #else
+     inline detail::thread_move_t<thread> move(detail::thread_move_t<thread> t)
diff --git a/boost141.spec b/boost141.spec
index 07c5991..9e60170 100644
--- a/boost141.spec
+++ b/boost141.spec
@@ -18,6 +18,9 @@
 %define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
 %endif
 
+# Backward compatibility for RHEL 4 and 5
+%define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
+
 # Configuration of MPI backends
 %if 0%{?rhel} < 5
   # Too old MPICH2 version on RHEL 4
@@ -57,7 +60,7 @@
 Name: boost141
 Summary: The free peer-reviewed portable C++ source libraries
 Version: 1.41.0
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: Boost and MIT
 URL: http://www.boost.org/
 Group: System Environment/Libraries
@@ -65,7 +68,8 @@ Group: System Environment/Libraries
 # http://sodium.resophonic.com/boost-cmake/%{version}.cmake0/%{full_version}.tar.gz is a
 # repackaged tarball of http://gitorious.org/boost/cmake/archive-tarball/%{version}.cmake0
 %define full_version boost-%{version}.cmake0
-Source: http://sodium.resophonic.com/boost-cmake/%{version}.cmake0/%{full_version}.tar.gz
+Source0: http://sodium.resophonic.com/boost-cmake/%{version}.cmake0/%{full_version}.tar.gz
+Source1: __init__.py
 
 # From the version 13 of Fedora, the Boost libraries are delivered
 # with sonames equal to the Boost version (e.g., 1.41.0).  On older
@@ -129,6 +133,29 @@ Patch6: boost-1.41.0-exception_ptr.patch
 # (https://bugzilla.redhat.com/show_bug.cgi?id=771370)
 Patch7: boost-1.48.0-mathlib.patch
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=1021004
+Patch8: boost-1.41.0-serialization-leak.patch
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=969183
+Patch9: boost-1.41.0-gthreads.patch
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=801534
+Patch10: boost-1.41.0-mpi-python.patch
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=1108268
+Patch11: boost-1.41.0-shared_ptr-deleted-copy.patch
+
+# Make Boost.Thread work with recent GCC and C++11
+Patch12: boost-1.41.0-thread-rvalue-fixes.patch
+
+# Fix standard conformance problems
+Patch13: boost-1.41.0-interprocess-conformance.patch
+Patch14: boost-1.41.0-intrusive-conformance.patch
+Patch15: boost-1.41.0-graph-conformance.patch
+Patch16: boost-1.41.0-interprocess-conformance-maxval.patch
+Patch17: boost-1.41.0-circular_buffer-adl.patch
+Patch18: boost-1.41.0-numeric-conformance.patch
+
 %bcond_with tests
 %bcond_with docs_generated
 
@@ -441,6 +468,17 @@ sed 's/_FEDORA_SONAME/%{sonamever}/' %{PATCH0} | %{__patch} -p0 --fuzz=0
 %patch5 -p1
 %patch6 -p0
 %patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p0
+%patch12 -p0
+%patch13 -p2
+%patch14 -p2
+%patch15 -p2
+%patch16 -p2
+%patch17 -p2
+%patch18 -p2
 
 %build
 # Support for building tests.
@@ -500,24 +538,6 @@ cd build
 
 # Standard test with CMake, depends on installed boost-test.
 ctest --verbose --output-log testing.log
-if [ -f testing.log ]; then
-  echo "" >> testing.log
-  echo `date` >> testing.log
-  echo "" >> testing.log
-  echo `uname -a` >> testing.log
-  echo "" >> testing.log
-  echo `g++ --version` >> testing.log
-  echo "" >> testing.log
-  testdate=`date +%Y%m%d`
-  testarch=`uname -m`
-  email=benjamin.kosnik at gmail.com
-  bzip2 -f testing.log
-  echo "sending results starting"
-  echo | mutt -s "$testdate boost test $testarch" -a testing.log.bz2 $email
-  echo "sending results finished"
-else
-  echo "error with results"
-fi
 cd %{_builddir}/%{full_version}
 %endif
 
@@ -536,12 +556,13 @@ echo ============================= install $MPI_COMPILER ==================
 DESTDIR=$RPM_BUILD_ROOT make -C $MPI_COMPILER VERBOSE=1 install
 # Remove parts of boost that we don't want installed in MPI directory.
 %{__rm} -f $RPM_BUILD_ROOT/$MPI_LIB/libboost_{python,{w,}serialization}*
-# Suppress the mpi.so python module, as it not currently properly
-# generated (some dependencies are missing. It is temporary until
-# upstream Boost-CMake fixes that (see
-# http://lists.boost.org/boost-cmake/2009/12/0859.php for more
-# details)
-%{__rm} -f $RPM_BUILD_ROOT/$MPI_LIB/mpi.so
+
+# Install Boost-MPI Python module.  OpenMPI needs __init__.py that
+# adds RTLD_GLOBAL to dlopen flags.
+%{__install} -m 755 -d ${RPM_BUILD_ROOT}%{python_sitearch}/openmpi/boost
+%{__mv} $RPM_BUILD_ROOT/$MPI_LIB/mpi.so ${RPM_BUILD_ROOT}%{python_sitearch}/openmpi/boost/
+%{__install} %{SOURCE1} ${RPM_BUILD_ROOT}%{python_sitearch}/openmpi/boost/
+
 # Kill any debug library versions that may show up un-invited.
 %{__rm} -f $RPM_BUILD_ROOT/$MPI_LIB/*-d.*
 # Remove cmake configuration files used to build the Boost libraries
@@ -555,12 +576,14 @@ echo ============================= install $MPI_COMPILER ==================
 DESTDIR=$RPM_BUILD_ROOT make -C $MPI_COMPILER VERBOSE=1 install
 # Remove parts of boost that we don't want installed in MPI directory.
 %{__rm} -f $RPM_BUILD_ROOT/$MPI_LIB/libboost_{python,{w,}serialization}*
-# Suppress the mpi.so python module, as it not currently properly
-# generated (some dependencies are missing. It is temporary until
-# upstream Boost-CMake fixes that (see
-# http://lists.boost.org/boost-cmake/2009/12/0859.php for more
-# details)
-%{__rm} -f $RPM_BUILD_ROOT/$MPI_LIB/mpi.so
+
+# Install Boost-MPI Python module.  MPICH doesn't need the __init__.py
+# magic.
+%{__install} -m 755 -d ${RPM_BUILD_ROOT}%{python_sitearch}/mpich2/boost
+%{__mv} $RPM_BUILD_ROOT/$MPI_LIB/mpi.so ${RPM_BUILD_ROOT}%{python_sitearch}/mpich2/boost/
+echo > __init__.py
+%{__install} __init__.py ${RPM_BUILD_ROOT}%{python_sitearch}/mpich2/boost/
+
 # Kill any debug library versions that may show up un-invited.
 %{__rm} -f $RPM_BUILD_ROOT/$MPI_LIB/*-d.*
 # Remove cmake configuration files used to build the Boost libraries
@@ -812,6 +835,7 @@ done
 %defattr(-, root, root, -)
 %doc LICENSE_1_0.txt
 %{_libdir}/openmpi/lib/libboost_mpi_python*.so.%{sonamever}
+%{python_sitearch}/openmpi/boost
 
 %files graph-openmpi
 %defattr(-, root, root, -)
@@ -839,6 +863,7 @@ done
 %defattr(-, root, root, -)
 %doc LICENSE_1_0.txt
 %{_libdir}/mpich2/lib/libboost_mpi_python*.so.%{sonamever}
+%{python_sitearch}/mpich2/boost
 
 %files graph-mpich2
 %defattr(-, root, root, -)
@@ -849,6 +874,20 @@ done
 %endif
 
 %changelog
+* Thu Feb 19 2015 Robert Scheck <robert at fedoraproject.org> 1.41.0-6
+- Backport the upstream patch for fixing of memory leaks in
+  Boost.Serialization (backported from boost-1.41.0-19)
+- Add an upstream patch for BOOST_ENABLE_THREADS (backported from
+  boost-1.41.0-20)
+- Fix the building of Python module for Boost-MPI and ship it
+  (backported from boost-1.41.0-21)
+- Fix the shared_ptr and Boost.Thread to work with recent GCC and
+  C++11 (backported from boost-1.41.0-22 and boost-1.41.0-23)
+- Fix conformance problems in Boost.Interprocess, Boost.Intrusive
+  and Boost.Graph (backported from boost-1.41.0-23)
+- Fix the conformance problems in Boost.Numeric (uBLAS) and
+  Boost.CircularBuffer (backported from boost-1.41.0-24)
+
 * Tue Oct 08 2013 Robert Scheck <robert at fedoraproject.org> 1.41.0-5
 - Update an upstream patch to fix a GCC warning for looser throw
   specifier in boost::exception_ptr::~exception_ptr (backported


More information about the scm-commits mailing list