You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The VxWorks task create implementation calculates a stack base address which involves adjustment such as rounding and accounting for whether the stack grows up or down (per VxWorks requirements of taskInit().
This does the calculation as integers, and currently uses the long type.
The risk is that if the address happens to lie in the negative range of this type, then the rounding/adjustments may need to go in the opposite direction.
Describe the solution you'd like
The address calculations should use unsigned long instead of long just to ensure that all rounding and base address adjustments behave the same way in the event that the addresses lie in the upper half of memory (i.e. start with a 1 bit) which would put it in the negative range of a long type.
Additional context
This is really just a suspicion of a possible issue - can't really confirm/test because we don't have direct control of where these stack buffers get allocated in memory.
But either way using unsigned would be more correct anyway - and would simply avoid the possibility that the operation works differently depending on its value.
It probably used long in the first place only because that is what the arguments to taskInit() are declared as.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Instead of identifying a memory pool by its memory address,
use a resource ID. IDs are a constant size, regardless of
whether the host machine is 32 or 64 bits.
- IDs can be put into commands/telemetry and maintain a more
consistent format with consistent alignment requirements.
- IDs can be independently verified without dereferencing
memory. Previously the only way to validate a memory pool
was to read the address pointed to, which results in a SEGV
if the address was bad.
jphickey
pushed a commit
to jphickey/osal
that referenced
this issue
Aug 10, 2022
Is your feature request related to a problem? Please describe.
The VxWorks task create implementation calculates a stack base address which involves adjustment such as rounding and accounting for whether the stack grows up or down (per VxWorks requirements of
taskInit()
.This does the calculation as integers, and currently uses the
long
type.The risk is that if the address happens to lie in the negative range of this type, then the rounding/adjustments may need to go in the opposite direction.
Describe the solution you'd like
The address calculations should use
unsigned long
instead oflong
just to ensure that all rounding and base address adjustments behave the same way in the event that the addresses lie in the upper half of memory (i.e. start with a 1 bit) which would put it in the negative range of along
type.Additional context
This is really just a suspicion of a possible issue - can't really confirm/test because we don't have direct control of where these stack buffers get allocated in memory.
But either way using
unsigned
would be more correct anyway - and would simply avoid the possibility that the operation works differently depending on its value.It probably used
long
in the first place only because that is what the arguments totaskInit()
are declared as.Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: