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

POSIX implementation does not adhere to user-specified stack pointer #1449

Closed
jphickey opened this issue Feb 14, 2024 · 0 comments · Fixed by #1450
Closed

POSIX implementation does not adhere to user-specified stack pointer #1449

jphickey opened this issue Feb 14, 2024 · 0 comments · Fixed by #1450
Assignees
Labels

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The OS_TaskCreate() function accepts a stack pointer argument. Per the API, if this is not NULL, it is supposed to be used as the stack pointer for the newly-created task. VxWorks and RTEMS implement this, but POSIX ignores this argument. Currently, the POSIX implementation will allocate a stack buffer, regardless of what was passed in.

Describe the solution you'd like
Should adhere to the passed-in stack pointer argument.

Additional context
POSIX does define a function for this - pthread_attr_setstack().
Related issue in CFE: nasa/cFE#2516 ... when validating that fix, noticed that the newly-added tests fail on POSIX, because it does not adhere to the stack pointer.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Feb 14, 2024
@jphickey jphickey added the bug label Feb 14, 2024
jphickey added a commit to jphickey/osal that referenced this issue Feb 14, 2024
When the OS_TaskCreate() function is called with a non-NULL stack pointer,
the POSIX implementation now should use this pointer as intended.  Previously
it was always allocating a new stack buffer, ignoring the passed-in pointer.

NOTE: When using this feature, the caller must use caution to make sure the
buffer being passed in is large enough to use as a task stack.  Particularly
when running under a desktop Linux/Glibc environment, the infrastructure
puts a considerably large object on the stack.  For example, in the
osal-core-tests, the stack size was too small.
dzbaker added a commit that referenced this issue Feb 22, 2024
Fix #1449, POSIX implementation honors stack pointer
jphickey added a commit to jphickey/osal that referenced this issue Feb 26, 2024
dzbaker added a commit that referenced this issue Feb 29, 2024
Fix #1449, POSIX implementation honors stack pointer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant