Segfault when calling export function in non periodic activity

Hi all,

I am using Orocos 1.10 under linux.

I use a component with non periodic activity : do setActivity("MyComponent", 0.0, 0, ORO_SCHED_OTHER )

I create a script with this function :

export function test() {

    //nothing
}

In the TaskBrowser : - I call MyComponent.test() a first time -> no pb. - I call MyComponent.test() a second time -> i get a segfault, my application crashes

Back trace :

  1. 0 0x2a2a2a2a in ?? ()
  2. 1 0xb75471f5 in RTT::ProgramProcessor::step (this=0xa3ccdd8) at /home/localuser/workspace/orocos/rtt/src/ProgramProcessor.cpp:192
  3. 2 0xb750e35a in RTT::ExecutionEngine::step (this=0xa3caf50) at /home/localuser/workspace/orocos/rtt/src/ExecutionEngine.cpp:309
  4. 3 0xb7617971 in RTT::OS::RunnableInterface::loop (this=0xa3caf50) at /home/localuser/workspace/orocos/rtt/src/os/RunnableInterface.cpp:60
  5. 4 0xb7562598 in RTT::Activity::loop (this=0xa3d3058) at /home/localuser/workspace/orocos/rtt/src/Activity.cpp:51
  6. 5 0xb7615240 in RTT::OS::thread_function (t=0xa3d3060) at /home/localuser/workspace/orocos/rtt/src/os/Thread.cpp:165
  7. 6 0xb7617efd in RTT::OS::detail::rtos_xeno_thread_wrapper (cookie=0xa3d2d80) at /home/localuser/workspace/orocos/rtt/src/os/xenomai/fosi_internal.cpp:185
  8. 7 0xb7311e36 in ?? () from /usr/lib/libnative.so.3
  9. 8 0x0a3d2d80 in ?? ()
  10. 9 0x00000000 in ?? ()

Do you have any idea what is the pb ? Is it an Orocos issue resolved in 1.12 ?

Thank you for your help. Renaud Heitz

Segfault when calling export function in non periodic activity

On Friday 18 February 2011 15:43:57 renaud [dot] heitz [..] ... wrote:
> Hi all,
>
> I am using Orocos 1.10 under linux.
>
> I use a component with non periodic activity :
> do setActivity("MyComponent", 0.0, 0, ORO_SCHED_OTHER )
>
> I create a script with this function :
>
> export function test()
> {
> //nothing
> }
>
> In the TaskBrowser :
> - I call MyComponent.test() a first time -> no pb.
> - I call MyComponent.test() a second time -> i get a segfault, my
> application crashes
>
> Back trace :
> #0 0x2a2a2a2a in ?? ()
> #1 0xb75471f5 in RTT::ProgramProcessor::step (this=0xa3ccdd8) at
> /home/localuser/workspace/orocos/rtt/src/ProgramProcessor.cpp:192 #2
> 0xb750e35a in RTT::ExecutionEngine::step (this=0xa3caf50) at
> /home/localuser/workspace/orocos/rtt/src/ExecutionEngine.cpp:309 #3
> 0xb7617971 in RTT::OS::RunnableInterface::loop (this=0xa3caf50) at
> /home/localuser/workspace/orocos/rtt/src/os/RunnableInterface.cpp:60 #4
> 0xb7562598 in RTT::Activity::loop (this=0xa3d3058) at
> /home/localuser/workspace/orocos/rtt/src/Activity.cpp:51 #5 0xb7615240 in
> RTT::OS::thread_function (t=0xa3d3060) at
> /home/localuser/workspace/orocos/rtt/src/os/Thread.cpp:165 #6 0xb7617efd
> in RTT::OS::detail::rtos_xeno_thread_wrapper (cookie=0xa3d2d80) at
> /home/localuser/workspace/orocos/rtt/src/os/xenomai/fosi_internal.cpp:185
> #7 0xb7311e36 in ?? () from /usr/lib/libnative.so.3
> #8 0x0a3d2d80 in ?? ()
> #9 0x00000000 in ?? ()
>
> Do you have any idea what is the pb ?
> Is it an Orocos issue resolved in 1.12 ?

Yes.This issue has been reported before and fixed. See:
http://www.orocos.org/forum/rtt/rtt-dev/bug-786-new-segmentation-fault-w...

It was fixed by the patch of bug #766.

Peter

Thank you for your answer.I

Thank you for your answer.

I have applied the patch. I hope I did it correctly. It does not solve my problem. Exactly same behaviour.

I had seen the issue 786. I am not sure I have the exactly same issue.

Bug 786 : How to produce the bug: - create a program that exports a function with many "do nothing" : prg.ops : export function foo() { do nothing; do nothing; ... // repeated many times } - load this program from a component running in a periodic activity - call that function several times from the task browser :

In my issue : - Task is non periodic - I have an emty function (no "do nothing")

What do you think ?

Segfault when calling export

One observation that could help understand :

if at the end of my script function I add do trigger() :

export function test() {

    do trigger();
}

I do not have the pb ...