From 3146d41ca73f1841aa76c8b814636c77b606c670 Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Thu, 31 Mar 2011 13:28:49 +0200 Subject: [PATCH] fix segfault for BZDNG-242 The cause for this is actually a bug in Boost.Python that triggers when arg("arg")... is used in the export and the number of arg("") arguments doesn't match the number of argument of the function. When one then uses a wrong kwarg, the program crashes. I'll submit a bug report to the Boost.Python on this issue. I fear that there are many more cases in the pymod export where we are using arg("") as we did for the query. --- modules/mol/base/pymod/export_entity.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mol/base/pymod/export_entity.cc b/modules/mol/base/pymod/export_entity.cc index 34a8adcf8..163918c75 100644 --- a/modules/mol/base/pymod/export_entity.cc +++ b/modules/mol/base/pymod/export_entity.cc @@ -81,8 +81,8 @@ void export_Entity() generic_prop_def<EntityBase>(ent_base); class_<EntityHandle, bases<EntityBase> >("EntityHandle", init<>()) - .def("Select",select_query, arg("flags")=0) - .def("Select",select_string, arg("flags")=0) + .def("Select",select_query, (arg("query"), arg("flags")=0)) + .def("Select",select_string, (arg("query"), arg("flags")=0)) .def("FindChain", &EntityHandle::FindChain) .def("FindResidue", &EntityHandle::FindResidue) .def("FindAtom", &EntityHandle::FindAtom) -- GitLab