Segmentation fault when running RTT exercise 3

Hi,

I am new to orocos and doing the RTT exercises (from
http://www.orocos.org/stable/examples/rtt/tutorial/rtt-exercises-1.10.0....).
When I try to run "helloworld" from hello-3-dataports (on Ubuntu
karmic), I get a segmentation fault.

Here is gdb's backtrace:
#0 0x0806af0e in std::type_info::name (this=0x9) at
/usr/include/c++/4.4/typeinfo:100
#1 0x00f4612e in
boost::detail::function::functor_manager<boost::_bi::bind_t boost::_mfi::mf0 boost::_bi::list1<boost::_bi::value std::allocator<void> >::manager(boost::detail::function::function_buffer
const&, boost::detail::function::function_buffer&,
boost::detail::function::functor_manager_operation_type,
mpl_::bool_<true>) ()
from /usr/local/lib/liborocos-rtt-gnulinux.so.1.10
#2 0x00f46190 in
boost::detail::function::functor_manager<boost::_bi::bind_t boost::_mfi::mf0 boost::_bi::list1<boost::_bi::value std::allocator<void> >::manager(boost::detail::function::function_buffer
const&, boost::detail::function::function_buffer&,
boost::detail::function::functor_manager_operation_type,
boost::detail::function::function_obj_tag) ()
from /usr/local/lib/liborocos-rtt-gnulinux.so.1.10
#3 0x00f461e0 in
boost::detail::function::functor_manager<boost::_bi::bind_t boost::_mfi::mf0 boost::_bi::list1<boost::_bi::value std::allocator<void> >::manage(boost::detail::function::function_buffer
const&, boost::detail::function::function_buffer&,
boost::detail::function::functor_manager_operation_type) () from
/usr/local/lib/liborocos-rtt-gnulinux.so.1.10
#4 0x0806cf43 in boost::detail::function::basic_vtable0<bool>::clear
(this=0x12b2f90, functor=...)
at /usr/include/boost/function/function_template.hpp:503
#5 0x0806c772 in boost::function0<bool>::clear (this=0xbfffea20)
at /usr/include/boost/function/function_template.hpp:850
#6 0x0806be7f in ~function0 (this=0xbfffea20, __in_chrg=<value
optimized out>)
at /usr/include/boost/function/function_template.hpp:750
#7 0x0806b747 in ~function (this=0xbfffea20, __in_chrg=<value optimized
out>)
at /usr/include/boost/function/function_fwd.hpp:33
#8 0x0807bf0b in FunctorDataSourceI (this=0x80b7468, f=...) at
/usr/local/include/rtt/FunctorDataSource.hpp:815
#9 0x08078fa8 in FunctorDataSource (this=0x80b7468, f=...) at
/usr/local/include/rtt/FunctorDataSource.hpp:880
#10 0x08075084 in DataSourceArgsMethod (this=0xbfffead4, meth=...)
at /usr/local/include/rtt/DataSourceArgsMethod.hpp:67
#11 0x08072237 in bool RTT::MethodRepository::addMethod<RTT::Method ()()> >(RTT::Method<bool ()()>, char const*) (this=0xbffff0a0, meth=...,
description=0x11a9574 "Configure this TaskContext (read properties etc).")
at /usr/local/include/rtt/MethodRepository.hpp:186
#12 0x00f3a452 in RTT::TaskContext::setup() () from
/usr/local/lib/liborocos-rtt-gnulinux.so.1.10
#13 0x00f3cd93 in RTT::TaskContext::TaskContext(std::string const&,
RTT::TaskCore::TaskState) ()
from /usr/local/lib/liborocos-rtt-gnulinux.so.1.10
#14 0x0806b8f2 in Hello (this=0xbffff06c, name=...) at HelloWorld.cpp:94
#15 0x0806ab81 in ORO_main_impl (argc=1, argv=0xbffff2f4) at
HelloWorld.cpp:155
#16 0x0806a96c in main (argc=1, argv=0xbffff2f4) at HelloWorld.cpp:142

There seems to be a problem in the constructor of the Hello class. When
I remove everything concerning dataports, there is no segfault.

Any ideas how to solve this problem?

Thank you,
Sabrina

Segmentation fault when running RTT exercise 3

On Fri, Nov 20, 2009 at 13:11, Sabrina Kliegl <skliegl [..] ...> wrote:
> Hi,
>
> I am new to orocos and doing the RTT exercises (from
> http://www.orocos.org/stable/examples/rtt/tutorial/rtt-exercises-1.10.0....).
> When I try to run "helloworld" from hello-3-dataports (on Ubuntu
> karmic), I get a segmentation fault.

I'm running karmic too and I can't reproduce your segfault. Could it
be that you installed the RTT or OCL in another location too and that
the build is picking up the wrong versions ? Or maybe OCL was compiled
with an older version of RTT ?

We typically see this stuff in such 'mixed-up' environments.

Peter

Segmentation fault when running RTT exercise 3

>> I am new to orocos and doing the RTT exercises (from
>> http://www.orocos.org/stable/examples/rtt/tutorial/rtt-exercises-1.10.0....).
>> When I try to run "helloworld" from hello-3-dataports (on Ubuntu
>> karmic), I get a segmentation fault.
>
> I'm running karmic too and I can't reproduce your segfault. Could it
> be that you installed the RTT or OCL in another location too and that
> the build is picking up the wrong versions ? Or maybe OCL was compiled
> with an older version of RTT ?
>
> We typically see this stuff in such 'mixed-up' environments.

Now I fixed it! It was not a problem of the RTT and OCL versions, but I
compiled both on Ubuntu Intrepid before the upgrade to Karmic. After
rebuilding RTT and OCL (both version 1.10) on Karmic the segfault is gone.

Sabrina