Skip to content

CHIPArgParser: fix heap buffer overflow in SplitArgs realloc#72256

Open
woody-apple wants to merge 1 commit into
project-chip:masterfrom
woody-apple:typed-alloc-wrappers
Open

CHIPArgParser: fix heap buffer overflow in SplitArgs realloc#72256
woody-apple wants to merge 1 commit into
project-chip:masterfrom
woody-apple:typed-alloc-wrappers

Conversation

@woody-apple
Copy link
Copy Markdown
Contributor

@woody-apple woody-apple commented May 29, 2026

Summary

Fixes a heap buffer overflow in SplitArgs() (src/lib/support/CHIPArgParser.cpp). This is a memory-corruption fix, not a no-op.

SplitArgs() allocates an array of char * pointers starting at InitialArgListSize (10) and doubles when full. The doubling path passed the element count as the byte size to MemoryRealloc():

argListSize *= 2;
argList = MemoryRealloc(argList, argListSize);   // bug: count, not bytes

MemoryRealloc's second argument is a byte count, so this under-allocated by a factor of sizeof(char *) (8 on 64-bit). Once the arg list grew past 10 entries, a request for 20 pointers actually shrank the buffer to 20 bytes (~2 pointers). The next argList[argCount++] = nextArg and the trailing NULL terminator then wrote out of bounds — heap corruption, caught by ASan in the no-shell-asan CI job, silent corruption otherwise. Reachable from any caller parsing more than 10 whitespace-separated tokens.

Changes

  • Multiply the doubled count by sizeof(char *) so the realloc request is in bytes.
  • Add a pre-doubling size_t-overflow guard: the bare argListSize *= 2 would wrap silently on pathological input and under-allocate again; on overflow SplitArgs now returns -1 (parse failure) instead of corrupting the heap. This branch is unreachable in practice given the starting size but makes the doubling provably safe.

Testing

Three new regression tests in TestCHIPArgParser drive SplitArgs past the InitialArgListSize bucket across one and two doublings: pure non-option tokens, the exact n+1 boundary, and a mix of options and args. All three fail against the pre-fix code (ASan abort / wrong argc) and pass with the fix. Existing arg-parser and memory unit tests continue to pass.

Scope note

An earlier revision of this PR also added speculative MemoryAllocTyped / MemoryCallocTyped wrappers in CHIPMem.h plus cosmetic call-site migrations (Darwin/ESP32 DNS-SD, the two MemoryAlloc sites in this file). Those have been dropped here so this PR is a self-contained, fast-trackable correctness fix. The typed-wrapper idea, if pursued, belongs in its own PR where its API surface and count==0 -> nullptr semantics can be debated on their own merits — it is not needed for this fix (the original static_cast<char **>(MemoryRealloc(..., argListSize * sizeof(char *))) form fixes the bug).

Copy link
Copy Markdown
Contributor

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

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 introduces type-aware heap allocation wrappers MemoryAllocTyped and MemoryCallocTyped to simplify heap allocations when the element type is known. The review feedback highlights a potential integer overflow vulnerability in MemoryAllocTyped when calculating the allocation size (sizeof(T) * count) without validation, and suggests adding an overflow check to prevent smaller-than-expected memory allocations.

Comment thread src/lib/support/CHIPMem.h
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.57%. Comparing base (8ad5f7b) to head (d1f7da6).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/support/CHIPArgParser.cpp 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #72256      +/-   ##
==========================================
+ Coverage   55.52%   55.57%   +0.04%     
==========================================
  Files        1629     1630       +1     
  Lines      111092   111137      +45     
  Branches    13415    13404      -11     
==========================================
+ Hits        61683    61761      +78     
+ Misses      49409    49376      -33     

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

PR #72256: Size comparison from 8ad5f7b to 3fe7328

Full report (25 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32)
platform target config section 8ad5f7b 3fe7328 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094196 1094196 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105508 1105508 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593280 1593280 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057208 1057208 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896004 896004 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776932 776932 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789628 789628 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738752 738752 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718908 718908 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568670 568670 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596166 596166 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994072 994072 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798669 798661 -8 -0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100496 1100496 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621488 1621488 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834236 834236 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733900 1733900 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622692 1622692 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470180 1470180 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503316 1503316 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845060 845060 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783808 783808 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688600 688600 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729664 729664 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478372 478372 0 0.0
RAM 141476 141476 0 0.0

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

PR #72256: Size comparison from 8ad5f7b to 7f9d0e4

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8ad5f7b 7f9d0e4 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094196 1094196 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105508 1105508 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593280 1593280 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057208 1057208 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896004 896004 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776932 776932 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789628 789628 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738752 738752 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718908 718908 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568670 568670 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596166 596166 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994072 994072 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798669 798661 -8 -0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100496 1100496 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621488 1621488 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834236 834236 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733900 1733900 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622692 1622692 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470180 1470180 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503316 1503316 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845060 845060 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783808 783808 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688600 688600 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729664 729664 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478372 478372 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813010 813010 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606462 606462 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731374 731374 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851730 851730 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843058 843058 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731864 731864 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795090 795090 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731794 731794 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614510 614510 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841172 841176 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from 7f9d0e4 to 687d7a2 Compare May 30, 2026 04:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72256: Size comparison from 4894db9 to 687d7a2

Full report (31 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 4894db9 687d7a2 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from 687d7a2 to 0b7e39d Compare May 30, 2026 06:01
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72256: Size comparison from 4894db9 to 0b7e39d

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 4894db9 0b7e39d change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72256: Size comparison from 4894db9 to 2876164

Full report (21 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, psoc6, qpg, realtek, stm32)
platform target config section 4894db9 2876164b change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0

@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from 2876164 to cc761c4 Compare May 30, 2026 08:53
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72256: Size comparison from 8a162c6 to 4d319f6

Full report (21 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, psoc6, qpg, realtek, stm32)
platform target config section 8a162c6 4d319f6 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0

@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from 4d319f6 to b1daa37 Compare May 30, 2026 09:52
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72256: Size comparison from 8a162c6 to 0a01009

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 0a010093 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

woody-apple added a commit to woody-apple/connectedhomeip that referenced this pull request May 30, 2026
…d test rationale

Address round-2 review consensus on PR project-chip#72256 (typed-alloc wrappers).

Issue 1 (MAJOR — sizeof(T)==1 overflow guard hole): verified the
kMemoryAllocTypedMaxBytes second-cap guard is already in the diff under
review at CHIPMem.h:178/186/204. Updated test comments in
TestMemAllocTyped_OneByteTypeMaxCountReturnsNull and
TestMemCallocTyped_OverflowReturnsNull to state that the wrapper itself
enforces the contract via kMemoryAllocTypedMaxBytes — not the underlying
allocator. This removes the prior implication that the test passes only
because libc happens to refuse SIZE_MAX, which would have been false
under sanitizer-instrumented or embedded pool allocators.

Issue 2 (MINOR — count==0 returns nullptr divergence): strengthened the
doxygen block comment on the typed wrappers to flag the deliberate
departure from MemoryAlloc(0) / MemoryCalloc(0,n) and from libc malloc(0) /
calloc(0,n), all of which are implementation-defined and may return a
non-null freeable pointer. Added TestMemAllocTyped_ZeroCountIsAlwaysNull
to pin the divergence for both wrappers so future maintainers see the
intent.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from bd49d8a to d863481 Compare May 30, 2026 18:42
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

PR #72256: Size comparison from 8a162c6 to d863481

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 d863481 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple marked this pull request as ready for review May 31, 2026 03:05
Copilot AI review requested due to automatic review settings May 31, 2026 03:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from d863481 to d156132 Compare May 31, 2026 03:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

PR #72256: Size comparison from 8a162c6 to d156132

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 d156132 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple changed the title lib/support: add type-aware MemoryAllocTyped/MemoryCallocTyped wrappers CHIPArgParser: fix heap buffer overflow in SplitArgs realloc May 31, 2026
Copilot AI review requested due to automatic review settings May 31, 2026 10:34
@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from d156132 to 5570462 Compare May 31, 2026 10:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

PR #72256: Size comparison from 8a162c6 to 5570462

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 5570462 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch 2 times, most recently from d156132 to 9b6a34f Compare May 31, 2026 18:05
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

PR #72256: Size comparison from 8a162c6 to 9b6a34f

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 9b6a34fc change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from 9b6a34f to a78917c Compare May 31, 2026 19:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

PR #72256: Size comparison from 8a162c6 to a78917c

Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section 8a162c6 a78917c change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094216 1094216 0 0.0
RAM 144882 144882 0 0.0
bl616 lighting-app bl616+thread FLASH 1105524 1105524 0 0.0
RAM 104280 104280 0 0.0
bl616+wifi+shell FLASH 1593296 1593296 0 0.0
RAM 98176 98176 0 0.0
bl702 lighting-app bl702+eth FLASH 1057224 1057224 0 0.0
RAM 108509 108509 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896020 896020 0 0.0
RAM 105884 105884 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 776944 776944 0 0.0
RAM 103388 103388 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789640 789640 0 0.0
RAM 108676 108676 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738772 738772 0 0.0
RAM 97596 97596 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 718928 718928 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 568690 568690 0 0.0
RAM 205056 205056 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596178 596178 0 0.0
RAM 205256 205256 0 0.0
efr32 lock-app BRD4187C FLASH 994060 994060 0 0.0
RAM 131288 131288 0 0.0
BRD4338a FLASH 798629 798629 0 0.0
RAM 243424 243424 0 0.0
window-app BRD4187C FLASH 1100480 1100480 0 0.0
RAM 130360 130360 0 0.0
esp32 all-clusters-app c3devkit DRAM 99716 99716 0 0.0
FLASH 1621508 1621508 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834248 834248 0 0.0
RAM 157540 157540 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1733916 1733916 0 0.0
RAM 215260 215260 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1622708 1622708 0 0.0
RAM 211548 211548 0 0.0
light cy8ckit_062s2_43012 FLASH 1470196 1470196 0 0.0
RAM 197420 197420 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503332 1503332 0 0.0
RAM 225252 225252 0 0.0
qpg lighting-app qpg6200+debug FLASH 845080 845080 0 0.0
RAM 127964 127964 0 0.0
lock-app qpg6200+debug FLASH 783812 783812 0 0.0
RAM 118912 118912 0 0.0
realtek light-switch-app rtl8777g FLASH 688624 688624 0 0.0
RAM 101764 101764 0 0.0
lighting-app rtl8777g FLASH 729680 729680 0 0.0
RAM 102044 102044 0 0.0
stm32 light STM32WB5MM-DK FLASH 478384 478384 0 0.0
RAM 141476 141476 0 0.0
telink all-devices-app tl7218x FLASH 813028 813028 0 0.0
RAM 97196 97196 0 0.0
tlsr9118bdk40d FLASH 606480 606480 0 0.0
RAM 120152 120152 0 0.0
bridge-app tl7218x FLASH 731392 731392 0 0.0
RAM 95864 95864 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 851748 851748 0 0.0
RAM 44332 44332 0 0.0
tl7218x FLASH 843076 843076 0 0.0
RAM 99656 99656 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 731882 731882 0 0.0
RAM 55980 55980 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795108 795108 0 0.0
RAM 75164 75164 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 731812 731812 0 0.0
RAM 33468 33468 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614528 614528 0 0.0
RAM 118496 118496 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841190 841194 4 0.0
RAM 97364 97364 0 0.0

@woody-apple woody-apple force-pushed the typed-alloc-wrappers branch from a78917c to d1f7da6 Compare May 31, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants