problems with reading and writing properties

Hi everyone,

I've made a basic component in Orocos (toolchain 2.2) with 1 property:
an eigen_matrix with the name Cf.
I'm using a typekit (see attachement). (with composeTypeImpl and
decomposeTypeImpl)
When I want to read/write my property to a cpf file, I encounter
following strange things (errorlog in attachment for more details):

*marshalling.writeProperty("Cf","nickstestjes.cpf")
**If nickstestjes.cpf doesn't exist yet =>It works
**If it exists=> ERROR: updateProperties ...

*marshalling.writeProperties("nickstestjes.cpf")
**If nickstestjes.cpf doesn't exist yet => ERROR: ...
**If it exists=> segmentation fault

*marshalling.readProperty("Cf","nickstestjes.cpf")
**If nickstestjes.cpf exists => calls decompose ?!, no error, but
doesn't work

*marshalling.readProperties("nickstestjes.cpf")
**If nickstestjes.cpf exist => it works

Thanks for looking in to this!

NIck

AttachmentSize
eigen_toolkit.cpp10.51 KB
eigen_toolkit.hpp1.38 KB
errorlog.txt5.74 KB

problems with reading and writing properties

On 01/05/2011 11:52 AM, Ruben Smits wrote:
> On Wednesday 05 January 2011 11:37:02 Dominick Vanthienen wrote:
>> Hi everyone,
>>
>> I've made a basic component in Orocos (toolchain 2.2) with 1 property:
>> an eigen_matrix with the name Cf.
>> I'm using a typekit (see attachement). (with composeTypeImpl and
>> decomposeTypeImpl)
>> When I want to read/write my property to a cpf file, I encounter
>> following strange things (errorlog in attachment for more details):
>>
>> *marshalling.writeProperty("Cf","nickstestjes.cpf")
>> **If nickstestjes.cpf doesn't exist yet =>It works
>> **If it exists=> ERROR: updateProperties ...
> Can you give the full error message please.
see attachment first mail (but for your convenience, I put it also below
this mail)
>> *marshalling.writeProperties("nickstestjes.cpf")
>> **If nickstestjes.cpf doesn't exist yet => ERROR: ...
> Is this the same error or a different one?
>
>> **If it exists=> segmentation fault
> Can you provide a backtrace?
sometimes it gives:
marshalling.writeProperties("nickstestjes.cpf")
255.205 [ Info ][PropertyLoader::save] test updating of file
nickstestjes.cpf
255.208 [ Info ][PropertyLoader::save] yes, I'm in decomposeTypeImpl
255.208 [ Info ][PropertyLoader::save] doing the loop, count = 0
255.208 [ Info ][PropertyLoader::save] doing the loop, count = 1
255.208 [ Info ][PropertyLoader::save] doing the loop, count = 2
255.208 [ Info ][PropertyLoader::save] doing the loop, count = 3
255.208 [ Info ][PropertyLoader::save] doing the loop, count = 4
255.208 [ Info ][PropertyLoader::save] doing the loop, count = 5
255.208 [ Info ][PropertyLoader::save] Writing all properties of test
to file nickstestjes.cpf
255.209 [ ERROR ][PropertyLoader::save] updateProperties: Could not
update, nor compose Property PropertyBag 1: type mismatch, can not
update with eigen_vector 1
255.210 [ Info ][PropertyLoader::save] Wrote nickstestjes.cpf
The command 'marshalling.writeProperties("nickstestjes.cpf")' caused a
std::exception: 'Bad DataSource assignment: incompatible types.' and
could not be completed.

but mostly it gives:
marshalling.writeProperties("nickstestjes.cpf")
367.869 [ Info ][PropertyLoader::save] test updating of file
nickstestjes.cpf
367.872 [ Info ][PropertyLoader::save] yes, I'm in decomposeTypeImpl
367.872 [ Info ][PropertyLoader::save] doing the loop, count = 0
367.872 [ Info ][PropertyLoader::save] doing the loop, count = 1
367.872 [ Info ][PropertyLoader::save] doing the loop, count = 2
367.872 [ Info ][PropertyLoader::save] doing the loop, count = 3
367.873 [ Info ][PropertyLoader::save] doing the loop, count = 4
367.873 [ Info ][PropertyLoader::save] doing the loop, count = 5
367.873 [ Info ][PropertyLoader::save] Writing all properties of test
to file nickstestjes.cpf
367.873 [ ERROR ][PropertyLoader::save] updateProperties: Could not
update, nor compose Property PropertyBag 1: type mismatch, can not
update with eigen_vector 1
367.874 [ Info ][PropertyLoader::save] Wrote nickstestjes.cpf

