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

Integration Candidate: 2020-09-02 #861

Merged
merged 22 commits into from
Sep 9, 2020
Merged

Integration Candidate: 2020-09-02 #861

merged 22 commits into from
Sep 9, 2020

Conversation

yammajamma
Copy link
Contributor

@yammajamma yammajamma commented Sep 3, 2020

Describe the contribution
Fix #815
Fix #823
Fix #851

Testing performed
Bundle CI - https://github.com/nasa/cFS/pull/136/checks

Expected behavior changes
PR #817 - In the next major CFE release, this code will be no longer supported at all. It should be removed early in the cycle
to avoid needing to maintain this compatibility code.

PR #857 - The CFE_ES_FindCDSInRegistry function had an unusual loop control structure with mixed types of signed and unsigned. This has the possibility of being infinite if the MaxNumRegEntries is zero due to the way the end condition is structured. Simplify to be like other loops and use unsigned int control variable.

PR #852 - Fixes the cast-align error (use the aligned Msg since it's available already).

HOTFIX-20200902 - Fix sb unit test setup issue.

HOTFIX 20200902 - Update documentation links for deprecated symbols.

HOTFIX 20200902 - Fix SB Test_CleanupApp_API AppID.

System(s) tested on
Ubuntu - CI

Additional context
nasa/cFS#136

Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman, NASA-GSFC
Joseph Hickey, Vantage Systems, Inc.

jphickey and others added 14 commits August 18, 2020 16:29
Remove requirement to define a sequential/numbered list of targets.
Instead, user defines a list of target names, followed by a set of
properties associated with each name.

This makes it much simpler to consistently define CPUs but selectively
add/remove them from the build based on other criteria.
In the next major CFE release, this code will be no longer
supported at all.  It should be removed early in the cycle
to avoid needing to maintain this compatibility code.
The CFE_ES_FindCDSInRegistry function had an unusual loop control
structure with mixed types of signed and unsigned.

This has the possibility of being infinite if the MaxNumRegEntries
is zero due to the way the end condition is structured.

Simplify to be like other loops and use unsigned int control variable.
Introduce wrapper/accessor functions to look up table
entries by ID for Executive Services subsystem.

__Do not use AppID as a table index__.

Note - This does not change existing external APIs and AppIDs
are still zero-based uint32.  This only changes the internal
structures to remove use of ID as an array index, and to use a lookup
function to locate the table entry from an ID.  All entry access
is then performed via the table entry pointer, rather than
as an array index.

This provides the groundwork for abstract IDs without actually
changing anything fundamental about resource IDs.
Update the EVS subsystem to follow the ES pattern for
internal table management.

Do not use AppID directly as a table index.  Instead,
use a separate lookup routine to get a pointer to the
entry, then access the entry via the pointer.

Also introduce inline helper functions to get/set
status of entry (free/not free), etc.
Minor fixup for use of IDs when logging
Change SB to get its task ID from ES rather than getting
it directly from OSAL.  Update syslog calls to use the
ES-supplied conversion to integer rather than direct cast.
Update TBL to use the new ES-supplied ID manipulations.  Update
all syslog calls to convert to integer using ES wrapper.
Update the TIME subsystem to use the new ES-supplied ID
abstractions.  Do not use AppID directly as array index
when registering sync callbacks, use the ES-supplied
conversion to array index before accessing local table.

Also update logging to use ES-supplied conversion
Fix #851, Pass aligned message into CFE_MSG_ComputeCheckSum
Fix #823, avoid infinite loop in CDS registry find
skliper and others added 5 commits September 4, 2020 12:45
@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

FYI - @skliper and @yammajamma I have a fix for the documentation symbol name changes that gets rid of the doxygen warnings. Should I push as hotfix directly to integration-candidate?

Use of some deprecated symbols as links in documentation was causing warnings
to be generated after removal of these times.  This removes/fixes those links.
@yammajamma
Copy link
Contributor Author

@jphickey that should work

@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

See commit d47a869 for the fixes. Most changing old names to new (non-deprecated) names within documentation, but there were some items e.g. shell related event ID that the entire feature was deprecated.

@astrogeco
Copy link
Contributor

@skliper and @jphickey we still have a unit test failure, see https://github.com/nasa/cFS/pull/136/checks:

8/76 Test #68: cfe-core_sb_UT ....................***Failed    0.02 sec

@skliper
Copy link
Contributor

skliper commented Sep 8, 2020

Started digging in, but seems like a behavior change... still need to nail down the difference.

@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

This is the same as it was last week ... in the Test_CleanupApp_API() test we are getting 4 events instead of 3.

The previous hotfix in commit 3baef94 changed it so it is now a "real" failure rather than a test teardown (TTF) failure which makes the count actually show up in the summary. However the failure is due to the event count difference and it is still a failure....

@skliper
Copy link
Contributor

skliper commented Sep 8, 2020

This is the same as it was last week...

Signature is the same but cause is different.

The previous problem is there were four events counted because it wasn't clearing the number of events between running the last subtest of Test_RcvMsg_API and running Test_CleanupApp_API. Now there really are 4 events being sent as part of Test_CleanupApp_API. Behavior change.

@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

I am taking a closer look ... I do see that that CFE_SB_DeletePipeWithAppId is being invoked several times, looks like a possible case of stale data in the table from a previous test case making the entry look "valid" ... so it is trying to delete but ultimately triggering event 46 (CFE_SB_DEL_PIPE_ERR1_EID)

@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

FWIW, this is happening on the first pass (line 3563 - which is commented to be the "bad" application ID - and isn't supposed to actually do anything AFAICT).

This is sort of confirming that there are remnants in the table which appear valid....

This test case relied on the default appID being 1, not 0,
and needs AppID 0 to be invalid.
@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

I think I found it ... AppID "0" was both the valid and invalid AppID here in this test ...

Adding a call to UT_SetAppID(1); prior to this test case seems to fix it and turns the first call back into a no-op (which agrees with the comments).

In a near term change the AppID "0" will become always invalid so this is really just a patch to get things working for this IC.

@skliper
Copy link
Contributor

skliper commented Sep 8, 2020

I did check the code at 8b9a3db at the point where my hotfix was merged and it did reject the first call and delete on the 2nd... seems like there was some other logic change in the other commits that affected behavior? Not saying the current logic isn't correct, just surprised to see a change in behavior of a unit test.

EDIT - actually this was in a separate branch... oh well.

@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

Possibly related to the internal table management changes in #797 / #859 ....
This updated the code to use the output of CFE_ES_GetAppID() as the "real" AppID but this is returning 0 at this stage. The code seems to be expecting AppID 1.

@skliper
Copy link
Contributor

skliper commented Sep 8, 2020

I just found:

#define CFE_UT_ES_DEFAULT_APPID ((uint32)1)

and this put my mind at ease.

@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

Right ... it is the UT_AppID here which overrides that:

UT_SetDataBuffer(UT_KEY(CFE_ES_GetAppID), (uint8*)&UT_AppID, sizeof(UT_AppID), false);

Once I submit PRs for the rest of the AppID cleanup stuff I think this can actually go away for good.

@skliper
Copy link
Contributor

skliper commented Sep 8, 2020

I suspect this should be != AppID to get branch coverage. You need an entry in use but != AppID:

CFE_SB.PipeTbl[1].AppId = AppID;

EDIT - actually it looks like you won't get the error case anymore without doing this. Looks like you'd get two successful deletions (maybe, just inspection).

@jphickey
Copy link
Contributor

jphickey commented Sep 8, 2020

Just as a sanity check I locally added another assert:

EVTSENT(CFE_SB_DEL_PIPE_ERR1_EID);

And this is also passing -- so it appears that we are getting the error case. Probably worth adding this to ensure we cover that event path (but that doesn't need to be a hotfix).

@astrogeco
Copy link
Contributor

@yammajamma can you update the "Expected behavior changes" above with a summary of the hotfixes?

@yammajamma yammajamma merged commit db82929 into main Sep 9, 2020
@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
Labels
None yet
Projects
None yet
4 participants