使用pybind11在C ++中嵌入python代码时出现恐慌

时间:2018-11-05 20:01:15

标签: pybind11

我有一个问题,当我从C ++进行python调用时,代码会出现紧急情况。 我要实现的所有目的都是通过引用传递,以便c ++代码进行内存分配,而被调用方python api只是通过引用传递结果。 完整的代码描述在 https://github.com/pybind/pybind11/issues/1557

我莫名其妙地陷入了无法解决的恐慌之中。

#0 0x00007ffff57845f7 in raise () from /lib64/libc.so.6

#1 0x00007ffff5785ce8 in abort () from /lib64/libc.so.6

#2 0x00007ffff60889d5 in __gnu_cxx::__verbose_terminate_handler() () from /lib64/libstdc++.so.6

#3 0x00007ffff6086946 in ?? () from /lib64/libstdc++.so.6

#4 0x00007ffff6086973 in std::terminate() () from /lib64/libstdc++.so.6

#5 0x00007ffff6086b93 in _cxa_throw () from /lib64/libstdc++.so.6

#6 0x00000000008f32a3 in pybind11::detail::simple_collector<(pybind11::return_value_policy)1>::call (this=0x7fffef9b4950, ptr=0xdbe690) at ../../../common/pybind11/cast.h:1943

#7 0x00000000008f00ee in pybind11::detail::object_api<pybind11::detail::accessorpybind11::detail::accessor_policies::str_attr >::operator()<(pybind11::return_value_policy)1, tplatEndpointInfo*&> (this=0x7fffef9b4990) at ../../../common/pybind11/cast.h:2096

#8 0x00000000008d97c2 in tplatPyWrapper::connect (this=0x7fffcc01b6c0) at tplat_py_wrapper.cc:130

0 个答案:

没有答案