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

Table Services Validate command failure ("Too many Table Validations") #2625

Open
sara-gb opened this issue Jan 6, 2025 · 0 comments
Open

Comments

@sara-gb
Copy link

sara-gb commented Jan 6, 2025

Describe the bug
When sending the TBL Validate command with a valid table name, the following error is produced:

image

To Reproduce
Steps to reproduce the behavior:

  1. Compile and run the latest version of cFS with SIMULATION=native
  2. Send a TBL Load command for any table file in the bundle (/cf/sch_lab_table.tbl is an easy one but this should work for any table). This command should be successful
  3. Send a TBL Validate command with the table name listed out by the info event generated by the Load command and the ActiveTableFlag set to 0.
  4. The "Too many Table Validations have been requested" error event should have been issued instead of a success event

Commanding was done using COSMOS 5, but the ground software shouldn't affect this bug. The "Too many Table Validations" error shows up in other situations, like when validating an active table or with other tables besides the SCH lab table. I was not able to get a successful table validation command regardless of configuration or command parameters. This bug is not present in the official draco-rc5 tagged version

Expected behavior
A TBL Validate command with valid parameters should issue the following event:

                        CFE_EVS_SendEvent(CFE_TBL_VAL_REQ_MADE_INF_EID, CFE_EVS_EventType_DEBUG,
                                          "Tbl Services issued validation request for '%s'", TableName);

Code snips

This is the relevant block of code:

            /* Find a free Validation Response Block */
            PendingValId = CFE_TBL_GetNextValResultBlock();
            ValResultPtr = CFE_TBL_LocateValidationResultByID(CFE_TBL_VALRESULTID_C(PendingValId));
            if (ValResultPtr != NULL)
            {
                /* Allocate this Validation Response Block */
                ValResultPtr->State  = CFE_TBL_VALIDATION_PENDING;
                ValResultPtr->Result = 0;
                memcpy(ValResultPtr->TableName, TableName, CFE_TBL_MAX_FULL_NAME_LEN);

                /* Compute the CRC on the specified table buffer */
                CrcOfTable =
                    CFE_ES_CalculateCRC(SelectedBufferPtr->BufferPtr, RegRecPtr->Size, 0, CFE_MISSION_ES_DEFAULT_CRC);

                ValResultPtr->CrcOfTable   = CrcOfTable;
                ValResultPtr->ActiveBuffer = (CmdPtr->ActiveTableFlag != 0);

                CFE_TBL_ValidationResultSetUsed(ValResultPtr, PendingValId);

                /* If owner has a validation function, then notify the  */
                /* table owner that there is data to be validated       */
                if (RegRecPtr->ValidationFuncPtr != NULL)
                {
                    if (CmdPtr->ActiveTableFlag)
                    {
                        RegRecPtr->ValidateActiveId = CFE_TBL_ValidationResultGetId(ValResultPtr);
                    }
                    else
                    {
                        RegRecPtr->ValidateInactiveId = CFE_TBL_ValidationResultGetId(ValResultPtr);
                    }

                    /* If application requested notification by message, then do so */
                    if (CFE_TBL_SendNotificationMsg(RegRecPtr) == CFE_SUCCESS)
                    {
                        /* Notify ground that validation request has been made */
                        CFE_EVS_SendEvent(CFE_TBL_VAL_REQ_MADE_INF_EID, CFE_EVS_EventType_DEBUG,
                                          "Tbl Services issued validation request for '%s'", TableName);
                    }

                    /* Maintain statistic on number of validation requests given to applications */
                    CFE_TBL_Global.NumValRequests++;
                }
                else
                {
                    /* If there isn't a validation function pointer, then the process is complete  */
                    /* By setting this value, we are letting the Housekeeping process recognize it */
                    /* as data to be sent to the ground in telemetry.                              */
                    ValResultPtr->State = CFE_TBL_VALIDATION_PERFORMED;

                    CFE_EVS_SendEvent(CFE_TBL_ASSUMED_VALID_INF_EID, CFE_EVS_EventType_INFORMATION,
                                      "Tbl Services assumes '%s' is valid. No Validation Function has been registered",
                                      TableName);
                }

                /* Increment Successful Command Counter */
                ReturnCode = CFE_TBL_INC_CMD_CTR;
            }
            else
            {
                CFE_EVS_SendEvent(CFE_TBL_TOO_MANY_VALIDATIONS_ERR_EID, CFE_EVS_EventType_ERROR,
                                  "Too many Table Validations have been requested");
            }

System observed on:

  • Hardware: PC
  • OS: Ubuntu 20.04.6 LTS
  • Versions: The latest in the github main branches, as of today that is commit 9d70401 for the cFS bundle repo

Reporter Info
Sara Garcia-Beech
sara.garcia-beech@nasa.gov
GSFC Code 582

Note that this bug was originally reported to the DTN dev team by Krishnan Narayanan and then investigated further by me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant