taskbrowser segmentation fault after helloworld's the_command("")

Hi,

The symptoms: I execute the helloworld program provided in the ocl, by typing $ sudo ./helloworld. Everything works fine, except for the two following: 1 - If I try to use the_command I get the following (no matter what string I use) (type 'ls' for context info) :the_command("")

      Got :the_command("")

 In Task Hello[R]. (Status of last Command : queued )
 (type 'ls' for context info) :Segmentation fault
2 - if I resize my gnome-terminal window (while executing helloworld), I also get:
 (type 'ls' for context info) :Segmentation fault
I thought it could be related to my terminal, but tried in a text-only environment and still got problem 1.

The system: Ubuntu 9.10 Xenomai 2.51 Kernel 2.6.32.7 using rtt, ocl from svn

what additional info do you need to track this problem?

taskbrowser segmentation fault after helloworld's the_command(""

On Monday 15 March 2010 17:42:37 jpmzometa [..] ... wrote:
> Hi,
>
> The symptoms:
> I execute the helloworld program provided in the ocl, by typing $ sudo
> ./helloworld. Everything works fine, except for the two following: 1 - If
> I try to use the_command I get the following (no matter what string I use)
> (type 'ls' for context info) :the_command("")
> Got :the_command("")
>
> In Task Hello[R]. (Status of last Command : queued )
> (type 'ls' for context info) :Segmentation fault
>
> 2 - if I resize my gnome-terminal window (while executing helloworld), I
> also get: (type 'ls' for context info) :Segmentation fault
>
> I thought it could be related to my terminal, but tried in a text-only
> environment and still got problem 1.
>
> The system:
> Ubuntu 9.10
> Xenomai 2.51
> Kernel 2.6.32.7
> using rtt, ocl from svn
>
> what additional info do you need to track this problem?
>

You can fix this as well by applying:

{{{
Index: taskbrowser/TaskBrowser.cpp
===================================================================
--- taskbrowser/TaskBrowser.cpp (revision 31479)
+++ taskbrowser/TaskBrowser.cpp (working copy)
@@ -514,6 +514,7 @@
context = tb;
this->switchTaskContext(_c);
#ifndef NO_GPL
+ rl_catch_sigwinch = 0;
rl_completion_append_character = '\0'; // avoid adding spaces
rl_attempted_completion_function =
&TaskBrowser::orocos_hmi_completion;

}}}
So adding the line

	rl_catch_sigwinch = 0;

in the TaskBrowser.cpp file. Fixes it on my system, then you don't have to
compile with NO_GPL=ON and can still use readline.

Thanks for reporting, the final fix will probably be somewhat different, since
this bug depends on Xenomai.

Peter

It works!

Thanks Peter.

I tried the two alternative fixes. They both work as described by you. I could even succesfully run the program I have written (the one that uses the Kuka_RSI component).

I assume that for the taskbrowser adding the rl_catch_sigwinch=0 is no big deal. However, the question still remains: Where else could this Xenomai bug cause problems? I am new to Orocos, so for now I am just writing very basic stuff using your ready-made components.

Regards,

It works!

Thanks Peter.

I tried the two alternative fixes. They both work as described by you. I could even succesfully run the program I have written (the one that uses the Kuka_RSI component).

I assume that for the taskbrowser adding the rl_catch_sigwinch=0 is no big deal. However, the question still remains: Where else could this Xenomai bug cause problems? I am new to Orocos, so for now I am just writing very basic stuff using your ready-made components.

Regards,

taskbrowser segmentation fault after helloworld's the_command(""

On Mon, Mar 15, 2010 at 17:42, <jpmzometa [..] ...> wrote:
> Hi,
>
> The symptoms:
> I execute the helloworld program provided in the ocl, by typing $ sudo ./helloworld. Everything works fine, except for the two following:
> 1 - If I try to use the_command I get the following (no matter what string I use)
> (type 'ls' for context info) :the_command("")
>      Got :the_command("")
>
>  In Task Hello[R]. (Status of last Command : queued )
>  (type 'ls' for context info) :Segmentation fault
>
> 2 - if I resize my gnome-terminal window (while executing helloworld), I also get:
>  (type 'ls' for context info) :Segmentation fault
>
> I thought it could be related to my terminal, but tried in a text-only environment and still got problem 1.
>
> The system:
> Ubuntu 9.10
> Xenomai 2.51
> Kernel 2.6.32.7
> using rtt, ocl from svn
>
> what additional info do you need to track this problem?

Output of:
ldd helloworld

