You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while building the tree for the TSan and valgrind passes (round 2 meta issue linked as parent). This one is fork test infrastructure, not upstream code.
Configuring the tree with any other sanitizer then breaks the build:
cc1: error: '-fsanitize=thread' is incompatible with '-fsanitize=address'
FAILED: test/cmocka/CMakeFiles/test_formatted_filename.dir/test_formatted_filename.c.o
These tests are in the default all target, so a plain cmake --build of a TSan (or MSan) configuration fails. Valgrind can't run the ASan-built binaries either. In the sanitizer harness they are built with -k 0 and skipped under TSan and valgrind.
Fix options
Gate the per-test flags behind an option such as OBS_TEST_SANITIZE_PER_TARGET (default ON). Skip them when CMAKE_C_FLAGS already contains -fsanitize=.
Or move to a project-wide ENABLE_SANITIZER=address|thread|undefined option and let these tests inherit it.
Per testing-policy.md this is a CMake change to test wiring, not to the C test sources, so the existing tests stay unchanged.
Claiming: #159. Plan (option 1): an obs_test_sanitize(<target> <sanitizers>) helper in test/cmocka that adds the per-test flags only when OBS_TEST_SANITIZE_PER_TARGET is ON (default) and the build isn't already sanitized. A ci/ check bans raw -fsanitize in the test wiring (RED), then every site moves to the helper (GREEN).
Activity
zackees commentedon Oct 13, 2026
Claiming: #159. Plan (option 1): an
obs_test_sanitize(<target> <sanitizers>)helper intest/cmockathat adds the per-test flags only whenOBS_TEST_SANITIZE_PER_TARGETis ON (default) and the build isn't already sanitized. Aci/check bans raw-fsanitizein the test wiring (RED), then every site moves to the helper (GREEN).ci: Ban raw -fsanitize flags in the cmocka test wiring (RED)
test: Add per-test sanitizers only through obs_test_sanitize (GREEN)