Program received signal SIGSEGV, Segmentation fault.
0xb7a81506 in __dynamic_cast () from /usr/lib/libstdc++.so.6
(gdb) bt
#0 0xb7a81506 in __dynamic_cast () from /usr/lib/libstdc++.so.6
#1 0xb7ec22ca in RTT::deletePropertyBag (target=...)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/rtt/rtt/PropertyBag.cpp:773
#2 0xb7ec22e5 in RTT::deletePropertyBag (target=...)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/rtt/rtt/PropertyBag.cpp:775
#3 0xb73a46f4 in RTT::marsh::PropertyLoader::save (this=0xbfffe91f,
filename=..., target=0x807f980, all=true)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/rtt/rtt/marsh/PropertyLoader.cpp:282
#4 0xb738b679 in RTT::marsh::MarshallingService::writeProperties
(this=0x8095de0, filename=...)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/rtt/rtt/marsh/MarshallingService.cpp:115
#5 0xb738e374 in call<RTT::marsh::MarshallingService* const,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const> (function_obj_ptr=..., a0=...) at
/usr/include/boost/bind/mem_fn_template.hpp:222
#6 operator()<RTT::marsh::MarshallingService*> (function_obj_ptr=...,
a0=...)
at /usr/include/boost/bind/mem_fn_template.hpp:232
#7 operator()<bool, boost::_mfi::cmf1<bool,
RTT::marsh::MarshallingService, const std::string&>,
boost::_bi::list1<const std::basic_string<char, std::char_traits<char>,
std::allocator<char> >&> > (function_obj_ptr=..., a0=...)
at /usr/include/boost/bind/bind.hpp:303
#8 operator()<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > (function_obj_ptr=...,
a0=...) at /usr/include/boost/bind/bind_template.hpp:47
#9
boost::detail::function::function_obj_invoker1<boost::_bi::bind_t<boost::_bi::unspecified,
boost::_mfi::cmf1<bool, RTT::marsh::MarshallingService, std::string
const&>,
boost::_bi::list2<boost::_bi::value<RTT::marsh::MarshallingService*>,
boost::arg<1> > >, bool, std::string const&>::invoke
(function_obj_ptr=..., a0=...)
at /usr/include/boost/function/function_template.hpp:132
#10 0xb7d57b62 in operator() (this=0x80c2a48, a1=...) at
/usr/include/boost/function/function_template.hpp:1013
#11 call_impl<std::string const&> (this=0x80c2a48, a1=...)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/rtt/install/include/rtt/internal/../internal/LocalOperationCaller.hpp:360
#12 RTT::internal::InvokerImpl<1, bool(const std::string&),
RTT::internal::LocalOperationCallerImpl<bool(const std::string&)>
>::call(const std::string&) (this=0x80c2a48, a1=...)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/rtt/install/include/rtt/internal/../inter---Type
<return> to continue, or q<return> to quit---
nal/Invoker.hpp:96
#13 0xb7ced3bc in call<bool (RTT::base::OperationCallerBase<bool(const
std::string&)>::*)(const std::string&)> (
f=&virtual table offset 8, s=...) at
/usr/include/boost/fusion/functional/invocation/invoke.hpp:279
#14 boost::fusion::invoke<bool
(RTT::base::OperationCallerBase<bool(const std::string&)>::*)(const
std::string&),
boost::fusion::cons<RTT::base::OperationCallerBase<bool(const
std::string&)>*, boost::fusion::cons<const std::string&,
boost::fusion::nil> > >(bool (RTT::base::OperationCallerBase<bool(const
std::string&)>::*)(RTT::base::OperationCallerBase<bool(const
std::string&)> *, const std::string&), const
boost::fusion::cons<RTT::base::OperationCallerBase<bool(const
std::string&)>*, boost::fusion::cons<const std::string&,
boost::fusion::nil> > &) (
f=&virtual table offset 8, s=...) at
/usr/include/boost/fusion/functional/invocation/invoke.hpp:178
#15 0xb7d162bd in operator()<bool,
RTT::internal::FusedMCallDataSource::evaluate::iret (*)(bool
(RTT::base::OperationCallerBase<bool(const std::string&)>::*)(const
std::string&), const
RTT::internal::FusedMCallDataSource<Signature>::evaluate() const [with
Signature = bool(const std::string&)]::arg_type&), boost::_bi::list0> (
this=0x80c2928) at /usr/include/boost/bind/bind.hpp:303
#16 operator() (this=0x80c2928) at
/usr/include/boost/bind/bind_template.hpp:20
#17 exec<boost::_bi::bind_t<bool,
RTT::internal::FusedMCallDataSource::evaluate::iret (*)(bool
(RTT::base::OperationCallerBase<bool(const std::string&)>::*)(const
std::string&), const
RTT::internal::FusedMCallDataSource<Signature>::evaluate() const [with
Signature = bool(const std::string&)]::arg_type&),
boost::_bi::list2<boost::_bi::value<bool
(RTT::internal::InvokerBaseImpl<1, bool(const std::string&)>::*)(const
std::string&)>,
boost::_bi::value<boost::fusion::cons<RTT::base::OperationCallerBase<bool(const
std::string&)>*, boost::fusion::cons<const std::string&,
boost::fusion::nil> > > > > > (this=0x80c2928)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/rtt/install/include/rtt/internal/BindStorage.hpp:121

