[Bug 486] New: SimulationThread locks up system under Xenomai 2.4

For more infomation about this bug, visit
Summary: SimulationThread locks up system under Xenomai 2.4
Product: RTT
Version: 1.4.0
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Operating System Abstraction - Portability
AssignedTo: orocos-dev [..] ...
ReportedBy: peter [dot] soetens [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

For an unknown reason, the SimulationThread, used by some unit tests, locks up
the PC when the unit test is run. I could find this last strange log message
before the lockup:

0.008 [ Info ][SimulationThread] PeriodicThread created with scheduler type
'0', priority 1 and period 0.001.
0.008 [ Debug ][Logger] Setting scheduler type for Thread SimulationThread to
1 done.
0.008 [ Info ][Logger] SimulationThread created with 0.001s periodicity and
priority 1
0.008 [ Info ][ExecutionEngine::setActivity] root is periodic.

It seems the SimulationThread falsely sets the scheduler type to '1' (which is
real-time), although it was constructed with scheduler type '0' (which is the
linux scheduler).

This could be a bug in the OS layer of Xenomai. As it does not happen in other
OS'es.

This does not affect regular Xenomai threads (PeriodicActivity etc). These work
fine.

[Bug 486] SimulationThread locks up system under Xenomai 2.4

For more infomation about this bug, visit

Peter Soetens

<peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |1.4.1

--- Comment #3 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-01-17 10:18:09 ---
Fixed on trunk. The patch had a ';' typo, but solves the problem perfectly.

$ svn ci xenomai/ -m"Fix bug #486: SimulationThread locks up system under
Xenomai 2.4
Applied proposed patch. Tested on testfarm.
"
Sending xenomai/fosi_internal.cpp
Transmitting file data .
Committed revision 28827.

[Bug 486] SimulationThread locks up system under Xenomai 2.4

http://bugs.orocos.org/show_bug.cgi?id=486

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |DUPLICATE

[Bug 486] SimulationThread locks up system under Xenomai 2.4

For more infomation about this bug, visit

Peter Soetens

<peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|orocos- |peter [dot] soetens [..] ...
|dev [..] ... |

--- Comment #2 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-01-15 14:52:03 ---
Created an attachment (id=206)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=206)
Adds rt_task_set_mode calls in wait_period for Xenomai

Untested yet. Needs to be applied on test farm for verification.

[Bug 486] SimulationThread locks up system under Xenomai 2.4

For more infomation about this bug, visit

--- Comment #1 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-01-15 14:35:14 ---
It seems Orocos code was not really faulty, but implicit mode switches in
Xenomai are the cause. See this thread

We'll have to add more rt_task_set_mode(T_PRIMARY, 0, 0 ) calls in the
'soft-rt' thread implementation in case we are running in Xenomai.