If possible (depends on Xenomai willing to cooperate), output of:
gdb ./helloworld
(gdb) run
<make it crash>
(gdb) bt

So the output of the bt command. Preferably, rtt and ocl are compiled
with CMAKE_BUILD_TYPE=Debug

I'll try to reproduce this tomorrow.

Thanks for reporting,
Peter

Hi.Stephen, How can I know

Hi.

Stephen, How can I know if I am using deployer-corba?
I certainly have a deployer-corba-xenomai AND deployer-xenomai. Actually, I am trying to use the Kuka_RSI orocos component developed by Wilm Decré. His component requires a CORBA installation, that's why I installed Omniorb4. I tried to use his component with a very simple program using the taskbrowser. As far as I can get with that program is "(type 'ls' for context info) :Segmentation fault". These two problems might be related, don't you think?

Peter,
The command outputs:
{{{
$ ldd helloworld:
linux-vdso.so.1 => (0x00007fff43dff000)
liborocos-rtt-xenomai.so.1.10 => /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10 (0x00007fe966b9d000)
libnative.so.3 => /usr/xenomai/lib/libnative.so.3 (0x00007fe966991000)
liborocos-taskbrowser-xenomai.so.1.10 => /opt/ros/boxturtle/stacks/orocos-pkgs/ocl/ocl-1.10/ocl-svn/taskbrowser/liborocos-taskbrowser-xenomai.so.1.10 (0x00007fe966769000)
libncurses.so.5 => /lib/libncurses.so.5 (0x00007fe966526000)
libreadline.so.5 => /lib/libreadline.so.5 (0x00007fe9662e8000)
liborocos-ocl-common-xenomai.so.1.10 => /opt/ros/boxturtle/stacks/orocos-pkgs/ocl/ocl-1.10/ocl-svn/ocl/liborocos-ocl-common-xenomai.so.1.10 (0x00007fe965fee000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fe965cde000)
libm.so.6 => /lib/libm.so.6 (0x00007fe965a5a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fe965843000)
libc.so.6 => /lib/libc.so.6 (0x00007fe9654d4000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007fe9652b8000)
libdl.so.2 => /lib/libdl.so.2 (0x00007fe9650b4000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe967a22000)
}}}
Making the program crash on gdb:
{{{
Got :the_command("")

In Task Hello[R]. (Status of last Command : queued )
(type 'ls' for context info) :
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fd1910 (LWP 2162)]
0x00007ffff6d560c1 in xeno_sigwinch_handler () from /usr/xenomai/lib/libnative.so.3
}}}
{{{
(gdb) bt
#0 0x00007ffff6d560c1 in xeno_sigwinch_handler () from /usr/xenomai/lib/libnative.so.3
#1 0x00007ffff6d561ad in xeno_sigshadow_handler () from /usr/xenomai/lib/libnative.so.3
#2 0x00007ffff66c93e5 in ?? () from /lib/libreadline.so.5
#3 <signal handler called>
#4 0x00007ffff5962b39 in write () from /lib/libc.so.6
#5 0x00007ffff59028c3 in _IO_new_file_write (f=0x7ffff5bfa860, data=0x6ddfb8, n=25) at fileops.c:1275
#6 0x00007ffff590279d in new_do_write (f=0x7ffff5bfa860, data=<value optimized out>, n=25) at fileops.c:529
#7 _IO_new_file_xsputn (f=0x7ffff5bfa860, data=<value optimized out>, n=25) at fileops.c:1369
#8 0x00007ffff58f886d in _IO_fwrite (buf=0x6ddfb8, size=1, count=25, fp=0x7ffff5bfa860) at iofwrite.c:45
#9 0x00007ffff6138815 in std::basic_ostream<char, std::char_traits from /usr/lib/libstdc++.so.6
#10 0x00007ffff7872079 in RTT::Logger::D::logit(std::ostream& (*)(std::ostream&)) () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#11 0x00007ffff7871635 in RTT::Logger::logendl() () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#12 0x00007ffff78713e5 in RTT::Logger::operator<<(std::ostream& (*)(std::ostream&)) () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#13 0x000000000044a7a3 in OCL::HelloWorld::mycommand(std::string) ()
#14 0x0000000000445106 in boost::detail::function::function_obj_invoker1<RTT::detail::quickbind #15 0x0000000000464640 in RTT::detail::DataSourceArgsCommand<bool ()(std::string), RTT::detail::Functor #16 0x00007ffff7860d74 in RTT::CommandProcessor::step() () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#17 0x00007ffff786595d in RTT::ExecutionEngine::step() () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#18 0x00007ffff78885de in RTT::Activity::step() () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#19 0x00007ffff78d3c57 in RTT::OS::thread_function(void*) () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#20 0x00007ffff78db68f in RTT::OS::detail::rtos_xeno_thread_wrapper(void*) () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#21 0x00007ffff6d554b5 in rt_task_trampoline () from /usr/xenomai/lib/libnative.so.3
#22 0x00007ffff567ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#23 0x00007ffff597080d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#24 0x0000000000000000 in ?? ()
}}}
Is it information enough? If not, I'll try compiling with CMAKE_BUILD_TYPE=Debug and send you the output.

Regards,
--
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Hi.Stephen, How can I know

Hi.

Stephen, How can I know if I am using deployer-corba?
I certainly have a deployer-corba-xenomai AND deployer-xenomai. Actually, I am trying to use the Kuka_RSI orocos component developed by Wilm Decré. His component requires a CORBA installation, that's why I installed Omniorb4. I tried to use his component with a very simple program using the taskbrowser. As far as I can get with that program is "(type 'ls' for context info) :Segmentation fault". These two problems might be related, don't you think?

Peter,
The command outputs:
{{{
$ ldd helloworld:
linux-vdso.so.1 => (0x00007fff43dff000)
liborocos-rtt-xenomai.so.1.10 => /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10 (0x00007fe966b9d000)
libnative.so.3 => /usr/xenomai/lib/libnative.so.3 (0x00007fe966991000)
liborocos-taskbrowser-xenomai.so.1.10 => /opt/ros/boxturtle/stacks/orocos-pkgs/ocl/ocl-1.10/ocl-svn/taskbrowser/liborocos-taskbrowser-xenomai.so.1.10 (0x00007fe966769000)
libncurses.so.5 => /lib/libncurses.so.5 (0x00007fe966526000)
libreadline.so.5 => /lib/libreadline.so.5 (0x00007fe9662e8000)
liborocos-ocl-common-xenomai.so.1.10 => /opt/ros/boxturtle/stacks/orocos-pkgs/ocl/ocl-1.10/ocl-svn/ocl/liborocos-ocl-common-xenomai.so.1.10 (0x00007fe965fee000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fe965cde000)
libm.so.6 => /lib/libm.so.6 (0x00007fe965a5a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fe965843000)
libc.so.6 => /lib/libc.so.6 (0x00007fe9654d4000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007fe9652b8000)
libdl.so.2 => /lib/libdl.so.2 (0x00007fe9650b4000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe967a22000)
}}}
Making the program crash on gdb:
{{{
Got :the_command("")

In Task Hello[R]. (Status of last Command : queued )
(type 'ls' for context info) :
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fd1910 (LWP 2162)]
0x00007ffff6d560c1 in xeno_sigwinch_handler () from /usr/xenomai/lib/libnative.so.3
}}}
{{{
(gdb) bt
#0 0x00007ffff6d560c1 in xeno_sigwinch_handler () from /usr/xenomai/lib/libnative.so.3
#1 0x00007ffff6d561ad in xeno_sigshadow_handler () from /usr/xenomai/lib/libnative.so.3
#2 0x00007ffff66c93e5 in ?? () from /lib/libreadline.so.5
#3
#4 0x00007ffff5962b39 in write () from /lib/libc.so.6
#5 0x00007ffff59028c3 in _IO_new_file_write (f=0x7ffff5bfa860, data=0x6ddfb8, n=25) at fileops.c:1275
#6 0x00007ffff590279d in new_do_write (f=0x7ffff5bfa860, data=, n=25) at fileops.c:529
#7 _IO_new_file_xsputn (f=0x7ffff5bfa860, data=, n=25) at fileops.c:1369
#8 0x00007ffff58f886d in _IO_fwrite (buf=0x6ddfb8, size=1, count=25, fp=0x7ffff5bfa860) at iofwrite.c:45
#9 0x00007ffff6138815 in std::basic_ostream >& std::__ostream_insert >(std::basic_ostream >&, char const*, long) ()
from /usr/lib/libstdc++.so.6
#10 0x00007ffff7872079 in RTT::Logger::D::logit(std::ostream& (*)(std::ostream&)) () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#11 0x00007ffff7871635 in RTT::Logger::logendl() () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#12 0x00007ffff78713e5 in RTT::Logger::operator<<(std::ostream& (*)(std::ostream&)) () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#13 0x000000000044a7a3 in OCL::HelloWorld::mycommand(std::string) ()
#14 0x0000000000445106 in boost::detail::function::function_obj_invoker1, bool, std::string>::invoke(boost::detail::function::function_buffer&, std::string) ()
#15 0x0000000000464640 in RTT::detail::DataSourceArgsCommand >::execute() ()
#16 0x00007ffff7860d74 in RTT::CommandProcessor::step() () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#17 0x00007ffff786595d in RTT::ExecutionEngine::step() () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#18 0x00007ffff78885de in RTT::Activity::step() () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#19 0x00007ffff78d3c57 in RTT::OS::thread_function(void*) () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#20 0x00007ffff78db68f in RTT::OS::detail::rtos_xeno_thread_wrapper(void*) () from /opt/ros/boxturtle/stacks/orocos-pkgs/rtt/rtt-1.10/rtt/lib/liborocos-rtt-xenomai.so.1.10
#21 0x00007ffff6d554b5 in rt_task_trampoline () from /usr/xenomai/lib/libnative.so.3
#22 0x00007ffff567ba04 in start_thread (arg=) at pthread_create.c:300
#23 0x00007ffff597080d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#24 0x0000000000000000 in ?? ()
}}}
Is it information enough? If not, I'll try compiling with CMAKE_BUILD_TYPE=Debug and send you the output.

Regards,

Hi.Stephen, How can I know

On Tuesday 16 March 2010 10:00:12 jpmzometa [..] ... wrote:
> Hi.
>
> Stephen, How can I know if I am using deployer-corba?
> I certainly have a deployer-corba-xenomai AND deployer-xenomai. Actually, I
> am trying to use the Kuka_RSI orocos component developed by Wilm Decré.
> His component requires a CORBA installation, that's why I installed
> Omniorb4. I tried to use his component with a very simple program using
> the taskbrowser. As far as I can get with that program is "(type 'ls' for
> context info) :Segmentation fault". These two problems might be related,
> don't you think?

I can reproduce this seg fault here.It's the first time I see it. It is related
to using the logger in combination with the ncurses library from a xenomai
thread.

Ironically, the first time I ran the application (fresh boot) the problem did
not occur, only the next times I have the fault that you describe. (I tested
in Xenomai 2.4.93).

Also note that the RTT unit tests pass on Xenomai 2.5, so it is not an RTT
problem.

I think this is related due to changes from Xenomai 2.4 -> 2.5.

I'll ping the xenomai user list for this.

I don't need more information for now. You can probably work around this by
using the -DNO_GPL=ON flag in cmake when compiling OCL. That will disable
ncurses/readline and at least give you a prompt (without history or completion
though).

Peter
--
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

taskbrowser segmentation fault after helloworld's the_command(""

On Mar 15, 2010, at 12:42 , jpmzometa [..] ... wrote:

> Hi,
>
> The symptoms:
> I execute the helloworld program provided in the ocl, by typing $ sudo ./helloworld. Everything works fine, except for the two following:
> 1 - If I try to use the_command I get the following (no matter what string I use)
> (type 'ls' for context info) :the_command("")
> Got :the_command("")
>
> In Task Hello[R]. (Status of last Command : queued )
> (type 'ls' for context info) :Segmentation fault
>
> 2 - if I resize my gnome-terminal window (while executing helloworld), I also get:
> (type 'ls' for context info) :Segmentation fault
>
> I thought it could be related to my terminal, but tried in a text-only environment and still got problem 1.
>
> The system:
> Ubuntu 9.10
> Xenomai 2.51
> Kernel 2.6.32.7
> using rtt, ocl from svn
>
> what additional info do you need to track this problem?

Are you using deployer or deployer-corba? There are definitely seg-fault possibilities in the corba version, on shutting down (at least), with trunk RTT and OCL.
Stephen

taskbrowser segmentation fault after helloworld's the_command(""

Hi,

The symptoms:
I execute the helloworld program provided in the ocl, by typing $ sudo ./helloworld. Everything works fine, except for the two following:
1 - If I try to use the_command I get the following (no matter what string I use)
(type 'ls' for context info) :the_command("")
Got :the_command("")

In Task Hello[R]. (Status of last Command : queued )
(type 'ls' for context info) :Segmentation fault

2 - if I resize my gnome-terminal window (while executing helloworld), I also get:
(type 'ls' for context info) :Segmentation fault

I thought it could be related to my terminal, but tried in a text-only environment and still got problem 1.

The system:
Ubuntu 9.10
Xenomai 2.51
Kernel 2.6.32.7
using rtt, ocl from svn

what additional info do you need to track this problem?