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

TBL verify check for CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE does not match documented description #2626

Closed
irowebbn opened this issue Jan 14, 2025 · 1 comment

Comments

@irowebbn
Copy link
Contributor

Describe the bug

According to the desciption in the platform config header, the value for CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE) must be "small enough to allow for #CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS number of tables to fit into #CFE_PLATFORM_TBL_BUF_MEMORY_BYTES." (see

** The cFE does not place a limit on the size of this parameter but it must be
).

However, in modules/tbl/fsw/src/cfe_tbl_verify.h , the logic for checking this appears to be off by one:

#if ((CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS + 1) * CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE) > \
    CFE_PLATFORM_TBL_BUF_MEMORY_BYTES
#error Shared buffers and table of size CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE cannot be greater than memory pool size of CFE_PLATFORM_TBL_BUF_MEMORY_BYTES!
#endif

This leads to compliant configuration values failing to compile.

To Reproduce
Steps to reproduce the behavior:

  1. Edit CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE and CFE_PLATFORM_ES_MAX_BLOCK_SIZE to be a large value, such as 196608
  2. Edit CFE_PLATFORM_TBL_BUF_MEMORY_BYTES to be equal to CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE * CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS (in this case 786432, for the default simultaneous load value of 4).
  3. Try to compile
  4. See error
[15%] Building C object tbl/CMakeFiles/tbl.dir/fsw/src/cfe_tbl_task.c.o
In file included from cfe/modules/tbl/fsw/src/cfe_tbl_task.c:35:
cfe/modules/tbl/fsw/src/cfe_tbl_verify.h:39:2: error: #error Shared buffers and table of size CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE cannot be greater than memory pool size of CFE_PLATFORM_TBL_BUF_MEMORY_BYTES!

Expected behavior
Successful compilation

System observed on:

  • Hardware: x86_64
  • OS: Rocky Linux 8
  • Versions draco-rc4 tag

Reporter Info
Isaac Rowe, NASA JSC/Jacobs Technology

@irowebbn irowebbn changed the title TBL verify check for does not match documented description TBL verify check for CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE does not match documented description Jan 14, 2025
@irowebbn
Copy link
Contributor Author

I fat-fingered the close button and GitHub said I didn't have permissions to re-open. Duplicated in #2627

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