[Bug 455] New: segfault on getCommand(name)

For more infomation about this bug, visit
Summary: segfault on getCommand(name)
Product: RTT
Version: rtt-trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Real-Time Toolkit (RTT)
AssignedTo: orocos-dev [..] ...
ReportedBy: ruben [dot] smits [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Hi,

i'm using the following code to get a pointer to a command that is added to a
TaskContext by exporting a function in a program-script:

c++:(line 63 of CommandListener.cpp)

RTT::DispatchInterface* moveJS;
moveJS=this->getPeer("SuperVisor")->commands()->
getCommand,double)>("moveJS");

programscript:

export function moveJS(array pos, double t)
{
do stuff
}

the taskbrowser shows me the available command:
In Task SuperVisor[R]. (Status of last Command : none )
(type 'ls' for context info) :ls

Listing TaskContext SuperVisor :

Configuration Properties: (none)

Execution Interface:
Attributes : (none)
Methods : cleanup configure isConfigured isRunning start stop trigger
update
Commands : moveCS moveJS
Events : (none)

Data Flow Ports: (none)

gdb gives me:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1090525520 (LWP 25078)]
0x00002b362dd7788b in std::_Rb_tree RTT::DispatchInterface*>, std::_Select1st RTT::DispatchInterface*> >, std::less,
std::allocator > >::find
()
at /home/rsmits/orocos/rtt/src/os/MutexLock.hpp:62
62 _mutex = &mutex;
Current language: auto; currently c++
(gdb) bt
#0 0x00002b362dd7788b in std::_Rb_tree const, RTT::DispatchInterface*>, std::_Select1st RTT::DispatchInterface*> >, std::less,
std::allocator > >::find
()
at /home/rsmits/orocos/rtt/src/os/MutexLock.hpp:62
#1 0x00002b362f0d5b70 in std::map std::less, std::allocator RTT::DispatchInterface*> > >::count (this=0x38, __x=@0x41000d70) at
/usr/include/c++/4.1.3/bits/stl_map.h:561
#2 0x00002b3631f642ce in RTT::CommandRepository::getCommand ()(std::vector >, double)> (this=0x8,
name=@0x41000d70)
at /home/rsmits/orocos/install/include/rtt/CommandRepository.hpp:96
#3 0x00002b3631f4a3ad in CommandListener::configureHook (this=0x7fff7d187770)
at
/home/rsmits/orocos/orocos-apps/applications/trasys/src/CommandListener.cpp:63

Ruben Smits's picture

[Bug 455] segfault on getCommand(name)

For more infomation about this bug, visit

Ruben Smits <ruben [dot] smits [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED