[C++-sig] Re: SIGSEGV on extract_pointer

David Abrahams dave at boost-consulting.com
Fri Oct 1 01:27:40 CEST 2004


Itamar Shtull-Trauring <itamar at itamarst.org> writes:

> Platform: Redhat 7.3 on x86, gcc 2.96 (yes, it's horrible and ancient),
> boost 1.31.
>
> I have some code that looks like this:
>
>     extract<Twisted::DatagramProtocol*> pchecker(self.attr("protocol"));
>     if (pchecker.check()) {
> 	this->protocol = pchecker();
>
> When running this it gets a SIGSEGV:
>
> 0x401eccb5 in boost::python::converter::get_lvalue_from_python () from
> /usr/local/lib/libboost_python-gcc-mt-1_31.so.1.31.0
> (gdb) up
> #1  0x4027bcf2 in
> boost::python::converter::extract_pointer<Twisted::DatagramProtocol
> *>::extract_pointer (this=0xbfffda68, obj=0x87666ac)
>     at /usr/local/include/boost-1_31/boost/python/extract.hpp:203
>
> The code in question being:
>
>   template <class Ptr>
>   inline extract_pointer<Ptr>::extract_pointer(PyObject* obj)
>       : m_source(obj)
>       , m_result(
>           obj == Py_None ? 0 : (get_lvalue_from_python)(obj,
> registered_pointee<Ptr>::converters)
>           )
>   {
>   }
>
> Here's the fun part - it does NOT crash when I compile with -fno-inline.
> My code is perfectly valid, AFAICT - there is a protocol attribute there
> and it is of the right type.
>
> This is part of my C++/Twisted integration project.

Okay... what is your goal in reporting this here?  It is a GCC 2.96
bug, right?  Can you come up with something that inhibits it?
Otherwise, I'm not sure what to do for you.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com




More information about the Cplusplus-sig mailing list