[Boost-bugs] [Boost C++ Libraries] #6794: boost-1.49.0 fails to build with gcc-4.6.2: boost/smart_ptr/intrusive_ptr.hpp:94:5: internal compiler error: Segmentation fault

Subject: [Boost-bugs] [Boost C++ Libraries] #6794: boost-1.49.0 fails to build with gcc-4.6.2: boost/smart_ptr/intrusive_ptr.hpp:94:5: internal compiler error: Segmentation fault
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-15 04:20:11


#6794: boost-1.49.0 fails to build with gcc-4.6.2:
boost/smart_ptr/intrusive_ptr.hpp:94:5: internal compiler error:
Segmentation fault
--------------------------------+-------------------------------------------
 Reporter: markus@… | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: Building Boost | Version: Boost 1.49.0
 Severity: Problem | Keywords:
--------------------------------+-------------------------------------------
 I believe this issue is specific to gcc-4.6.2, not with less than
 boost-1.49, and I have what I think is a fix. Here's the error:


 gcc.compile.c++ ../bin.v2/tools/quickbook/src/gcc-4.6/release/link-static
 /pch-off/id_manager.o

     "x86_64-pc-linux-gnu-g++" -ftemplate-depth-300 -O2 -pipe
 -march=amdfam10 -O3 -finline-functions -Wno-inline -Wall -g0
 -DBOOST_ALL_NO_LIB=1 -DBOOST_FILESYSTEM_NO_DEPRECATED
 -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I".." -c -o
 "../bin.v2/tools/quickbook/src/gcc-4.6/release/link-static/pch-
 off/id_manager.o" "quickbook/src/id_manager.cpp"

 In file included from ../boost/intrusive_ptr.hpp:16:0,
                  from quickbook/src/fwd.hpp:15,
                  from quickbook/src/values.hpp:20,
                  from quickbook/src/id_manager.hpp:14,
                  from quickbook/src/id_manager.cpp:9:
 ../boost/smart_ptr/intrusive_ptr.hpp: In destructor
 â€˜boost::intrusive_ptr<T>::~intrusive_ptr() [with T =
 quickbook::file_info]’:
 ../boost/smart_ptr/intrusive_ptr.hpp:94:5: internal compiler error:
 Segmentation fault


 You can find a full build log and preprocessed id_manager.cpp at
 <https://bugs.gentoo.org/show_bug.cgi?id=411691>. Basically I noticed that
 if I changed the optimization level to -O[01s] or if I removed -DNDEBUG
 (enabling assertions), it built without error. I came up with both an
 arbitrary patch, and one that I think makes sense (but itself could be
 arbitrary since I don't fully understand what the problem is):


 --- boost_1_49_0/tools/quickbook/src/intrusive_base.hpp.orig 2012-04-14
 00:26:49.360818878 -0700
 +++ boost_1_49_0/tools/quickbook/src/intrusive_base.hpp 2012-04-14
 00:27:10.214279871 -0700
 @@ -21,7 +21,7 @@
          intrusive_base() : ref_count_(0) {}
          intrusive_base(intrusive_base const&) : ref_count_(0) {}
          intrusive_base& operator=(intrusive_base const&) { return *this;
 }
 - ~intrusive_base() { assert(!ref_count_); }
 + virtual ~intrusive_base() { assert(!ref_count_); }

          friend void intrusive_ptr_add_ref(T* ptr)
              { ++ptr->ref_count_; }


 Usually base classes need a virtual destructor, though not if you know the
 actual type of the object when it's destroyed. Anyway, it works now.

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