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

Improve CFE_SB_AllocateMessageBuffer error reporting #2559

Closed
skliper opened this issue May 9, 2024 · 1 comment · Fixed by #2560
Closed

Improve CFE_SB_AllocateMessageBuffer error reporting #2559

skliper opened this issue May 9, 2024 · 1 comment · Fixed by #2560

Comments

@skliper
Copy link
Contributor

skliper commented May 9, 2024

Is your feature request related to a problem? Please describe.
Current log message isn't very informative:

CFE_ES_WriteToSysLog("%s: ZeroCopyGetPtr-Failed, MsgSize is too large\n", __func__);

Describe the solution you'd like
Consider adding appname, requested size, and current limit

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

@skliper
Copy link
Contributor Author

skliper commented May 9, 2024

Suggested update:

    char              AppName[OS_MAX_API_NAME] = {""};
    CFE_SB_BufferD_t *BufDscPtr;
    CFE_SB_Buffer_t * BufPtr;
    CFE_Status_t      Status;

    AppId     = CFE_ES_APPID_UNDEFINED;
    BufDscPtr = NULL;
    BufPtr    = NULL;

    Status = CFE_ES_GetAppID(&AppId);

    if (MsgSize > CFE_MISSION_SB_MAX_SB_MSG_SIZE)
    {
        CFE_ES_GetAppName(AppName, AppId, sizeof(AppName));
        CFE_ES_WriteToSysLog("%s %s: Failed, requested size %ld larger than allowed %d\n",
                             AppName, __func__, MsgSize, CFE_MISSION_SB_MAX_SB_MSG_SIZE);
        return NULL;
    }

dzbaker added a commit that referenced this issue Jul 1, 2024
…_report

Fix #2559, Improve CFE_SB_AllocateMessageBuffer error report
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

Successfully merging a pull request may close this issue.

1 participant