Skip to content

[pw_fuzzer] Fix OSS-Fuzz coverage: emit absolute source paths for the FuzzTest toolchain#72705

Merged
mergify[bot] merged 1 commit into
project-chip:masterfrom
Alami-Amine:pw-fuzztest-cov-fix
Jun 23, 2026
Merged

[pw_fuzzer] Fix OSS-Fuzz coverage: emit absolute source paths for the FuzzTest toolchain#72705
mergify[bot] merged 1 commit into
project-chip:masterfrom
Alami-Amine:pw-fuzztest-cov-fix

Conversation

@Alami-Amine

Copy link
Copy Markdown
Contributor

Summary

Problem

After the pw_fuzzer / Google FuzzTest OSS-Fuzz integration (#72573) landed, OSS-Fuzz's periodic coverage build started failing during report generation (the address/undefined builds and check_build are unaffected):

AssertionError: File path "out/usr/include/glib-2.0/glib/glib-autocleanups.h" in coverage summary is outside source checkout.
Code coverage report generation failed.
  • OSS-Fuzz resolves coverage source files with llvm-cov -path-equivalence=/,$OUT — i.e. it expects absolute paths (the builder's $SRC is copied into $OUT/$SRC).
  • The chip_pw_fuzztest toolchain inherits pigweed's $dir_pw_build:relative_paths config, whose -ffile-prefix-map transforms rewrite source paths to repo-relative (src/..., out-dir files to out/...). So the FuzzTest binaries record relative paths that don't remap, and the report aborts on an out-of-tree path.
  • The legacy chip fuzz targets build in chip's own (non-pigweed) toolchain, which has no relative_paths, so they record absolute paths — which is why coverage worked before the integration.
Solution

Drop the relative_paths config from the chip_pw_fuzztest toolchain under oss_fuzz, so it records absolute source paths like the legacy chip fuzz targets. Local builds are unchanged (they keep relative_paths; local coverage resolves relative paths from the repo root).

Related issues

Follow-up to #72573 (the FuzzTest OSS-Fuzz integration that introduced the regression).

Testing

Reproduced the OSS-Fuzz coverage build end-to-end against this change:

python infra/helper.py build_fuzzers --sanitizer coverage connectedhomeip
python infra/helper.py coverage connectedhomeip
  • Before: report generation aborts with the AssertionError above (non-zero exit).
  • After: Successfully generated clang code coverage report; the FuzzTest sources now resolve and the previously-fatal glib path no longer appears in the summary.

…ed relative_paths)

Pigweed's $dir_pw_build:relative_paths config (-ffile-prefix-map) rewrites the
chip_pw_fuzztest toolchain's source paths to repo-relative (src/..., out/...).
OSS-Fuzz's coverage report resolves only absolute paths (llvm-cov
-path-equivalence=/,$OUT), so the FuzzTest binaries' relative paths break report
generation, which aborts on an out-of-tree path (out/usr/include/glib-2.0/...).
The legacy chip fuzz targets use chip's own (non-pigweed) toolchain with no
relative_paths (absolute paths), which coverage already handled.

Drop relative_paths under oss_fuzz so chip_pw_fuzztest records absolute paths.
Verified by reproducing the OSS-Fuzz coverage build (infra/helper.py
build_fuzzers --sanitizer coverage + coverage): the report now generates.
@github-actions github-actions Bot added the gn label Jun 23, 2026
@pullapprove pullapprove Bot removed the gn label Jun 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the chip_pw_fuzztest toolchain configuration in build/toolchain/pw_fuzzer/BUILD.gn to remove Pigweed's relative_paths config when building for OSS-Fuzz (oss_fuzz is true). This ensures absolute paths are retained, preventing issues with OSS-Fuzz coverage report generation which relies on absolute paths. There are no review comments, and I have no feedback to provide.

@andy31415 andy31415 added the sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews. label Jun 23, 2026
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.76%. Comparing base (d7ebdf9) to head (cc7abd8).
⚠️ Report is 68 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #72705      +/-   ##
==========================================
+ Coverage   56.09%   56.76%   +0.66%     
==========================================
  Files        1640     1634       -6     
  Lines      112467   112660     +193     
  Branches    13318    13143     -175     
==========================================
+ Hits        63087    63948     +861     
+ Misses      49380    48712     -668     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

PR #72705: Size comparison from 44fb474 to cc7abd8

Full report (33 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 44fb474 cc7abd8 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1098674 1098674 0 0.0
RAM 133418 133418 0 0.0
bl702 lighting-app bl702+eth FLASH 1085226 1085226 0 0.0
RAM 109029 109029 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 882208 882208 0 0.0
RAM 108596 108596 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 777352 777352 0 0.0
RAM 103404 103404 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 790096 790096 0 0.0
RAM 108684 108684 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 739368 739368 0 0.0
RAM 97612 97612 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 719540 719540 0 0.0
RAM 97644 97644 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 569646 569646 0 0.0
RAM 205112 205112 0 0.0
lock CC3235SF_LAUNCHXL FLASH 597198 597198 0 0.0
RAM 205272 205272 0 0.0
efr32 lighting-app BRD4187C FLASH 1094924 1094924 0 0.0
RAM 135256 135256 0 0.0
lock-app BRD4187C FLASH 994816 994816 0 0.0
RAM 131292 131292 0 0.0
BRD4338a FLASH 799793 799793 0 0.0
RAM 243432 243432 0 0.0
esp32 all-clusters-app c3devkit DRAM 99884 99884 0 0.0
FLASH 1626700 1626700 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 842960 842960 0 0.0
RAM 157755 157755 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1749140 1749140 0 0.0
RAM 215476 215476 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1626532 1626532 0 0.0
RAM 211604 211604 0 0.0
light cy8ckit_062s2_43012 FLASH 1470844 1470844 0 0.0
RAM 197436 197436 0 0.0
lock cy8ckit_062s2_43012 FLASH 1504292 1504292 0 0.0
RAM 225268 225268 0 0.0
qpg lighting-app qpg6200+debug FLASH 843076 843076 0 0.0
RAM 127908 127908 0 0.0
lock-app qpg6200+debug FLASH 782960 782960 0 0.0
RAM 118840 118840 0 0.0
realtek light-switch-app rtl8777g FLASH 689344 689344 0 0.0
RAM 101780 101780 0 0.0
lighting-app rtl8777g FLASH 730288 730288 0 0.0
RAM 102052 102052 0 0.0
stm32 light STM32WB5MM-DK FLASH 478968 478968 0 0.0
RAM 141492 141492 0 0.0
telink all-devices-app tl7218x FLASH 849046 849046 0 0.0
RAM 99036 99036 0 0.0
tlsr9118bdk40d FLASH 640646 640646 0 0.0
RAM 120168 120168 0 0.0
bridge-app tl7218x FLASH 734126 734126 0 0.0
RAM 97700 97700 0 0.0
light-app-ota-compress-lzma-factory-data tl3218x FLASH 800656 800656 0 0.0
RAM 42380 42380 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl7218x FLASH 845796 845796 0 0.0
RAM 101492 101492 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 734616 734616 0 0.0
RAM 57816 57816 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795678 795678 0 0.0
RAM 75176 75176 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 734532 734532 0 0.0
RAM 34472 34472 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 615188 615188 0 0.0
RAM 118508 118508 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841744 841748 4 0.0
RAM 97376 97376 0 0.0

@mergify mergify Bot merged commit e0291ee into project-chip:master Jun 23, 2026
79 checks passed
@mergify mergify Bot deleted the pw-fuzztest-cov-fix branch June 23, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review - pending sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants