Ticket #1305 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Get python working in MantidPlot debug build

Reported by: Russell Taylor Owned by: Martyn Gigg
Priority: minor Milestone: Iteration 24
Component: Keywords:
Cc: Blocked By:
Blocking: Tester: Janik Zikovsky

Description


Attachments

irs21360_graphite002_ipg.nxs (1.5 MB) - added by Michael Whitty 10 years ago.
step for reproducing bug

Change History

comment:1 Changed 10 years ago by Russell Taylor

  • Status changed from new to accepted

comment:2 Changed 10 years ago by Russell Taylor

(In [4822]) Replace boost_python debug libraries with ones linking to python debug build. Changes to PythonAPI project file to link everything correctly. Now python scripting works in my debug MantidPlot! (if I comment out a couple of lines in PyAlgorithmWrapper.cpp) Re #1305.

comment:3 Changed 10 years ago by Russell Taylor

  • Status changed from accepted to assigned
  • Owner changed from Russell Taylor to Martyn Gigg
  • Priority changed from major to minor
  • Milestone changed from Iteration 23 to Iteration 24

Works so long as you don't have any python algorithms being picked up (in which case it crashes on start-up).

Here's the stack trace. Note that the kill() method also calls Py_DECREF.

MantidPythonAPI_d.pyd!Mantid::PythonAPI::PyAlgorithmCallback::~PyAlgorithmCallback() Line 36 C++ MantidPythonAPI_d.pyd!Mantid::PythonAPI::PyAlgorithmCallback::`vbase destructor'() + 0x15 bytes C++ MantidPythonAPI_d.pyd!Mantid::PythonAPI::PyAlgorithmCallback::`scalar deleting destructor'() + 0x15 bytes C++ MantidPythonAPI_d.pyd!boost::checked_delete<Mantid::PythonAPI::PyAlgorithmCallback>(Mantid::PythonAPI::PyAlgorithmCallback * x=0x0df3ed50) Line 34 + 0x3a bytes C++ MantidPythonAPI_d.pyd!boost::detail::sp_counted_impl_p<Mantid::PythonAPI::PyAlgorithmCallback>::dispose() Line 78 + 0xc bytes C++ MantidPythonAPI_d.pyd!boost::detail::sp_counted_base::release() Line 103 C++ MantidPythonAPI_d.pyd!boost::detail::shared_count::~shared_count() Line 221 C++ MantidPythonAPI_d.pyd!boost::shared_ptr<Mantid::PythonAPI::PyAlgorithmCallback>::~shared_ptr<Mantid::PythonAPI::PyAlgorithmCallback>() + 0x12 bytes C++ MantidPythonAPI_d.pyd!boost::python::objects::pointer_holder_back_reference<boost::shared_ptr<Mantid::PythonAPI::PyAlgorithmCallback>,Mantid::PythonAPI::PyAlgorithmBase>::~pointer_holder_back_reference<boost::shared_ptr<Mantid::PythonAPI::PyAlgorithmCallback>,Mantid::PythonAPI::PyAlgorithmBase>() + 0x38 bytes C++ MantidPythonAPI_d.pyd!boost::python::objects::pointer_holder_back_reference<boost::shared_ptr<Mantid::PythonAPI::PyAlgorithmCallback>,Mantid::PythonAPI::PyAlgorithmBase>::`scalar deleting destructor'() + 0xf bytes C++ boost_python-vc80-mt-gyd-1_43.dll!instance_dealloc(_object * inst=0x10caefb0) Line 336 C++ python25_d.dll!subtype_dealloc(_object * self=0x10caefb0) Line 709 + 0x9 bytes C python25_d.dll!_Py_Dealloc(_object * op=0x10caefb0) Line 1938 + 0x9 bytes C

MantidPythonAPI_d.pyd!Mantid::PythonAPI::PyAlgorithmCallback::kill() Line 256 + 0x7a bytes C++

MantidAPI.dll!std::mem_fun_t<void,Mantid::API::CloneableAlgorithm>::operator()(Mantid::API::CloneableAlgorithm * _Pleft=0x0df3ed50) Line 496 C++ MantidAPI.dll!boost::detail::sp_counted_impl_pd<Mantid::API::CloneableAlgorithm *,std::mem_fun_t<void,Mantid::API::CloneableAlgorithm> >::dispose() Line 145 C++ MantidAPI.dll!boost::detail::sp_counted_base::release() Line 103 C++ MantidAPI.dll!boost::detail::shared_count::~shared_count() Line 221 C++ MantidAPI.dll!boost::shared_ptr<Mantid::API::IAlgorithm>::~shared_ptr<Mantid::API::IAlgorithm>() + 0x12 bytes C++ MantidAPI.dll!Mantid::API::AlgorithmFactoryImpl::getDescriptors() Line 136 + 0xf bytes C++ MantidPlot.exe!AlgorithmDockWidget::update() Line 903 + 0x12 bytes C++ MantidPlot.exe!AlgorithmDockWidget::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=0, void * * _a=0x0012818c) Line 258 + 0x8 bytes C++ QtCored4.dll!QMetaObject::activate(QObject * sender=0x0de0b738, int from_signal_index=10, int to_signal_index=10, void * * argv=0x00000000) Line 3001 + 0x2b bytes C++ QtCored4.dll!QMetaObject::activate(QObject * sender=0x0de0b738, const QMetaObject * m=0x00e7d218, int local_signal_index=6, void * * argv=0x00000000) Line 3071 + 0x15 bytes C++ MantidPlot.exe!MantidUI::algorithms_updated() Line 342 + 0x13 bytes C++ MantidPlot.exe!MantidUI::handleAlgorithmFactoryUpdates(const Poco::AutoPtr<Mantid::Kernel::DynamicFactory<Mantid::API::Algorithm>::UpdateNotification> & formal={...}) Line 1207 C++ MantidPlot.exe!Poco::NObserver<MantidUI,Mantid::Kernel::DynamicFactory<Mantid::API::Algorithm>::UpdateNotification>::notify(Poco::Notification * pNf=0x10cf4fa0) Line 105 C++ PocoFoundationd.dll!Poco::NotificationCenter::postNotification(Poco::Notification * pNotification=0x10cf4fa0) Line 95 + 0x29 bytes C++ MantidAPI.dll!Mantid::API::AlgorithmFactoryImpl::storeCloneableAlgorithm(Mantid::API::CloneableAlgorithm * algorithm=0x10cbe820) Line 188 C++ MantidPythonAPI_d.pyd!Mantid::PythonAPI::FrameworkManagerProxy::registerPyAlgorithm(boost::python::api::object pyobj={...}) Line 312 + 0x12 bytes C++ MantidPythonAPI_d.pyd!boost::python::detail::invoke<int,void (thiscall Mantid::PythonAPI::FrameworkManagerProxy::*)(boost::python::api::object),boost::python::arg_from_python<Mantid::PythonAPI::FrameworkManagerProxy &>,boost::python::arg_from_python<boost::python::api::object> >(boost::python::detail::invoke_tag_<1,1> formal={...}, boost::python::detail::invoke_tag_<1,1> formal={...}, void (boost::python::api::object)* & f=0x0fa32ba8, boost::python::arg_from_python<Mantid::PythonAPI::FrameworkManagerProxy &> & tc={...}, boost::python::arg_from_python<boost::python::api::object> & ac0={...}) Line 95 C++ MantidPythonAPI_d.pyd!boost::python::detail::caller_arity<2>::impl<void (thiscall Mantid::PythonAPI::FrameworkManagerProxy::*)(boost::python::api::object),boost::python::default_call_policies,boost::mpl::vector3<void,Mantid::PythonAPI::FrameworkManagerProxy &,boost::python::api::object> >::operator()(_object * args_=0x10c839b8, _object * formal=0x00000000) Line 223 + 0x31 bytes C++ MantidPythonAPI_d.pyd!boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (__thiscall Mantid::PythonAPI::FrameworkManagerProxy::*)(boost::python::api::object),boost::python::default_call_policies,boost::mpl::vector3<void,Mantid::PythonAPI::FrameworkManagerProxy &,boost::python::api::object> > >::operator()(_object * args=0x10c839b8, _object * kw=0x00000000) Line 39 C++ boost_python-vc80-mt-gyd-1_43.dll!boost::python::objects::py_function::operator()(_object * args=0x10c839b8, _object * kw=0x00000000) Line 144 C++ boost_python-vc80-mt-gyd-1_43.dll!boost::python::objects::function::call(_object * args=0x10c839b8, _object * keywords=0x00000000) Line 226 + 0x24 bytes C++ boost_python-vc80-mt-gyd-1_43.dll!boost::python::objects::`anonymous namespace'::bind_return::operator()() Line 585 + 0x19 bytes C++ boost_python-vc80-mt-gyd-1_43.dll!boost::detail::function::void_function_ref_invoker0<boost::python::objects::`anonymous namespace'::bind_return,void>::invoke(boost::detail::function::function_buffer & function_obj_ptr={...}) Line 189 C++ boost_python-vc80-mt-gyd-1_43.dll!boost::function0<void>::operator()() Line 1013 + 0x14 bytes C++ boost_python-vc80-mt-gyd-1_43.dll!boost::python::handle_exception_impl(boost::function0<void> f={...}) Line 26 C++ boost_python-vc80-mt-gyd-1_43.dll!boost::python::handle_exception<boost::python::objects::`anonymous namespace'::bind_return>(boost::python::objects::`anonymous-namespace'::bind_return f={...}) Line 29 + 0x2c bytes C++ boost_python-vc80-mt-gyd-1_43.dll!function_call(_object * func=0x10cd3170, _object * args=0x10c839b8, _object * kw=0x00000000) Line 626 + 0x38 bytes C++ python25_d.dll!PyObject_Call(_object * func=0x10cd3170, _object * arg=0x10c839b8, _object * kw=0x00000000) Line 1861 + 0x11 bytes C python25_d.dll!do_call(_object * func=0x10cd3170, _object * * * pp_stack=0x00129124, int na=2, int nk=0) Line 3823 + 0x11 bytes C python25_d.dll!call_function(_object * * * pp_stack=0x00129124, int oparg=1) Line 3635 + 0x15 bytes C python25_d.dll!PyEval_EvalFrameEx(_frame * f=0x10cec620, int throwflag=0) Line 2304 + 0x10 bytes C python25_d.dll!fast_function(_object * func=0x10cafd48, _object * * * pp_stack=0x00129c0c, int n=2, int na=2, int nk=0) Line 3698 + 0xb bytes C python25_d.dll!call_function(_object * * * pp_stack=0x00129c0c, int oparg=1) Line 3633 + 0x19 bytes C python25_d.dll!PyEval_EvalFrameEx(_frame * f=0x10ce8ad0, int throwflag=0) Line 2304 + 0x10 bytes C python25_d.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x10c97f28, _object * globals=0x10cfe230, _object * locals=0x10cfe230, _object * * args=0x00000000, int argcount=0, _object * * kws=0x00000000, int kwcount=0, _object * * defs=0x00000000, int defcount=0, _object * closure=0x00000000) Line 2875 + 0xb bytes C python25_d.dll!PyEval_EvalCode(PyCodeObject * co=0x10c97f28, _object * globals=0x10cfe230, _object * locals=0x10cfe230) Line 519 + 0x1f bytes C python25_d.dll!PyImport_ExecCodeModuleEx(char * name=0x0012aac0, _object * co=0x10c97f28, char * pathname=0x0012a40c) Line 675 + 0x11 bytes C python25_d.dll!load_source_module(char * name=0x0012aac0, char * pathname=0x0012a40c, _iobuf * fp=0x10310c30) Line 959 + 0x14 bytes C python25_d.dll!load_module(char * name=0x0012aac0, _iobuf * fp=0x10310c30, char * buf=0x0012a740, int type=1, _object * loader=0x00000000) Line 1749 + 0x11 bytes C python25_d.dll!import_submodule(_object * mod=0x04ad6c50, char * subname=0x0012aac0, char * fullname=0x0012aac0) Line 2400 + 0x25 bytes C python25_d.dll!load_next(_object * mod=0x04ad6c50, _object * altmod=0x04ad6c50, char * * p_name=0x0012abd4, char * buf=0x0012aac0, int * p_buflen=0x0012aab4) Line 2220 + 0x11 bytes C python25_d.dll!import_module_level(char * name=0x00000000, _object * globals=0x04ad6c50, _object * locals=0x04ad6c50, _object * fromlist=0x10ca48f8, int level=-1) Line 2001 + 0x23 bytes C python25_d.dll!PyImport_ImportModuleLevel(char * name=0x10cabf24, _object * globals=0x04ad6c50, _object * locals=0x04ad6c50, _object * fromlist=0x10ca48f8, int level=-1) Line 2072 + 0x19 bytes C python25_d.dll!builtin_import(_object * self=0x00000000, _object * args=0x10caece0, _object * kwds=0x00000000) Line 48 + 0x19 bytes C python25_d.dll!PyCFunction_Call(_object * func=0x0df4e478, _object * arg=0x10caece0, _object * kw=0x00000000) Line 77 + 0x11 bytes C python25_d.dll!PyObject_Call(_object * func=0x0df4e478, _object * arg=0x10caece0, _object * kw=0x00000000) Line 1861 + 0x11 bytes C python25_d.dll!PyEval_CallObjectWithKeywords(_object * func=0x0df4e478, _object * arg=0x10caece0, _object * kw=0x00000000) Line 3481 + 0x11 bytes C python25_d.dll!builtin_apply(_object * self=0x00000000, _object * args=0x10c83938) Line 169 + 0x11 bytes C python25_d.dll!PyCFunction_Call(_object * func=0x0df4e5b8, _object * arg=0x10c83938, _object * kw=0x00000000) Line 73 + 0xd bytes C python25_d.dll!call_function(_object * * * pp_stack=0x0012ba0c, int oparg=2) Line 3612 + 0x139 bytes C python25_d.dll!PyEval_EvalFrameEx(_frame * f=0x10ce7f78, int throwflag=0) Line 2304 + 0x10 bytes C python25_d.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x10c8f328, _object * globals=0x10c7d620, _object * locals=0x00000000, _object * * args=0x10cb8a50, int argcount=2, _object * * kws=0x10cb8a58, int kwcount=0, _object * * defs=0x10cae5a4, int defcount=4, _object * closure=0x00000000) Line 2875 + 0xb bytes C python25_d.dll!fast_function(_object * func=0x10cfc2f8, _object * * * pp_stack=0x0012c77c, int n=2, int na=2, int nk=0) Line 3711 + 0x44 bytes C python25_d.dll!call_function(_object * * * pp_stack=0x0012c77c, int oparg=1) Line 3633 + 0x19 bytes C python25_d.dll!PyEval_EvalFrameEx(_frame * f=0x10cb88e8, int throwflag=0) Line 2304 + 0x10 bytes C python25_d.dll!fast_function(_object * func=0x10cafe50, _object * * * pp_stack=0x0012d264, int n=3, int na=3, int nk=0) Line 3698 + 0xb bytes C python25_d.dll!call_function(_object * * * pp_stack=0x0012d264, int oparg=2) Line 3633 + 0x19 bytes C python25_d.dll!PyEval_EvalFrameEx(_frame * f=0x10ce7058, int throwflag=0) Line 2304 + 0x10 bytes C python25_d.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x10c95ce8, _object * globals=0x10c7d620, _object * locals=0x00000000, _object * * args=0x10d3bfc8, int argcount=1, _object * * kws=0x10d3bfcc, int kwcount=0, _object * * defs=0x10cab97c, int defcount=1, _object * closure=0x00000000) Line 2875 + 0xb bytes C python25_d.dll!fast_function(_object * func=0x10cafdf8, _object * * * pp_stack=0x0012dfd4, int n=1, int na=1, int nk=0) Line 3711 + 0x44 bytes C python25_d.dll!call_function(_object * * * pp_stack=0x0012dfd4, int oparg=0) Line 3633 + 0x19 bytes C python25_d.dll!PyEval_EvalFrameEx(_frame * f=0x10d3be80, int throwflag=0) Line 2304 + 0x10 bytes C python25_d.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x10c95c28, _object * globals=0x10c7d620, _object * locals=0x00000000, _object * * args=0x0e190e60, int argcount=1, _object * * kws=0x0e190e64, int kwcount=1, _object * * defs=0x10cab944, int defcount=1, _object * closure=0x00000000) Line 2875 + 0xb bytes C python25_d.dll!fast_function(_object * func=0x10cafda0, _object * * * pp_stack=0x0012ed44, int n=3, int na=1, int nk=1) Line 3711 + 0x44 bytes C python25_d.dll!call_function(_object * * * pp_stack=0x0012ed44, int oparg=256) Line 3633 + 0x19 bytes C python25_d.dll!PyEval_EvalFrameEx(_frame * f=0x0e190d20, int throwflag=0) Line 2304 + 0x10 bytes C python25_d.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x10c8a148, _object * globals=0x0df650e0, _object * locals=0x0df650e0, _object * * args=0x00000000, int argcount=0, _object * * kws=0x00000000, int kwcount=0, _object * * defs=0x00000000, int defcount=0, _object * closure=0x00000000) Line 2875 + 0xb bytes C python25_d.dll!PyEval_EvalCode(PyCodeObject * co=0x10c8a148, _object * globals=0x0df650e0, _object * locals=0x0df650e0) Line 519 + 0x1f bytes C python25_d.dll!run_mod(_mod * mod=0x10cb1d70, const char * filename=0x049ccc1c, _object * globals=0x0df650e0, _object * locals=0x0df650e0, PyCompilerFlags * flags=0x00000000, _arena * arena=0x0df15238) Line 1273 + 0x11 bytes C python25_d.dll!PyRun_StringFlags(const char * str=0x10cb6088, int start=257, _object * globals=0x0df650e0, _object * locals=0x0df650e0, PyCompilerFlags * flags=0x00000000) Line 1236 + 0x1e bytes C python25_d.dll!PyRun_SimpleStringFlags(const char * command=0x10cb6088, PyCompilerFlags * flags=0x00000000) Line 900 + 0x1a bytes C MantidPlot.exe!PythonScripting::loadInitFile(const QString & filename={...}) Line 344 + 0x12 bytes C++ MantidPlot.exe!PythonScripting::start() Line 178 + 0xf8 bytes C++ MantidPlot.exe!ScriptingEnv::initialize() Line 63 + 0xd bytes C++ MantidPlot.exe!ApplicationWindow::setScriptingLanguage(const QString & lang={...}) Line 4353 + 0x8 bytes C++ MantidPlot.exe!ApplicationWindow::init(bool factorySettings=false) Line 384 C++ MantidPlot.exe!ApplicationWindow::ApplicationWindow(bool factorySettings=false) Line 200 C++ MantidPlot.exe!main(int argc=1, char * * argv=0x0d6ce370) Line 168 + 0x3b bytes C++ MantidPlot.exe__tmainCRTStartup() Line 586 + 0x19 bytes C MantidPlot.exe!mainCRTStartup() Line 403 C kernel32.dll!_BaseProcessStart@4() + 0x23 bytes

comment:4 Changed 10 years ago by Martyn Gigg

(In [4959]) Fix issues with MantidPlot crashing in debug mode when running Python code that raises an exception. Re #1305

comment:5 Changed 10 years ago by Martyn Gigg

  • Status changed from assigned to testing
  • Resolution set to fixed

comment:6 Changed 10 years ago by Nick Draper

  • Status changed from testing to verify

Moved to verify state

Changed 10 years ago by Michael Whitty

step for reproducing bug

comment:7 Changed 10 years ago by Michael Whitty

MantidPlot Debug causes an unhandled exception due to:

Fatal Python error: PyThreadState_Get: no current thread

Where no such error occurs in release.

Reproduction steps:

Custom Interface->indirectAnalysis, elwin tab, insert file given above and -0.1, 0.1 in input boxs then click run.

comment:8 Changed 10 years ago by Janik Zikovsky

  • Status changed from verify to verifying
  • Tester set to Janik Zikovsky

comment:9 Changed 10 years ago by Janik Zikovsky

  • Status changed from verifying to closed

I've been able to run Python algorithms in a debug MantidPlot under Ubuntu. Pyhon scripting works too. Elwin does not run to completion, but RebinSuggest (for example) runs fine; so this is not a general Python in MantidPlot debug problem. Perhaps a ticket for Elwin should be made.

comment:10 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2152

Note: See TracTickets for help on using tickets.