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
Describe the bug
For PSP modules the initialization is only called if the module type is "SIMPLE" - but this is not necessary to enforce, because the intent is to allow this to be extended to other module types as the mission requires.
Since the "Init" function pointer is a fixed/defined entry (so all modules have it, regardless of type) and it is already permitted to be NULL if it is not needed, then there is no real reason to restrict calling it to the "SIMPLE" module type.
To Reproduce
Define an extension module type and try to use it with Caelum. It will not be initialized as expected, the init call is skipped.
Expected behavior
If a module provides an init function, it should be called, regardless of whether the module type is "SIMPLE" or something else.
if ((uint32)ApiPtr->ModuleType==CFE_PSP_MODULE_TYPE_SIMPLE&&ApiPtr->Init!=NULL)
Through some form of evolution it was checking specifically for CFE_PSP_MODULE_TYPE_SIMPLE only, but it would be better to check that ModuleType != CFE_PSP_MODULE_TYPE_INVALID instead.
System observed on:
Ubuntu
Additional context
Only breaks when trying to add modules of other types (extensions). Could theoretically be fixed in other ways, but still, the intent of this code is only to confirm that the module structure is initialized to something before invoking a function pointer. So it is more correct to check that it is not invalid, rather than checking specifically for one value.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Rather than only calling "Init" on a "SIMPLE" module type, just
check that it is not invalid instead. Even extension types
still have an Init routine that needs to be called.
Rather than only calling "Init" on a "SIMPLE" module type, just
check that it is not invalid instead. Even extension types
still have an Init routine that needs to be called.
Describe the bug
For PSP modules the initialization is only called if the module type is "SIMPLE" - but this is not necessary to enforce, because the intent is to allow this to be extended to other module types as the mission requires.
Since the "Init" function pointer is a fixed/defined entry (so all modules have it, regardless of type) and it is already permitted to be NULL if it is not needed, then there is no real reason to restrict calling it to the "SIMPLE" module type.
To Reproduce
Define an extension module type and try to use it with Caelum. It will not be initialized as expected, the init call is skipped.
Expected behavior
If a module provides an init function, it should be called, regardless of whether the module type is "SIMPLE" or something else.
Code snips
Check is here:
PSP/fsw/shared/src/cfe_psp_module.c
Line 67 in 6d40816
Through some form of evolution it was checking specifically for
CFE_PSP_MODULE_TYPE_SIMPLE
only, but it would be better to check thatModuleType != CFE_PSP_MODULE_TYPE_INVALID
instead.System observed on:
Ubuntu
Additional context
Only breaks when trying to add modules of other types (extensions). Could theoretically be fixed in other ways, but still, the intent of this code is only to confirm that the module structure is initialized to something before invoking a function pointer. So it is more correct to check that it is not invalid, rather than checking specifically for one value.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: