[Bug 670] New: TaskBrowser application crashes when using .connect and browsing

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=670

Summary: TaskBrowser application crashes when using .connect
and browsing
Product: OCL
Version: 1.8.0
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: TaskBrowser
AssignedTo: orocos-dev [..] ...
ReportedBy: peter [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Reported on the ML:

Thanks for the replies. Yes, I was using '.connect' and switching to plain
DataPort types gets me around the issue.

I don't have much experience with gdb, but here's a backtrace. I changed the
updateHooks to virtual and replaced o_task->ports()->... with connectPorts(...)
as suggested.

ndamore@woodstock:~/projects$ gdb ./test3
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run
Starting program: /home/ndamore/projects/test3
[Thread debugging using libthread_db enabled]
0.004 [ Warning][/home/ndamore/projects/test3::main()] Lowering scheduler type
to SCHED_OTHER for non-privileged users..
0.004 [ Warning][/home/ndamore/projects/test3::main()] Forcing priority (5) of
thread with SCHED_OTHER policy to 0.
[New Thread 0xb75166c0 (LWP 18995)]
[New Thread 0xb7515b90 (LWP 18998)]
0.007 [ Warning][/home/ndamore/projects/test3::main()] Lowering scheduler type
to SCHED_OTHER for non-privileged users..
0.007 [ Warning][/home/ndamore/projects/test3::main()] Forcing priority (5) of
thread with SCHED_OTHER policy to 0.
  Switched to : gain_task
 
 This console reader allows you to browse and manipulate TaskContexts.
 You can type in a command, event, method, expression or change variables.
 (type 'help' for instructions)
   TAB completion and HISTORY is available ('bash' like)
 
 In Task gain_task[R]. (Status of last Command : none )
 (type 'ls' for context info) :cd offset_task
  Switched to : offset_task
 
 In Task offset_task[R]. (Status of last Command : none )
 (type 'ls' for context info) :.connect
 
TaskBrowser connects to all ports of offset_task
 
 In Task offset_task[R]. (Status of last Command : none )
 (type 'ls' for context info) :leave
 
 Watching Task offset_task[R]. (Status of last Command : none )
 (type 'ls' for context info) :Data_R.Set(12)
     Got :Data_R.Set(12)
 = (void)
 
 Watching Task offset_task[R]. (Status of last Command : none )
 (type 'ls' for context info) :cd gain_task
  Switched to : gain_task
 
 Watching Task gain_task[R]. (Status of last Command : none )
 (type 'ls' for context info) :
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7515b90 (LWP 18998)]
0xffffffff in ?? ()
(gdb) bt
#0  0xffffffff in ?? ()
#1  0x0805c0bc in RTT::WriteDataPort<double>::Set ()
#2  0x0805c1b9 in MyOffsetTask::updateHook ()
#3  0xb7af0e52 in RTT::ExecutionEngine::step ()
  from /usr/local/lib/liborocos-rtt-gnulinux.so.1.8
#4  0xb79f31d8 in RTT::PeriodicActivity::step ()
  from /usr/local/lib/liborocos-rtt-gnulinux.so.1.8
#5  0xb7ac3a2e in RTT::TimerThread::step ()
  from /usr/local/lib/liborocos-rtt-gnulinux.so.1.8
#6  0xb7b120c1 in RTT::OS::periodicThread ()
  from /usr/local/lib/liborocos-rtt-gnulinux.so.1.8
#7  0xb77fe4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#8  0xb765de5e in clone () from /lib/tls/i686/cmov/libc.so.6
(gdb)