-
Notifications
You must be signed in to change notification settings - Fork 217
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
Timer "reconfig" tests do not work on RTEMS or VxWorks #1083
Comments
For the record here is a trace of the test case:
|
So the negative test fails in a different way, such that you still can't reconfig from within the context of a callback? Is this behavior dependable/by design? If so maybe just adjust the test to look for != OS_SUCCESS, or branch based on the first return (or the Get ID behavior) and check appropriately? |
Not quite, it is allowing the call.... which is technically not safe (it may double-take a mutex or change a linked list that is actively being traversed). Error -15 is OS_ERR_NAME_TAKEN - this is because the attempt uses the same timer name (technically an overload, which another issue, but is easy to fix). Note that the OS_TimerDelete() actually succeeded. My recommendation is to just better document the fact that the Timer/Timebase configuration API must not be invoked from the context of a timer. I thought it was documented, but reviewing the documentation now, I don't see it stated as clearly as it should be. This whole check/test is only to save users from themselves and catch the programmer's error, but there's only so much that can be done in a practical sense. I would hesitate to change anything substantial at this point, for something that is a programmer error to begin with. |
Then I'm in favor of skipping the test for RTEMS and VxWorks. I agree it's really an optional test (as-in - not verifying a "requirement") since as long as the API's are documented correctly it would be a violation of the API to attempt using these APIs in that context. |
Unfortunately we don't have an OSAL OS type macro (e.g. |
The underlying OS mechanism that rejects calls to timer APIs from timer callbacks does not work on anything except POSIX. This skips these unit tests on non-POSIX platforms, and also adds documentation clearly indicating that the API must not be called from a timer context.
The underlying OS mechanism that rejects calls to timer APIs from timer callbacks does not work on anything except POSIX. This skips these unit tests on non-POSIX platforms, and also adds documentation clearly indicating that the API must not be called from a timer context.
Per review feedback, removes comment that was stale and no longer valid.
Per review feedback, removes comment that was stale and no longer valid, and describe why only POSIX_OS is enabled here on this check.
Per review feedback, removes comment that was stale and no longer valid, and describe why only POSIX_OS is enabled here on this check.
Fix nasa#793, Clarify restart/reload app behavior
Describe the bug
The "reconfig" tests were added to verify that timer config calls from the context of a timer callback are rejected. Unfortunately the underlying mechanism that allows this to happen only works on POSIX (via the pthread keys, which can do this). On RTEMS and VxWorks, the mechanism which gets the task ID (
OS_TaskGetId_Impl
) doesn't return the timer ID when called from a timer task.To Reproduce
Run timer tests on VxWorks or RTEMS, timer reconfig tests will fail.
Expected behavior
Test should pass.
System observed on:
MCP750 VxWorks 6.9
RTEMS 4.11.3
Additional context
Might be fixable on RTEMS but probably difficult to fix on VxWorks. May want to consider just skipping this test?
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: