Hello,
I’m using VS2013 with tango 9.2.2
The test steps are;
- Using Pogo, add one dynamic attribute to TangoTest
- Rebuild and run (using Server_static project)
- At jive, create new device using server wizard
- Confirm that the new dynamic attribute exists
- Right click the device and “Restart device”
- Then the sever program clashs
The clash point is at TangoTestClass::erase_dynamic_attributes()
The call stack at the crash is
[quote] TangoTest.exe!_invoke_watson(const wchar_t * pszExpression, const wchar_t * pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned __int64 pReserved) Line 132 C++
TangoTest.exe!_invalid_parameter(const wchar_t * pszExpression, const wchar_t * pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned __int64 pReserved) Line 86 C++
TangoTest.exe!std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<Tango::Attribute * __ptr64> > >::operator–() Line 141 C++
TangoTest.exe!std::_Vector_iterator<std::_Vector_val<std::_Simple_types<Tango::Attribute * __ptr64> > >::operator–() Line 348 C++
TangoTest.exe!TangoTest_ns::TangoTestClass::erase_dynamic_attributes(const Tango::DevVarStringArray * devlist_ptr, std::vector<Tango::Attr *,std::allocator<Tango::Attr *> > & att_list) Line 2785 C++
TangoTest.exe!TangoTest_ns::TangoTestClass::device_factory(const Tango::DevVarStringArray * devlist_ptr) Line 950 C++
TangoTest.exe!Tango::DServer::restart(std::basic_string<char,std::char_traits,std::allocator > & d_name) Line 943 C++
TangoTest.exe!Tango::DevRestartCmd::execute(Tango::DeviceImpl * device, const CORBA::Any & in_any) Line 112 C++
TangoTest.exe!Tango::DeviceClass::command_handler(Tango::DeviceImpl * device, std::basic_string<char,std::char_traits,std::allocator > & command, const CORBA::Any & in_any) Line 1172 C++
TangoTest.exe!Tango::DeviceImpl::command_inout(const char * in_cmd, const CORBA::Any & in_any) Line 1442 C++
TangoTest.exe!Tango::Device_2Impl::command_inout_2(const char * in_cmd, const CORBA::Any & in_data, Tango::DevSource source) Line 440 C++
TangoTest.exe!Tango::Device_4Impl::command_inout_4(const char * in_cmd, const CORBA::Any & in_data, Tango::DevSource source, const Tango::ClntIdent & cl_id) Line 477 C++
TangoTest.exe!_0RL_lcfn_6fe2f94a21a10053_a3000000(omniCallDescriptor * cd, omniServant * svnt) Line 5377 C++
TangoTest.exe!omniCallDescriptor::doLocalCall(omniServant * servant) Line 146 C++
TangoTest.exe!omniCallHandle::upcall(omniServant * servant, omniCallDescriptor & desc) Line 125 C++
TangoTest.exe!Tango::_impl_Device_4::_dispatch(omniCallHandle & _handle) Line 5953 C++
TangoTest.exe!Tango::_impl_Device_5::_dispatch(omniCallHandle & _handle) Line 7478 C++
TangoTest.exe!omni::omniOrbPOA::dispatch(omniCallHandle & handle, omniLocalIdentity * id) Line 1712 C++
TangoTest.exe!omniLocalIdentity::dispatch(omniCallHandle & handle) Line 182 C++
TangoTest.exe!omni::GIOP_S::handleRequest() Line 246 C++
TangoTest.exe!omni::GIOP_S::dispatcher() Line 155 C++
TangoTest.exe!omni::giopWorker::execute() Line 79 C++
TangoTest.exe!omniAsyncWorker::real_run() Line 580 C++
TangoTest.exe!omniServerWorkerInfo::run() Line 685 C++
TangoTest.exe!omniAsyncPoolServer::workerRun(omniAsyncWorker * worker) Line 331 C++
TangoTest.exe!omniAsyncWorker::mid_run() Line 516 C++
TangoTest.exe!omniAsyncWorkerInfo::run() Line 665 C++
TangoTest.exe!Tango::create_PyPerThData(omni::omniInterceptors::createThread_T::info_T & info) Line 3236 C++
TangoTest.exe!omniAsyncWorkerInfo::run() Line 663 C++
TangoTest.exe!omniAsyncWorker::run(void * __formal) Line 129 C++
TangoTest.exe!omni_thread_wrapper(void * ptr) Line 502 C++
[/quote]
The newly added code by pogo is just belows with one additional file (TangoTestDynAttrUtils.cpp - refer to attached file)
at TangoTest.h
// Dynamic attribute methods
public:
/**
* Attribute low_double_scalar_rw related methods
* Description:
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_low_double_scalar_rw(Tango::Attribute &attr);
virtual void write_low_double_scalar_rw(Tango::WAttribute &attr);
virtual bool is_low_double_scalar_rw_allowed(Tango::AttReqType type);
void add_low_double_scalar_rw_dynamic_attribute(string attname);
void remove_low_double_scalar_rw_dynamic_attribute(string attname);
Tango::DevDouble *get_low_double_scalar_rw_data_ptr(string &name);
map<string,Tango::DevDouble> low_double_scalar_rw_data;
At TangoTest.cpp
void TangoTest::add_dynamic_attributes()
{
// Example to add dynamic attribute:
// Copy inside the following protected area to create instance(s) at startup.
// add_low_double_scalar_rw_dynamic_attribute("Mylow_double_scalar_rwAttribute");
/*----- PROTECTED REGION ID(TangoTest::add_dynamic_attributes) ENABLED START -----*/
// Add your own code to create and add dynamic attributes if any
add_low_double_scalar_rw_dynamic_attribute("Mylow_double_scalar_rwAttribute");
/*----- PROTECTED REGION END -----*/ // TangoTest::add_dynamic_attributes
}
Any idea why?