Enable UBSan for telemetry/web_server QEMU tests#99
Merged
Conversation
ltowarek
force-pushed
the
cpp_linters_ubsan
branch
from
June 21, 2026 21:17
5f2af0e to
fa896bf
Compare
ltowarek
force-pushed
the
cpp_linters_cppcheck
branch
from
June 21, 2026 21:22
a6c2da6 to
bab0dd0
Compare
ltowarek
force-pushed
the
cpp_linters_ubsan
branch
from
June 21, 2026 21:24
fa896bf to
4dd8180
Compare
ltowarek
force-pushed
the
cpp_linters_cppcheck
branch
from
June 21, 2026 21:34
bab0dd0 to
58312aa
Compare
ltowarek
force-pushed
the
cpp_linters_ubsan
branch
2 times, most recently
from
June 21, 2026 21:52
678aa90 to
b557e41
Compare
ltowarek
changed the base branch from
cpp_linters_cppcheck
to
cpp_linters_clang_tidy
June 21, 2026 21:52
This was referenced Jun 21, 2026
Closed
Scopes UndefinedBehaviorSanitizer to the component under test in the telemetry and web_server QEMU test apps, per ESP-IDF's documented pattern (project-wide UBSan grows code/data size too much to fit on-target). No new CI job needed - the existing QEMU matrix entries already build and run these test apps. Part of #87. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QwTBvENKGMczMo9x7nAMrg
UBSan was previously baked into both test apps' CMakeLists.txt unconditionally, so every default QEMU functional test run also paid the sanitizer's instrumentation cost and conflated "does the feature work" with "is there UB". Gate it behind a CONFIG_<COMPONENT>_TEST_UBSAN Kconfig boolean (default n), set via a new sdkconfig.defaults.ubsan overlay, following the existing CONFIG_<COMPONENT>_TEST_QEMU_MODE pattern. The default test-telemetry/test-web_server CI jobs build without it; new test-telemetry-ubsan/test-web_server-ubsan jobs combine the new overlay with sdkconfig.defaults.qemu to run the same QEMU tests with UBSan enabled, as a separate, dedicated step. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QwTBvENKGMczMo9x7nAMrg
Adding -ubsan variants to the build job's existing matrix mixed a sanitizer run in among feature builds and hardware test builds that have nothing to do with it. Give UBSan its own job, mirroring clang-format/clang-tidy: a dedicated job with a matrix scoped only to the opted-in test apps, building each with sdkconfig.defaults.qemu; sdkconfig.defaults.ubsan and running its QEMU tests. Move the CONTRIBUTING.md description into the quality-checks section alongside clang-format/clang-tidy, generalized to "a QEMU test app can opt in" rather than naming the two current adopters, and focused on how to wire a new one up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QwTBvENKGMczMo9x7nAMrg
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QwTBvENKGMczMo9x7nAMrg
ltowarek
force-pushed
the
cpp_linters_ubsan
branch
from
June 21, 2026 22:28
a005a72 to
0d924e0
Compare
ltowarek
enabled auto-merge (squash)
June 21, 2026 22:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-fsanitize=undefined -fno-sanitize=shift-base) scoped to thetelemetryandweb_servercomponents in their respective QEMU test apps, viaidf_component_get_property/target_compile_optionsin each test app's projectCMakeLists.txt— the pattern ESP-IDF's docs recommend for keeping UBSan's code/data size growth out of the production firmware.cpp-car.yml(test-telemetry,test-web_server) already build and run these test apps, so UBSan traps surface as test failures automatically going forward.Part of #87.
Test plan
idf.py buildsucceeds for both QEMU test apps with UBSan enabledpytest pytest_telemetry_qemu.py --embedded-services idf,qemu -vpassespytest pytest_web_server_qemu.py --embedded-services idf,qemu -vpassesCo-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
https://claude.ai/code/session_01QwTBvENKGMczMo9x7nAMrg