Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sem-speed-test can run infinitely on some platforms #323

Closed
jphickey opened this issue Dec 18, 2019 · 0 comments · Fixed by #334
Closed

sem-speed-test can run infinitely on some platforms #323

jphickey opened this issue Dec 18, 2019 · 0 comments · Fixed by #334
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
In the sem-speed-test, the main thread stops the test by doing a task delay and then deleting the worker tasks.

When running on a hard real time kernel and a single processor system, if the worker threads are a higher priority than the main thread, then the main thread never gets CPU time to stop the test and it just runs infinitely.

To Reproduce
Run the test on a single-processor system such as VxWorks or RTEMS where the originating (shell) task is a (logically) lower priority than 50, which is the priority given to the worker tasks it creates. The test will never exit because the root task never gets CPU time again to cancel the worker tasks.

Expected behavior
The test should never run infinitely, regardless of (mis-)configuration.

System observed on:
RTEMS 4.11 on i686 (QEMU)

Additional context
The worker tasks should employ some type of hard limit so they do not run infinitely even if the priority is higher than the root task.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Dec 18, 2019
jphickey added a commit to jphickey/osal that referenced this issue Dec 18, 2019
1. Add a hard limit to the execution (work) counter for the
sem-speed-test worker threads.  With this they will self-exit
eventually even if the root task never gets CPU time to stop them.

2. Set the priority of the worker tasks to be logically lower, so
it is less likely to preempt the main task.

Note that the logical priority is inverted from the numeric value.
skliper pushed a commit that referenced this issue Dec 30, 2019
1. Add a hard limit to the execution (work) counter for the
sem-speed-test worker threads.  With this they will self-exit
eventually even if the root task never gets CPU time to stop them.

2. Set the priority of the worker tasks to be logically lower, so
it is less likely to preempt the main task.

Note that the logical priority is inverted from the numeric value.
skliper added a commit that referenced this issue Dec 30, 2019
Fix #295, #298, #305, #307, #308,
    #313, #314, #316, #321, #323
Reviewed and approved at 2019-12-18 CCB
@skliper skliper added this to the 5.1.0 milestone Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants