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

cFE Integration candidate: 2021-01-19 #1109

Merged
merged 40 commits into from
Jan 27, 2021
Merged

cFE Integration candidate: 2021-01-19 #1109

merged 40 commits into from
Jan 27, 2021

Conversation

astrogeco
Copy link
Contributor

@astrogeco astrogeco commented Jan 21, 2021

Describe the contribution

Fix #1074, Refactor CFE_TIME_RegisterSynchCallback
Fix #449, Add OS_printf to CFE_ES_SYSLOG_APPEND
Fix #488, Pad msg headers to 64 bit
Fix #903, Add CFE_SB_GetUserData padding check
Fix #877, Remove duplicate CFE_MISSION_REV define
Fix #901, Remove UT_CheckForOpenSockets references
Fix #904, Update cpuname targets.cmake documentation
Fix #1090, UT event check bounds
Fix #1052, Refactor UT_ClearForceFail to UT_ClearDefaultReturnValue
Fix #1068, Create Security Policy
Fix #933, Remove SenderReporting from SB global
Fix #985, globalize "resource ID" definitions
Fix #1073, refactor SB API for proper global locks
Fix #945, Finish CFE_PLATFORM_ES_PERF_MAX_IDS removal
Fix #954, Handle debug events in unit test
Fix #955, Remove OS_printf stub count checks in UT
Fix #1089, Cleanup strncpy use - unit tests
Fix #1089, Cleanup strncpy use - main code
Fix #932, Update UT for CFE_MISSION* string sizing
Fix #1134, Add UtDebug output to CFE_ES_WriteToSysLog stub

Testing performed
See https://github.com/nasa/cFS/pull/177/checks

Expected behavior changes

PR #1048 - Documentation: Add Security.md with instructions to report vulnerability

PR #1086 - Documentation: Update cpuname/MISSION_CPUNAMES documentation

PR #1091 - Fixes UT_CheckEventHistoryFromFunc() helper routine to read the correct number of IDs so it checks the correct number of events. Also correct bad event checks in TBL UT.

PR #1076 - Adds OS_printf to CFE_ES_SYSLOG_APPEND so it matches CFE_ES_WriteToSysLog

PR #1099 - Removes unused SenderReporting and CFE_PLATFORM_SB_DEFAULT_REPORT_SENDER

PR #1106 - Tests pass when debug events are enabled via CFE_PLATFORM_EVS_DEFAULT_TYPE_FLAG in platform config.

PR #1085 - Removes references to UT_CheckForOpenSockets which is no longer applicable since the UT framework resets the state for each unit test.

PR #1053 - Rename UT_ClearForceFail as UT_ClearDefaultValue given change in nasa/osal#724

PR #905 - Adds checks that ensure CFE_SB_GetUserData works with all payload data types.

PR #1077

  • Adds header padding to 64-bit so that CFE_SB_GetUserData will work for message structures with elements up to 64 bit
  • For primary-only header config: telemetry header required to 64 bit boundary (affects all receivers)
  • For primary and extended header config: command header required padding to 64 bit boundary (affects all senders)

PR #1075 - Refactor CFE_TIME_RegisterSynchCallback to only have one return point and eliminates "possible uninitialized variable" static analysis warning

PR #1092 - None of these changes are expected to cause problematic.

  • Addresses message delivery issues due to inconsistent locking by reworking cFE-SB API implementation. Ensures all events are generated and counters are incremented consistently by avoiding early returns in functions and using the PendingEventID register to record what event ID should be sent per the current operation.

  • Employs the CFE_ES_ResourceID_t type and related patterns for managing the SB Pipe IDs. In particular this (intentionally) makes it not possible

  • Will break code which directly accessed these items without going through the lookup function.

  • CFE_SB_PipeId_t type is no longer usable as a direct array index, increased in size from 8 to 32 bits, and is now consistent with all other ID types in both behavior and size.

  • The "pipe stats" structure in the Pipe TLM is also changed. This structure contained a CFE_SB_PipeId_t value, hence why it had to be updated because the type is now bigger. The spare bytes are also moved to the end of the struct.

PR #1107 - Removes OS_printf checks of stub calls in unit tests and checks for specific format string in history instead to confirm the right path was taken.

PR #1084 - Removes CFE_MISSION_REV from platform config.

PR #1104 - Removes the rest of the references and uses of CFE_PLATFORM_ES_PERF_MAX_IDS in favor of CFE_MISSION_ES_PERF_MAX_IDS

PR #1098

  • Remove uses of strncpy and other minor hardcoded references
  • Cleanup unit tests to reflect size changes in CFE_MISSION_MAX_API_LEN and CFE_MISSION_MAX_PATH_LEN.
  • Moved ES pipe name and lengths to defines
  • Removed PipeName and PipeDepth variables from app global
  • Removed unnecessary (char *) casts
  • Simplified &stingname[0] to stringname where observed
  • Enables projects that have OSs with different limits to maintain a standard cmd/tlm and have unit tests pass.

PR #1135 - Make CFE_ES_WriteToSysLog stub unit test more informative by adding UtDebug output

System(s) tested on
Ubuntu 18.04

Additional context
Part of nasa/cFS#177

Third party code
None

Contributor Info - All information REQUIRED for consideration of pull request
@skliper
@zanzaben
@ArielSAdamsNASA
@jphickey

skliper and others added 18 commits January 7, 2021 12:44
- One return point
- Eliminates "possible uninitialized variable" static
analysis warning
Divide the "position" (in bytes) by the size of the event IDs
to get the number of events.

Also correct bad event checks in TBL UT.
Move certain definitions related to the CFE_ES_ResourceID_t type
into the global CFE include files.  This introduces two new headers:

cfe_resourceid.h (public)
cfe_resourceid_internal.h (private to CFE core apps)

This allows other CFE core apps, such as SB, to use the
CFE_ES_ResourceID_t using the same manipulators.
Significant refactor of many SB API calls to address inconsistencies
with respect to locking and unlocking of global data structures.

First this updates the definition of CFE_SB_PipeId_t to use the
CFE_ES_ResourceID_t base type, and a new ID range.  Notably this
prevents direct access to the CFE_SB.PipeTbl global, forcing
code to go through the proper lookup routine, which should only
be done while locked.

All API implementations follow the same general pattern:

- Initial checks/queries while unlocked
- Lock SB global
- Lookups and/or modifications to the pipe table/routing info
- Unlock SB global
- Invoke other subsystems (e.g. OSAL)
- Re-lock SB global (if needed) do final update, and unlock again
- Send all events

All error counters should be updated at the end, while still locked.
All event processing is deferred to the end of each function, after
all other processing is done.
Fix #1068, Create cFE Security Policy Markdown
Fix #904, Update cpuname targets.cmake documentation
astrogeco added a commit to nasa/cFS that referenced this pull request Jan 21, 2021
Fix #449, Add OS_printf to CFE_ES_SYSLOG_APPEND
Fix #933, Remove SenderReporting from SB global
Fix #901, Remove UT_CheckForOpenSockets references
Fix #1052, Refactor UT_ClearForceFail to UT_ClearDefaultReturnValue
Fix #903, Add CFE_SB_GetUserData padding check
@astrogeco
Copy link
Contributor Author

@skliper #905 broke one of the tests.

 The following tests FAILED:
Errors while running CTest
	 70 - cfe-core_sb_UT (Failed)
make: *** [test] Error 8

See https://github.com/nasa/cFS/runs/1759255844

@skliper
Copy link
Contributor

skliper commented Jan 25, 2021

@astrogeco - is it working now that you added #1077? #905 was marked as dependent.

@astrogeco
Copy link
Contributor Author

@astrogeco - is it working now that you added #1077? #905 was marked as dependent.

Yeah, I found it, sorry!

@astrogeco
Copy link
Contributor Author

@astrogeco - is it working now that you added #1077? #905 was marked as dependent.

Yeah, I found it, sorry!

I didn't catch the dependency on #1077 because it was in the comments.

jphickey and others added 2 commits January 26, 2021 10:25
Define a data structure in cfe_sb_msg.h that will be used
with the "write pipe info" command (CFE_SB_SEND_PIPE_INFO_CC).

This allows the internal CFE_SB_PipeD_t descriptor object to
evolve as needed without affecting the binary format of the
file that is generated form this command, and items such
as memory pointers may be excluded from the file.
Fix #982, separate pipeinfo file data structure
@astrogeco astrogeco marked this pull request as ready for review January 27, 2021 04:18
@astrogeco astrogeco merged commit 258625f into main Jan 27, 2021
astrogeco added a commit that referenced this pull request Jan 27, 2021
cFE Integration candidate: 2021-01-19
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment