-
Notifications
You must be signed in to change notification settings - Fork 222
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
Unhandled output truncation errors when building on CentOS 8.1 #435
Comments
GCC has been adding more and more validation/verification in recent releases, so these warnings are almost certainly related to the newer GCC version here. Worth noting that @CDKnightNASA is actively working on putting these scattered string manipulations for error reporting into common code (e.g. nasa/cFE#492) which may either fix these or make them easier to fix once this effort is done. |
Indeed: I have just installed GCC 8.4.0 ( |
Thanks for the confirmation... in the meantime you might try |
Thank you @jphickey. At this time, I will directly install GCC 7 in my Docker images until cFS becomes fully compatible with GCC 8, but I keep your advice in mind.
I agree. |
See related: nasa/cFE#641. I'll also be rolling some fixes in for this with #285, as doing it separately would likely create a merge conflict. |
Resize buffers and tweak string copies to avoid truncation warnings in GCC 9. Note the code was generally OK (handled truncation) but the new compiler still generates warnings even with correct usage of certain functions. In the UT_os_printf macro, be sure to "use" the return value of the snprintf() call, which avoids warnings about truncation.
Resize buffers and tweak string copies to avoid truncation warnings in GCC 9. Note the code was generally OK (handled truncation) but the new compiler still generates warnings even with correct usage of certain functions. In the UT_os_printf macro, be sure to "use" the return value of the snprintf() call, which avoids warnings about truncation.
Resize buffers and tweak string copies to avoid truncation warnings in GCC 9. Note the code was generally OK (handled truncation) but the new compiler still generates warnings even with correct usage of certain functions. In the UT_os_printf macro, be sure to "use" the return value of the snprintf() call, which avoids warnings about truncation.
Fix #435, fix string manipulations to avoid warnings
Use "UtTest_Setup" instead of "OS_Application_Startup" This needs to be merged in coordination with a related change in OSAL/UT Assert. This also updates the UT application final link to use "ut_assert" rather than "ut_bsp", as the separate bsp for unit test is also getting phased out.
Fix nasa#435: Update UT entry point Resolve merge conflicts in fsw/cfe-core/unit-test/CMakeLists.txt
Describe the bug
On CentOS 8.1, when cFS is being built with enabled unit tests,
make
returns the following unhandled output truncation errors (-Werror=format-truncation=
) related to osal unit tests:To Reproduce
Steps to reproduce the behavior:
On an up-to-date CentOS 8.1, follow the current cFS
README
while enabling unit tests (step 7):git clone https://github.com/nasa/cFS.git
cd cFS
git submodule init
git submodule update
cp cfe/cmake/Makefile.sample Makefile
cp -r cfe/cmake/sample_defs sample_defs
make SIMULATION=native ENABLE_UNIT_TESTS=true prep
make
Expected behavior
make
should not return any error.Code snips
N/A
System observed on:
- iMac (Retina 4K, 2019)
- OS: CentOS 8.1 (
centos-release-8.1-1.1911.0.8.el8.x86_64
) (via VMware Fusion 11.5.3) / minimal installation / packages installed: git, make, cmake, gcc.- GCC:
8.3.1 20190507 (Red Hat 8.3.1-4)
- Versions: master bundle
Additional context
For convenience and mainly to investigate the possibility of performing automated end-to-end testing (for instance, to make a pseudo-GSW deterministically interact with the FSW and check the telemetry), I have taken the initiative to dockerize cFS.
In this context, these errors occurred when creating a CentOS-based Docker image. Their occurrence was then confirmed using a CentOS virtual machine (the logs provided above come from the unit tests performed on the virtual machine).
No such errors occur on (a virtualized) Ubuntu 18.04. This behavior seems then specific to CentOS, or perhaps to a certain version of GCC.
(Because these errors are directly related to osal, I have decided to open this issue here instead of the cFS repository).
Reporter Info
Guillaume Lethuillier
Personal
The text was updated successfully, but these errors were encountered: