Can't stop components

Hi Jordan,

On Tuesday 20 September 2011 11:05:49 Jordan Palacios wrote:
> Hello,
>
> We are currently migrating some legacy Orocos components from version
> 1.8 to 1.12.1. In doing so, we have stumbled upon the following
> issues:
>
> 1) The ORO_CREATE_COMPONENT(foo) does not seem to work. We have had to
> resort to the ORO_CREATE_COMPONENT_TYPE() /
> ORO_LIST_COMPONENT_TYPE(foo) pair.

One possible cause is that your component library links with another component
library which uses the latter form. Could you show us the error/debug messages
you get when loading a component library with the first macro ?

>
> 2) On the xenomai target, it is impossible to stop components deployed
> with RTT::Activity. On gnulinux it works as expected and on xenomai +
> legacy RTT::PeriodicActivity it also works but xenomai + legacy
> RTT::NotPeriodicActivity does not. We have implemented the
> breakUpdateHook method for components deployed with zero period
> activities.

That's strange. These things are supposed to be tested automatically. Did you
run the RTT unit tests on your target and did they all return no errors ?

>
> Deploying this trivial test component exemplifies the above problem
> (please forgive the non-rt calls to std::cout):
>
>
> class FooTest : public RTT::TaskContext
> {
> public:
> FooTest(std::string const& name) : TaskContext(name) {}
> virtual ~FooTest() {}
>
> protected:
> virtual bool configureHook() { std::cout << "Configure" <<
> std::endl; return true;}
> virtual bool startHook() { std::cout << "Start" <<
> std::endl; return true;}
> virtual void stopHook() { std::cout << "Stop" << std::endl;}
> virtual void updateHook() {std::cout << "Update" << std::endl;}
> virtual bool breakUpdateHook() {std::cout << "Break" << std::endl;
> return true;}
> };
>
>
> The problem is that when we try to stop it the following error message
> is reported:
>
> - If it is deployed as periodic (period = 5.0) component:
> [ERROR] : 135.857 [ ERROR ][Thread::stop] Failed to stop thread
> fooTest1: step() function did not return after 25 seconds.
> And the component just continues running.

You mean it keeps printing 'Update' ?

>
> - If it is deployed as non periodic (period = 0.0) component:
> [ERROR] : 129.008 [ ERROR ][Thread::stop] Failed to stop thread
> fooTest1: breakLoop() returned true, but loop() function did not
> return after 1 second.
> And the component just continues running.
>
> Odd thing is, when calling fooTest.stop from a TaskBrowser it returns
> immediately, not waiting 25 or 1 seconds for the updateHook to finish
> (the message appears immediately). Also, the breakUpdateHook message
> "Break" is not shown, even though the contrary is being reported.
>
>
> Thanks in advance. Any advice will be welcomed!

I'll try to reproduce this on Xenomai, but It will take some time before I
have time for that. You'd better put this in a bug report.

Peter