#18 RTT::internal::FusedMCallDataSource<bool(const
std::string&)>::evaluate(void) const (this=0x80c2928)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/rtt/install/include/rtt/internal/FusedFunctorDataSource.hpp:298
#19 0xb7dd0817 in OCL::TaskBrowser::doPrint (this=0xbfffee2c, ds=...,
recurse=true)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/ocl/taskbrowser/TaskBrowser.cpp:1489
#20 0xb7dd13e5 in OCL::TaskBrowser::printResult (this=0xbfffee2c,
ds=0x80c2928, recurse=true)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/ocl/taskbrowser/TaskBrowser.cpp:1447
---Type<return> to continue, or q<return> to quit---
#21 0xb7dd2bcc in OCL::TaskBrowser::evalCommand (this=0xbfffee2c, comm=...)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/ocl/taskbrowser/TaskBrowser.cpp:1363
#22 0xb7de2dfa in OCL::TaskBrowser::loop (this=0xbfffee2c)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/ocl/taskbrowser/TaskBrowser.cpp:808
#23 0x08052892 in main (argc=<value optimized out>, argv=0xbffff224)
at
/home/u0065688/src/svn/robotics-ros/packages/orocos_toolchain_ros/ocl/bin/deployer.cpp:162

>> *marshalling.readProperty("Cf","nickstestjes.cpf")
>> **If nickstestjes.cpf exists => calls decompose ?!, no error, but
>> doesn't work
> Does it call decompose or not, you're not really clear here. How do you notice
> that it didn't work.
>
>> *marshalling.readProperties("nickstestjes.cpf")
>> **If nickstestjes.cpf exist => it works
>>
>> Thanks for looking in to this!
>>
>> NIck
> Ruben
Nick

Content of errorlog.txt:
---------------------------------
t [R]> marshalling.writeProperty("Cf","nickstestjes.cpf")
91.098 [ Info ][PropertyLoader::save] Creating nickstestjes.cpf
91.098 [ Info ][PropertyLoader::save] yes, I'm in decomposeTypeImpl
91.098 [ Info ][PropertyLoader::save] doing the loop, count = 0
91.098 [ Info ][PropertyLoader::save] doing the loop, count = 1
91.098 [ Info ][PropertyLoader::save] doing the loop, count = 2
91.099 [ Info ][PropertyLoader::save] doing the loop, count = 3
91.099 [ Info ][PropertyLoader::save] doing the loop, count = 4
91.099 [ Info ][PropertyLoader::save] doing the loop, count = 5
91.100 [ Info ][PropertyLoader::save] Wrote Property Cf to
nickstestjes.cpf
= true

test [R]> marshalling.writeProperty("Cf","nickstestjes.cpf")
107.389 [ Info ][PropertyLoader::save] Updating file nickstestjes.cpf
with properties of test
107.392 [ Info ][PropertyLoader::save] yes, I'm in decomposeTypeImpl
107.392 [ Info ][PropertyLoader::save] doing the loop, count = 0
107.392 [ Info ][PropertyLoader::save] doing the loop, count = 1
107.392 [ Info ][PropertyLoader::save] doing the loop, count = 2
107.392 [ Info ][PropertyLoader::save] doing the loop, count = 3
107.392 [ Info ][PropertyLoader::save] doing the loop, count = 4
107.392 [ Info ][PropertyLoader::save] doing the loop, count = 5
107.392 [ ERROR ][updateProperty] updateProperties: Could not update,
nor compose Property PropertyBag 1: type mismatch, can not update with
eigen_vector 1
107.392 [ ERROR ][updateProperty] Could not update nor compose Property
PropertyBag Cf: type mismatch, can not update with type PropertyBag
107.393 [ Info ][PropertyLoader::save] Wrote Property Cf to
nickstestjes.cpf
= true

test [R]> marshalling.writeProperties("nickstestjes.cpf")
179.993 [ Info ][PropertyLoader::save] Creating nickstestjes.cpf
179.993 [ Info ][PropertyLoader::save] yes, I'm in decomposeTypeImpl
179.993 [ Info ][PropertyLoader::save] doing the loop, count = 0
179.993 [ Info ][PropertyLoader::save] doing the loop, count = 1
179.993 [ Info ][PropertyLoader::save] doing the loop, count = 2
179.994 [ Info ][PropertyLoader::save] doing the loop, count = 3
179.994 [ Info ][PropertyLoader::save] doing the loop, count = 4
179.994 [ Info ][PropertyLoader::save] doing the loop, count = 5
179.994 [ Info ][PropertyLoader::save] Writing all properties of test
to file nickstestjes.cpf
179.994 [ Info ][PropertyLoader::save] yes, I'm in composeTypeImpl
179.994 [ ERROR ][PropertyLoader::save] Getting row 1
179.994 [ ERROR ][PropertyLoader::save] Can not initialize Property
from 1: incompatible type (eigen_vector).
179.994 [ ERROR ][PropertyLoader::save] Could not read row 1
179.994 [ ERROR ][PropertyLoader::save] Could not update properties of
file nickstestjes.cpf.
= false

test [R]> marshalling.writeProperty("Cf","nickstestjes.cpf")
189.574 [ Info ][PropertyLoader::save] Creating nickstestjes.cpf
189.574 [ Info ][PropertyLoader::save] yes, I'm in decomposeTypeImpl
189.574 [ Info ][PropertyLoader::save] doing the loop, count = 0
189.574 [ Info ][PropertyLoader::save] doing the loop, count = 1
189.574 [ Info ][PropertyLoader::save] doing the loop, count = 2
189.575 [ Info ][PropertyLoader::save] doing the loop, count = 3
189.575 [ Info ][PropertyLoader::save] doing the loop, count = 4
189.575 [ Info ][PropertyLoader::save] doing the loop, count = 5
189.576 [ Info ][PropertyLoader::save] Wrote Property Cf to
nickstestjes.cpf
= true

test [R]> marshalling.writeProperties("nickstestjes.cpf")
193.554 [ Info ][PropertyLoader::save] test updating of file
nickstestjes.cpf
193.556 [ Info ][PropertyLoader::save] yes, I'm in decomposeTypeImpl
193.557 [ Info ][PropertyLoader::save] doing the loop, count = 0
193.557 [ Info ][PropertyLoader::save] doing the loop, count = 1
193.557 [ Info ][PropertyLoader::save] doing the loop, count = 2
193.557 [ Info ][PropertyLoader::save] doing the loop, count = 3
193.557 [ Info ][PropertyLoader::save] doing the loop, count = 4
193.557 [ Info ][PropertyLoader::save] doing the loop, count = 5
193.557 [ Info ][PropertyLoader::save] Writing all properties of test
to file nickstestjes.cpf
193.557 [ ERROR ][PropertyLoader::save] updateProperties: Could not
update, nor compose Property PropertyBag 1: type mismatch, can not
update with eigen_vector 1
193.558 [ Info ][PropertyLoader::save] Wrote nickstestjes.cpf
/opt/ros/cturtle/ros/bin/rosrun: line 35: 6424 Segmentation fault
$exepath "$@"

test [R]> marshalling.readProperty("Cf","nickstestjes.cpf")
118.447 [ Info ][PropertyLoader:configure] Reading Property 'Cf' from
file 'nickstestjes.cpf'.
118.449 [ Info ][refreshProperty] yes, I'm in decomposeTypeImpl
118.449 [ Info ][refreshProperty] doing the loop, count = 0
118.450 [ Info ][refreshProperty] doing the loop, count = 1
118.450 [ Info ][refreshProperty] doing the loop, count = 2
118.450 [ Info ][refreshProperty] doing the loop, count = 3
118.450 [ Info ][refreshProperty] doing the loop, count = 4
118.450 [ Info ][refreshProperty] doing the loop, count = 5
= true

test [R]> marshalling.readProperties("nickstestjes.cpf")
164.440 [ Info ][PropertyLoader:configure] Configuring TaskContext
'test' with 'nickstestjes.cpf'.
164.443 [ Info ][refreshProperties] yes, I'm in composeTypeImpl
164.443 [ Info ][refreshProperties] Getting row 1
164.443 [ Info ][refreshProperties] Getting row 2
164.443 [ Info ][refreshProperties] Getting row 3
164.443 [ Info ][refreshProperties] Getting row 4
164.443 [ Info ][refreshProperties] Getting row 5
164.443 [ Info ][refreshProperties] Getting row 6
= true