Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up mock ember implementation (use after free and missing function) #32928

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

andy31415
Copy link
Contributor

MockEndpointConfig is self-referential because the ember structure contains a pointer to an internal vector of data. This means the default copy constructor cannot be used.

Also provide the emberAfDataVersionStorage which is a public API that is supposed to be available to the IM.

Changes

  • provide data version function as described by attribute-storage.h
  • fix self-referencing structure copying for mock node configurations

- provide data version function as described by attribute-storage.h
- fix self-referencing structure copying for mock node configurations
Copy link

github-actions bot commented Apr 10, 2024

PR #32928: Size comparison from e05d08e to f25331f

Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink)
platform target config section e05d08e f25331f change % change
bl602 lighting-app bl602 (read/write) 1442334 1442334 0 0.0
.bss 85432 85432 0 0.0
.data 9504 9504 0 0.0
.rodata 159032 159032 0 0.0
.text 1107698 1107698 0 0.0
bl602+mfd (read/write) 1456750 1456750 0 0.0
.bss 85600 85600 0 0.0
.data 9480 9480 0 0.0
.rodata 157992 157992 0 0.0
.text 1123016 1123016 0 0.0
bl602+rpc (read/write) 1489974 1489974 0 0.0
.bss 93480 93480 0 0.0
.data 9880 9880 0 0.0
.rodata 166600 166600 0 0.0
.text 1139344 1139344 0 0.0
bl702 lighting-app bl702 (read only) 3478 3478 0 0.0
(read/write) 1207179 1207179 0 0.0
.bss 11217 11217 0 0.0
.data 3688 3688 0 0.0
.rodata 108392 108392 0 0.0
.text 977000 977000 0 0.0
bl702+mfd (read only) 3478 3478 0 0.0
(read/write) 1217995 1217995 0 0.0
.bss 11393 11393 0 0.0
.data 3664 3664 0 0.0
.rodata 107332 107332 0 0.0
.text 988754 988754 0 0.0
bl702+rpc (read only) 3478 3478 0 0.0
(read/write) 1298915 1298915 0 0.0
.bss 19701 19701 0 0.0
.data 4224 4224 0 0.0
.rodata 123764 123764 0 0.0
.text 1051964 1051964 0 0.0
bl706-eth (read/write) 1024461 1024461 0 0.0
.bss 23792 23792 0 0.0
.data 3264 3264 0 0.0
.rodata 101716 101716 0 0.0
.text 767702 767702 0 0.0
bl706-wifi (read/write) 1259118 1259118 0 0.0
.bss 10677 10677 0 0.0
.data 3696 3696 0 0.0
.rodata 122716 122716 0 0.0
.text 999590 999590 0 0.0
bl702l lighting-app bl702l (read only) 512 512 0 0.0
(read/write) 1176524 1176524 0 0.0
.bss 16428 16428 0 0.0
.data 5048 5048 0 0.0
.rodata 102396 102396 0 0.0
.text 969866 969866 0 0.0
bl702l+mfd (read only) 512 512 0 0.0
(read/write) 1187928 1187928 0 0.0
.bss 16604 16604 0 0.0
.data 5032 5032 0 0.0
.rodata 101336 101336 0 0.0
.text 982188 982188 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 (read only) 782220 782220 0 0.0
(read/write) 168824 168824 0 0.0
.bss 90780 90780 0 0.0
.data 3584 3584 0 0.0
.rodata 82588 82588 0 0.0
.text 699364 699364 0 0.0
lock-ftd LP_EM_CC1354P10_6 (read only) 798260 798260 0 0.0
(read/write) 178976 178976 0 0.0
.bss 100948 100948 0 0.0
.data 3576 3576 0 0.0
.rodata 76676 76676 0 0.0
.text 721316 721316 0 0.0
lock-mtd LP_EM_CC1354P10_6 (read only) 787004 787004 0 0.0
(read/write) 173416 173416 0 0.0
.bss 95388 95388 0 0.0
.data 3576 3576 0 0.0
.rodata 103492 103492 0 0.0
.text 683244 683244 0 0.0
pump-app LP_EM_CC1354P10_6 (read only) 739324 739324 0 0.0
(read/write) 167784 167784 0 0.0
.bss 89520 89520 0 0.0
.data 3568 3568 0 0.0
.rodata 78252 78252 0 0.0
.text 660804 660804 0 0.0
pump-controller-app LP_EM_CC1354P10_6 (read only) 724956 724956 0 0.0
(read/write) 168000 168000 0 0.0
.bss 89736 89736 0 0.0
.data 3568 3568 0 0.0
.rodata 74028 74028 0 0.0
.text 650660 650660 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL (read only) 586306 586306 0 0.0
(read/write) 208080 208080 0 0.0
.bss 201308 201308 0 0.0
.data 1648 1648 0 0.0
.rodata 87474 87474 0 0.0
.text 496708 496708 0 0.0
lock CC3235SF_LAUNCHXL (read only) 631106 631106 0 0.0
(read/write) 208336 208336 0 0.0
.bss 201712 201712 0 0.0
.data 1504 1504 0 0.0
.rodata 107818 107818 0 0.0
.text 521164 521164 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 569399 569399 0 0.0
.app_xip_area 459317 459317 0 0.0
.bss 64908 64908 0 0.0
.data 752 752 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 551663 551663 0 0.0
.app_xip_area 436909 436909 0 0.0
.bss 69572 69572 0 0.0
.data 760 760 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 572615 572615 0 0.0
.app_xip_area 464037 464037 0 0.0
.bss 63444 63444 0 0.0
.data 712 712 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
switch cyw930739m2evb_01 (read/write) 564687 564687 0 0.0
.app_xip_area 452917 452917 0 0.0
.bss 66556 66556 0 0.0
.data 792 792 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4187C (read/write) 1067872 1067872 0 0.0
.bss 179904 179904 0 0.0
.data 3416 3416 0 0.0
.text 884532 884532 0 0.0
lock-app BRD4338a (read/write) 959408 959408 0 0.0
.bss 210220 210220 0 0.0
.data 30272 30272 0 0.0
.text 699548 699548 0 0.0
window-app BRD4187C (read/write) 1135056 1135056 0 0.0
.bss 164528 164528 0 0.0
.data 3320 3320 0 0.0
.text 967188 967188 0 0.0
esp32 all-clusters-app c3devkit (read only) 1213304 1213304 0 0.0
(read/write) 1750304 1750304 0 0.0
.dram0.bss 74384 74384 0 0.0
.dram0.data 13628 13628 0 0.0
.flash.rodata 252768 252768 0 0.0
.flash.text 1213304 1213304 0 0.0
.iram0.text 75530 75530 0 0.0
m5stack (read only) 1255143 1255143 0 0.0
(read/write) 536468 536468 0 0.0
.dram0.bss 81064 81064 0 0.0
.dram0.data 35180 35180 0 0.0
.flash.rodata 284304 284304 0 0.0
.flash.text 1248979 1248979 0 0.0
.iram0.text 125403 125403 0 0.0
linux air-purifier-app debug (read only) 2644333 2644333 0 0.0
(read/write) 130032 130032 0 0.0
.bss 46736 46736 0 0.0
.data 2272 2272 0 0.0
.data.rel.ro 75080 75080 0 0.0
.dynamic 608 608 0 0.0
.got 4520 4520 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 184848 184848 0 0.0
.text 2280517 2280517 0 0.0
all-clusters-app debug (read only) 5952809 5952809 0 0.0
(read/write) 481504 481504 0 0.0
.bss 135072 135072 0 0.0
.data 4560 4560 0 0.0
.data.rel.ro 334456 334456 0 0.0
.dynamic 624 624 0 0.0
.got 5328 5328 0 0.0
.init 27 27 0 0.0
.init_array 1432 1432 0 0.0
.rodata 350384 350384 0 0.0
.text 5167667 5167667 0 0.0
all-clusters-minimal-app debug (read only) 5233025 5233025 0 0.0
(read/write) 237488 237488 0 0.0
.bss 127904 127904 0 0.0
.data 4464 4464 0 0.0
.data.rel.ro 98040 98040 0 0.0
.dynamic 624 624 0 0.0
.got 5248 5248 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 289322 289322 0 0.0
.text 4707603 4707603 0 0.0
bridge-app debug (read only) 4626537 4626537 0 0.0
(read/write) 218336 218336 0 0.0
.bss 118400 118400 0 0.0
.data 6240 6240 0 0.0
.data.rel.ro 86976 86976 0 0.0
.dynamic 624 624 0 0.0
.got 5216 5216 0 0.0
.init 27 27 0 0.0
.init_array 856 856 0 0.0
.rodata 230186 230186 0 0.0
.text 4174675 4174675 0 0.0
chip-tool debug (read only) 12081593 12081593 0 0.0
(read/write) 523032 523032 0 0.0
.bss 94680 94680 0 0.0
.data 5122 5122 0 0.0
.data.rel.ro 416000 416000 0 0.0
.dynamic 624 624 0 0.0
.got 5736 5736 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 451193 451193 0 0.0
.text 10922067 10922067 0 0.0
chip-tool-ipv6only arm64 (read only) 11401316 11401316 0 0.0
(read/write) 589888 589888 0 0.0
.bss 103736 103736 0 0.0
.data 4512 4512 0 0.0
.data.rel.ro 455936 455936 0 0.0
.dynamic 512 512 0 0.0
.got 17112 17112 0 0.0
.init 24 24 0 0.0
.init_array 280 280 0 0.0
.rodata 355924 355924 0 0.0
.text 10163704 10163704 0 0.0
lighting-app debug+rpc+ui (read only) 5549353 5549353 0 0.0
(read/write) 227064 227064 0 0.0
.bss 119336 119336 0 0.0
.data 4864 4864 0 0.0
.data.rel.ro 95360 95360 0 0.0
.dynamic 672 672 0 0.0
.got 5856 5856 0 0.0
.init 27 27 0 0.0
.init_array 968 968 0 0.0
.rodata 353972 353972 0 0.0
.text 4947315 4947315 0 0.0
lock-app debug (read only) 4691473 4691473 0 0.0
(read/write) 205552 205552 0 0.0
.bss 113696 113696 0 0.0
.data 4160 4160 0 0.0
.data.rel.ro 81016 81016 0 0.0
.dynamic 624 624 0 0.0
.got 5168 5168 0 0.0
.init 27 27 0 0.0
.init_array 872 872 0 0.0
.rodata 255850 255850 0 0.0
.text 4223011 4223011 0 0.0
ota-provider-app debug (read only) 4307913 4307913 0 0.0
(read/write) 194224 194224 0 0.0
.bss 113472 113472 0 0.0
.data 4368 4368 0 0.0
.data.rel.ro 70448 70448 0 0.0
.dynamic 624 624 0 0.0
.got 4536 4536 0 0.0
.init 27 27 0 0.0
.init_array 744 744 0 0.0
.rodata 209098 209098 0 0.0
.text 3904355 3904355 0 0.0
ota-requestor-app debug (read only) 4437577 4437577 0 0.0
(read/write) 198592 198592 0 0.0
.bss 114368 114368 0 0.0
.data 4768 4768 0 0.0
.data.rel.ro 73552 73552 0 0.0
.dynamic 624 624 0 0.0
.got 4472 4472 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 215338 215338 0 0.0
.text 4023235 4023235 0 0.0
shell debug (read only) 2919281 2919281 0 0.0
(read/write) 156904 156904 0 0.0
.bss 62544 62544 0 0.0
.data 1424 1424 0 0.0
.data.rel.ro 87152 87152 0 0.0
.dynamic 592 592 0 0.0
.got 4056 4056 0 0.0
.init 27 27 0 0.0
.init_array 1104 1104 0 0.0
.rodata 186592 186592 0 0.0
.text 2558034 2558034 0 0.0
thermostat-no-ble arm64 (read only) 4426668 4426668 0 0.0
(read/write) 244624 244624 0 0.0
.bss 121976 121976 0 0.0
.data 3392 3392 0 0.0
.data.rel.ro 104296 104296 0 0.0
.dynamic 512 512 0 0.0
.got 8712 8712 0 0.0
.init 24 24 0 0.0
.init_array 448 448 0 0.0
.rodata 160052 160052 0 0.0
.text 3930072 3930072 0 0.0
tv-app debug (read only) 5762065 5762065 0 0.0
(read/write) 353296 353296 0 0.0
.bss 244336 244336 0 0.0
.data 6560 6560 0 0.0
.data.rel.ro 95128 95128 0 0.0
.dynamic 624 624 0 0.0
.got 5464 5464 0 0.0
.init 27 27 0 0.0
.init_array 1176 1176 0 0.0
.rodata 293226 293226 0 0.0
.text 5225635 5225635 0 0.0
tv-casting-app debug (read only) 9891969 9891969 0 0.0
(read/write) 342544 342544 0 0.0
.bss 157904 157904 0 0.0
.data 3008 3008 0 0.0
.data.rel.ro 174752 174752 0 0.0
.dynamic 624 624 0 0.0
.got 5040 5040 0 0.0
.init 27 27 0 0.0
.init_array 1208 1208 0 0.0
.rodata 383608 383608 0 0.0
.text 9041699 9041699 0 0.0
mbed lock-app-release cy8cproto_062_4343w (read only) 6224 6224 0 0.0
(read/write) 2534400 2534400 0 0.0
.bss 220472 220472 0 0.0
.data 5216 5216 0 0.0
.text 1497084 1497084 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1064500 1064500 0 0.0
bss 133107 133107 0 0.0
rodata 103012 103012 0 0.0
text 781156 781156 0 0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1225352 1225352 0 0.0
bss 127163 127163 0 0.0
rodata 151300 151300 0 0.0
text 796868 796868 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1011980 1011980 0 0.0
bss 131965 131965 0 0.0
rodata 90276 90276 0 0.0
text 742524 742524 0 0.0
nxp contact k32w0+release (read only) 574820 574820 0 0.0
(read/write) 80004 80004 0 0.0
.bss 67840 67840 0 0.0
.data 2180 2180 0 0.0
.text 574284 574284 0 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 701924 701924 0 0.0
.bss 71192 71192 0 0.0
.data 2856 2856 0 0.0
.text 588496 588496 0 0.0
light k32w0+release (read only) 608688 608688 0 0.0
(read/write) 79464 79464 0 0.0
.bss 67280 67280 0 0.0
.data 2200 2200 0 0.0
.text 608152 608152 0 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 793592 793592 0 0.0
.bss 80728 80728 0 0.0
.data 2056 2056 0 0.0
.text 671440 671440 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 832280 832280 0 0.0
(read/write) 1802684 1802684 0 0.0
.bss 198372 198372 0 0.0
.data 2688 2688 0 0.0
.text 1593236 1593236 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 835432 835432 0 0.0
(read/write) 1724588 1724588 0 0.0
.bss 195252 195252 0 0.0
.data 2656 2656 0 0.0
.text 1518292 1518292 0 0.0
light cy8ckit_062s2_43012 (read only) 842160 842160 0 0.0
(read/write) 1643324 1643324 0 0.0
.bss 188716 188716 0 0.0
.data 2464 2464 0 0.0
.text 1443756 1443756 0 0.0
lock cy8ckit_062s2_43012 (read only) 815096 815096 0 0.0
(read/write) 1672076 1672076 0 0.0
.bss 215788 215788 0 0.0
.data 2456 2456 0 0.0
.text 1445444 1445444 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1131968 1131968 0 0.0
.bss 102572 102572 0 0.0
.data 844 844 0 0.0
.text 644352 644352 0 0.0
lock-app qpg6105+debug (read/write) 1091984 1091984 0 0.0
.bss 97252 97252 0 0.0
.data 856 856 0 0.0
.text 604364 604364 0 0.0
stm32 light STM32WB5MM-DK (read/write) 603509 603509 0 0.0
.bss 128436 128436 0 0.0
.data 676 676 0 0.0
.rodata 80172 80172 0 0.0
.text 384480 384480 0 0.0
telink air-quality-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 832738 832738 0 0.0
bss 49836 49836 0 0.0
text 623804 623804 0 0.0
all-clusters-app tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 1095912 1095912 0 0.0
bss 101520 101520 0 0.0
text 797302 797302 0 0.0
all-clusters-minimal-app tlsr9528a (read only) 47960 47960 0 0.0
(read/write) 1057376 1057376 0 0.0
bss 109968 109968 0 0.0
text 771664 771664 0 0.0
bridge-app tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 912864 912864 0 0.0
bss 92724 92724 0 0.0
text 655102 655102 0 0.0
contact-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 834718 834718 0 0.0
bss 49880 49880 0 0.0
text 625850 625850 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a (read only) 51584 51584 0 0.0
(read/write) 935456 935456 0 0.0
bss 77492 77492 0 0.0
text 702488 702488 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d (read only) 29122 29122 0 0.0
(read/write) 1089272 1089272 0 0.0
bss 99816 99816 0 0.0
text 793112 793112 0 0.0
lock-app-dfu tlsr9528a (read only) 51584 51584 0 0.0
(read/write) 910004 910004 0 0.0
bss 69160 69160 0 0.0
text 659430 659430 0 0.0
ota-requestor-app tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 932556 932556 0 0.0
bss 92428 92428 0 0.0
text 674674 674674 0 0.0
pump-app tlsr9258a (read only) 52490 52490 0 0.0
(read/write) 832420 832420 0 0.0
bss 58124 58124 0 0.0
text 623002 623002 0 0.0
pump-controller-app tlsr9518adk80d (read only) 31872 31872 0 0.0
(read/write) 798540 798540 0 0.0
bss 56052 56052 0 0.0
text 597908 597908 0 0.0
shell tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 675936 675936 0 0.0
bss 73412 73412 0 0.0
text 461698 461698 0 0.0
smoke_co_alarm-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 842442 842442 0 0.0
bss 51508 51508 0 0.0
text 632388 632388 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d (read only) 32220 32220 0 0.0
(read/write) 858205 858205 0 0.0
bss 59676 59676 0 0.0
text 641958 641958 0 0.0
thermostat tlsr9518adk80d (read only) 31872 31872 0 0.0
(read/write) 824032 824032 0 0.0
bss 56384 56384 0 0.0
text 617400 617400 0 0.0
window-covering tlsr9258a (read only) 52490 52490 0 0.0
(read/write) 837148 837148 0 0.0
bss 58340 58340 0 0.0
text 625312 625312 0 0.0

@andy31415 andy31415 merged commit c6c8e67 into project-chip:master Apr 10, 2024
66 of 67 checks passed
shaoltan-amazon pushed a commit to shaoltan-amazon/connectedhomeip that referenced this pull request Apr 10, 2024
- provide data version function as described by attribute-storage.h
- fix self-referencing structure copying for mock node configurations
@@ -61,6 +61,10 @@ struct MockEndpointConfig
{
MockEndpointConfig(EndpointId aId, std::initializer_list<MockClusterConfig> aClusters = {});

// Cluster-config is self-referntial: mEmberCluster.clusters references mEmberClusters
Copy link
Contributor

Choose a reason for hiding this comment

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

"referential"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typo fixes added in #32932

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants