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

Compiler-added implicit padding in FM_MonitorReportEntry_t & FM_ChildQueueEntry_t #104

Closed
2 tasks done
thnkslprpt opened this issue May 27, 2023 · 0 comments · Fixed by #105
Closed
2 tasks done

Comments

@thnkslprpt
Copy link
Contributor

Checklist

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
It seems that there is implicit padding being added by the compiler in FM_MonitorReportEntry_t & FM_ChildQueueEntry_t.

Code snips

FM/fsw/inc/fm_msg.h

Lines 512 to 518 in e7afedc

typedef struct
{
uint8 ReportType;
char Name[OS_MAX_PATH_LEN]; /**< \brief File system name */
uint64 Blocks; /**< \brief Block count from last check/poll, 0 if unknown */
uint64 Bytes; /**< \brief Byte count from last check/poll, 0 if unknown */
} FM_MonitorReportEntry_t;

FM/fsw/inc/fm_msg.h

Lines 656 to 669 in e7afedc

typedef struct
{
CFE_MSG_FcnCode_t CommandCode; /**< \brief Command code - identifies the command */
uint32 DirListOffset; /**< \brief Starting entry for dir list commands */
uint32 FileInfoState; /**< \brief File info state */
uint32 FileInfoSize; /**< \brief File info size */
uint32 FileInfoTime; /**< \brief File info time */
uint32 FileInfoCRC; /**< \brief File info CRC method */
char Source1[OS_MAX_PATH_LEN]; /**< \brief First source file or directory name command argument */
char Source2[OS_MAX_PATH_LEN]; /**< \brief Second source filename command argument */
char Target[OS_MAX_PATH_LEN]; /**< \brief Target filename command argument */
uint8 GetSizeTimeMode; /**< \brief Whether to invoke stat call for size and time (CPU intensive) */
uint32 Mode; /**< \brief File Mode */
} FM_ChildQueueEntry_t;

Expected behavior
Make implicit padding explicit.

Reporter Info
Avi Weiss @thnkslprpt

@dzbaker dzbaker closed this as completed in 4842063 Jun 8, 2023
dzbaker added a commit that referenced this issue Jun 8, 2023
…-in-fm-msg

Fix #104, Make padding explicit in `FM_MonitorReportEntry_t` & `FM_ChildQueueEntry_t`
@dmknutsen dmknutsen added this to the Equuleus milestone Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants