[Boost-bugs] [Boost C++ Libraries] #6895: Segfault when using derived classed and compiling with GCC 4.7.0

Subject: [Boost-bugs] [Boost C++ Libraries] #6895: Segfault when using derived classed and compiling with GCC 4.7.0
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-14 07:48:30


#6895: Segfault when using derived classed and compiling with GCC 4.7.0
-------------------------------------------------+--------------------------
 Reporter: Maciej Dems <maciej.dems@…> | Owner: rwgk
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: Python
  Version: Boost 1.49.0 | Severity: Showstopper
 Keywords: |
-------------------------------------------------+--------------------------
 In a typical situation of exporting derived virtual class to Python and
 calling overridden virtual function Boost Python yields segfault if the
 following conditions are met:

 * the code is compiled with GCC 4.7.0 (for 4.6.x everything is fine)

 * C++0x standard is turned on (-std=c++0x is set)

 * one declares Boost shared_ptr to store objects in Python wrapper
   i.e.: class_< A, shared_ptr<A> >

 In the attachment I include the problematic file. To reproduce the error
 it has to be compiled as (Python version does not matter):

 g++-4.7 -g -std=c++0x -fPIC -shared -lboost_python-py26 -lpython2.6
 -I/usr/include/python2.6 -o boosterror.so boosterror.cpp

 In Python the following code causes segfault:

 import boosterror
 b = boosterror.B()
 b.f() # segfault here

 I don't know whether it is a Boost or a GCC bug. However, in the latter
 case, the direct cause of the problem should be identified to submit bug
 to GCC and the workaround for GCC 4.7.0 must be implemented in Boost.

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