[C++-sig] Segfault when passing pointer from C++ to Python via Boost Python

Alex K arbitraryvalue at gmail.com
Fri Sep 6 18:51:47 CEST 2013


Hello all,


I am having issues passing pointers from C++ to python, as I describe here:

http://stackoverflow.com/questions/18646694/pass-pointer-from-c-to-python-w-boost-python

In short, even the example of "Raw C++ pointers" from here:

https://wiki.python.org/moin/boost.python/PointersAndSmartPointers

causes a segfault when I compile and run it, although I can use other
features of Boost Python successfully.  The crash appears to be a segfault
from invoke.hpp, in this function:

template <class RC, class F BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class AC)>
inline PyObject* invoke(invoke_tag_<false,false>, RC const& rc, F& f
BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(1, N, AC, & ac) )
{
    return rc(f( BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, ac, ()
BOOST_PP_INTERCEPT) ));
}

Does anyone have any suggestions?


Thanks,

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20130906/218ae717/attachment.html>


More information about the Cplusplus-sig mailing list