Closed alxelax closed 2 years ago
The issue came back after merging this PR https://github.com/zephyrproject-rtos/zephyr/pull/40073.
It hides warnings in nrf52_bsim platform about potential hardfaults:
modules/nrf_hw_models/CMakeFiles/..__modules__bsim_hw_models__nrf_hw_models.dir/src/HW_models/NRF_RADIO.c.obj
ccache /usr/bin/gcc -DBUILD_VERSION=v2.7.99-2659-ge1b845cc8875 -DKERNEL -DNO_POSIX_CHEATS -DNRF52832_XXAA -D_POSIX_C_SOURCE=200809 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D__ZEPHYR__=1 -I/home/alkh/bsim/components/libUtilv1/src -I/home/alkh/bsim/components/libPhyComv1/src -I/home/alkh/bsim/components/ext_2G4_libPhyComv1/src -I/home/alkh/bsim/components/libRandv2/src -I/home/alkh/ncs/modules/bsim_hw_models/nrf_hw_models/src/HW_models -I/home/alkh/ncs/modules/bsim_hw_models/nrf_hw_models/src/nrfx/mdk_replacements -I/home/alkh/ncs/zephyr/include -I/home/alkh/ncs/zephyr/bsim_bt_out/tests/bluetooth/bsim_bt/bsim_test_mesh/prj.conf/zephyr/include/generated -I/home/alkh/ncs/zephyr/soc/posix/inf_clock -I/home/alkh/ncs/zephyr/boards/posix/nrf52_bsim -I/home/alkh/ncs/zephyr/subsys/bluetooth -I/home/alkh/ncs/modules/hal/nordic/nrfx -I/home/alkh/ncs/modules/hal/nordic/nrfx/drivers/include -I/home/alkh/ncs/modules/hal/nordic/nrfx/mdk -I/home/alkh/ncs/zephyr/modules/hal_nordic/nrfx/. -I/home/alkh/ncs/modules/bsim_hw_models/nrf_hw_models/src/nrfx/nrfx_replacements -I/home/alkh/ncs/modules/crypto/tinycrypt/lib/include -Werror -O0 -imacros /home/alkh/ncs/zephyr/bsim_bt_out/tests/bluetooth/bsim_bt/bsim_test_mesh/prj.conf/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/alkh/ncs/zephyr/tests/bluetooth/bsim_bt/bsim_test_mesh=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/alkh/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/alkh/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections -fprofile-arcs -ftest-coverage -fno-inline -m32 -include /home/alkh/ncs/zephyr/arch/posix/include/posix_cheats.h -fno-freestanding -fshort-enums -std=c11 -MD -MT modules/nrf_hw_models/CMakeFiles/..__modules__bsim_hw_models__nrf_hw_models.dir/src/HW_models/NRF_RADIO.c.obj -MF modules/nrf_hw_models/CMakeFiles/..__modules__bsim_hw_models__nrf_hw_models.dir/src/HW_models/NRF_RADIO.c.obj.d -o modules/nrf_hw_models/CMakeFiles/..__modules__bsim_hw_models__nrf_hw_models.dir/src/HW_models/NRF_RADIO.c.obj -c /home/alkh/ncs/modules/bsim_hw_models/nrf_hw_models/src/HW_models/NRF_RADIO.c
/home/alkh/ncs/modules/bsim_hw_models/nrf_hw_models/src/HW_models/NRF_RADIO.c: In function ‘start_Tx’:
/home/alkh/ncs/modules/bsim_hw_models/nrf_hw_models/src/HW_models/NRF_RADIO.c:856:32: error: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
856 | p2G4_freq_from_d(freq_off, 1,&ongoing_tx.radio_params.center_freq);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/alkh/ncs/modules/bsim_hw_models/nrf_hw_models/src/HW_models/NRF_RADIO.c: In function ‘start_Rx’:
/home/alkh/ncs/modules/bsim_hw_models/nrf_hw_models/src/HW_models/NRF_RADIO.c:1011:32: error: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
1011 | p2G4_freq_from_d(freq_off, 1,&ongoing_rx.radio_params.center_freq);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
just buld bsim tests with disabled warnings on main e1b845cc8875a0f69f2e0a1e7670327a78a1cbd3
These packed member warnings were only recently enabled in main. Maybe that’s why we see them here now.
Describe the bug The current BabbleSim tests build system hides compile warnings and ignores them. The PR checks miss them (test step is green even warnings present) and allow to merge PRs with warnings(potential bugs).
It is possible to observe already committed in main warnings just adding syntax errors in some of the tests. Then build system will show all existing warnings together with the syntax error report.
To Reproduce Steps to reproduce the behavior:
Expected behavior The PR checks should catch warnings and prevent merging.
Impact BubbleSim test quality
Logs and console output
Additional context The suggestion how to fix it provided by @aescolar is possible to find here: The issue has been highlighted here: https://github.com/zephyrproject-rtos/zephyr/pull/38205/files?file-filters%5B%5D=.c&file-filters%5B%5D=.sh&file-filters%5B%5D=.txt#diff-e56b290605f51cc3f6e2c017cd66a56827db908303cdb04b4ee0f426a117b6ecR38