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

Handle error cases in Android OnAttributeData #17976

Conversation

g-coppock
Copy link
Contributor

Problem

  • Certain error paths in AndroidCallbacks.cpp (ReportCallback::OnAttributeData) were being ignored.

Change overview

Add VerifyOrReturn statements to handle these error cases.

Testing

Manually did a wildcard read of paths from all-clusters-app before and after. No new issues seen. The actual failure case (invalid TLV, missing class) were not reproduced.

@github-actions
Copy link

github-actions bot commented May 2, 2022

PR #17976: Size comparison from 72266d7 to 098475b

Full report (34 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 72266d7 098475b change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 688935 688935 0 0.0
(read/write) 163320 163320 0 0.0
.bss 75236 75236 0 0.0
.data 3400 3400 0 0.0
.rodata 102303 102303 0 0.0
.text 586148 586148 0 0.0
lock-ftd LP_CC2652R7 (read only) 676783 676783 0 0.0
(read/write) 166728 166728 0 0.0
.bss 73548 73548 0 0.0
.data 3224 3224 0 0.0
.rodata 94359 94359 0 0.0
.text 581944 581944 0 0.0
lock-mtd LP_CC2652R7 (read only) 625543 625543 0 0.0
(read/write) 146352 146352 0 0.0
.bss 69268 69268 0 0.0
.data 3224 3224 0 0.0
.rodata 94247 94247 0 0.0
.text 530808 530808 0 0.0
pump-app LP_CC2652R7 (read only) 661299 661299 0 0.0
(read/write) 183452 183452 0 0.0
.bss 73764 73764 0 0.0
.data 3256 3256 0 0.0
.rodata 80387 80387 0 0.0
.text 580428 580428 0 0.0
pump-controller-app LP_CC2652R7 (read only) 654187 654187 0 0.0
(read/write) 190364 190364 0 0.0
.bss 73820 73820 0 0.0
.data 3220 3220 0 0.0
.rodata 83323 83323 0 0.0
.text 570380 570380 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 626386 626386 0 0.0
.app_xip_area 528920 528920 0 0.0
.bss 80116 80116 0 0.0
.data 696 696 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 625090 625090 0 0.0
.app_xip_area 529088 529088 0 0.0
.bss 78692 78692 0 0.0
.data 660 660 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 574226 574226 0 0.0
.app_xip_area 468604 468604 0 0.0
.bss 88016 88016 0 0.0
.data 572 572 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 908200 908200 0 0.0
(read/write) 135128 135128 0 0.0
.bss 133072 133072 0 0.0
.data 2052 2052 0 0.0
.text 908192 908192 0 0.0
BRD4161A+rpc (read only) 942544 942544 0 0.0
(read/write) 151808 151808 0 0.0
.bss 149552 149552 0 0.0
.data 2256 2256 0 0.0
.text 942536 942536 0 0.0
BRD4161A+rs911x (read only) 746500 746500 0 0.0
(read/write) 129352 129352 0 0.0
.bss 127372 127372 0 0.0
.data 1980 1980 0 0.0
.text 746492 746492 0 0.0
lock-app BRD4161A+wf200 (read only) 916544 916544 0 0.0
(read/write) 127540 127540 0 0.0
.bss 125604 125604 0 0.0
.data 1936 1936 0 0.0
.text 916536 916536 0 0.0
window-app BRD4161A (read only) 845448 845448 0 0.0
(read/write) 133216 133216 0 0.0
.bss 131248 131248 0 0.0
.data 1964 1964 0 0.0
.text 845440 845440 0 0.0
esp32 all-clusters-app c3devkit (read only) 999610 999610 0 0.0
(read/write) 1474506 1474506 0 0.0
.dram0.bss 68376 68376 0 0.0
.dram0.data 14428 14428 0 0.0
.flash.rodata 207248 207248 0 0.0
.flash.text 999610 999610 0 0.0
.iram0.text 62020 62020 0 0.0
m5stack (read only) 1054791 1054791 0 0.0
(read/write) 476936 476936 0 0.0
.dram0.bss 73896 73896 0 0.0
.dram0.data 34176 34176 0 0.0
.flash.rodata 237028 237028 0 0.0
.flash.text 1049407 1049407 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 684268 684268 0 0.0
.bss 81320 81320 0 0.0
.data 2008 2008 0 0.0
.text 599236 599236 0 0.0
lock k32w061+release (read/write) 729148 729148 0 0.0
.bss 81744 81744 0 0.0
.data 1968 1968 0 0.0
.text 643732 643732 0 0.0
linux all-clusters-app debug (read only) 2729977 2729977 0 0.0
(read/write) 173144 173144 0 0.0
.bss 83360 83360 0 0.0
.data 2000 2000 0 0.0
.data.rel.ro 81656 81656 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 1008 1008 0 0.0
.rodata 235045 235045 0 0.0
.text 2320306 2320306 0 0.0
bridge-app debug+rpc (read only) 1885073 1885073 0 0.0
(read/write) 120440 120440 0 0.0
.bss 71360 71360 0 0.0
.data 3424 3424 0 0.0
.data.rel.ro 40312 40312 0 0.0
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 688 688 0 0.0
.rodata 160321 160321 0 0.0
.text 1602354 1602354 0 0.0
chip-tool debug (read only) 8976261 8976261 0 0.0
(read/write) 576464 576464 0 0.0
.bss 22592 22592 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 546472 546472 0 0.0
.dynamic 624 624 0 0.0
.got 4952 4952 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 463061 463061 0 0.0
.text 7190053 7190053 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 8816212 8816212 0 0.0
(read/write) 642641 642641 0 0.0
.bss 40913 40913 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 581752 581752 0 0.0
.dynamic 560 560 0 0.0
.got 14960 14960 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 430804 430804 0 0.0
.text 6926900 6926900 0 0.0
lighting-app debug+rpc (read only) 2319433 2319433 0 0.0
(read/write) 151392 151392 0 0.0
.bss 73408 73408 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 70248 70248 0 0.0
.dynamic 608 608 0 0.0
.got 4320 4320 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 184489 184489 0 0.0
.text 1968690 1968690 0 0.0
lock-app debug (read only) 2225665 2225665 0 0.0
(read/write) 145976 145976 0 0.0
.bss 72032 72032 0 0.0
.data 1504 1504 0 0.0
.data.rel.ro 66760 66760 0 0.0
.dynamic 592 592 0 0.0
.got 4312 4312 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 194225 194225 0 0.0
.text 1871538 1871538 0 0.0
ota-provider-app debug (read only) 2054209 2054209 0 0.0
(read/write) 138992 138992 0 0.0
.bss 71424 71424 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 60104 60104 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 174971 174971 0 0.0
.text 1722114 1722114 0 0.0
ota-requestor-app debug (read only) 2085329 2085329 0 0.0
(read/write) 141800 141800 0 0.0
.bss 72064 72064 0 0.0
.data 1928 1928 0 0.0
.data.rel.ro 62184 62184 0 0.0
.dynamic 592 592 0 0.0
.got 4320 4320 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 171244 171244 0 0.0
.text 1755474 1755474 0 0.0
shell debug (read only) 2554953 2554953 0 0.0
(read/write) 197104 197104 0 0.0
.bss 114088 114088 0 0.0
.data 1376 1376 0 0.0
.data.rel.ro 75920 75920 0 0.0
.dynamic 592 592 0 0.0
.got 4184 4184 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 216594 216594 0 0.0
.text 2176834 2176834 0 0.0
thermostat-no-ble arm64 (read only) 2360868 2360868 0 0.0
(read/write) 174593 174593 0 0.0
.bss 86273 86273 0 0.0
.data 1496 1496 0 0.0
.data.rel.ro 79048 79048 0 0.0
.dynamic 560 560 0 0.0
.got 4736 4736 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 145748 145748 0 0.0
.text 1985968 1985968 0 0.0
tv-app debug (read only) 2840769 2840769 0 0.0
(read/write) 276608 276608 0 0.0
.bss 189272 189272 0 0.0
.data 4640 4640 0 0.0
.data.rel.ro 76456 76456 0 0.0
.dynamic 592 592 0 0.0
.got 4696 4696 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 217035 217035 0 0.0
.text 2441682 2441682 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2418060 2418060 0 0.0
.bss 205884 205884 0 0.0
.data 5856 5856 0 0.0
.text 1380660 1380660 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180139 1180139 0 0.0
bss 142000 142000 0 0.0
rodata 150804 150804 0 0.0
text 808648 808648 0 0.0
p6 all-clusters-app default (read/write) 2528560 2528560 0 0.0
.bss 139256 139256 0 0.0
.data 2792 2792 0 0.0
.text 1486824 1486824 0 0.0
light-app default (read/write) 2419144 2419144 0 0.0
.bss 132720 132720 0 0.0
.data 2592 2592 0 0.0
.text 1377408 1377408 0 0.0
lock-app default (read/write) 2428432 2428432 0 0.0
.bss 132544 132544 0 0.0
.data 2552 2552 0 0.0
.text 1386696 1386696 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 807680 807680 0 0.0
bss 75432 75432 0 0.0
noinit 40416 40416 0 0.0
text 571300 571300 0 0.0

src/controller/java/AndroidCallbacks.cpp Outdated Show resolved Hide resolved
@g-coppock g-coppock force-pushed the pr/coppock/add_error_handling_attribute_reading branch from 098475b to 6b8b832 Compare May 2, 2022 23:00
@github-actions
Copy link

github-actions bot commented May 2, 2022

PR #17976: Size comparison from d5c4acc to 6b8b832

Full report (34 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section d5c4acc 6b8b832 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 688903 688903 0 0.0
(read/write) 163352 163352 0 0.0
.bss 75236 75236 0 0.0
.data 3400 3400 0 0.0
.rodata 102303 102303 0 0.0
.text 586116 586116 0 0.0
lock-ftd LP_CC2652R7 (read only) 676759 676759 0 0.0
(read/write) 166752 166752 0 0.0
.bss 73548 73548 0 0.0
.data 3224 3224 0 0.0
.rodata 94359 94359 0 0.0
.text 581920 581920 0 0.0
lock-mtd LP_CC2652R7 (read only) 625519 625519 0 0.0
(read/write) 146352 146352 0 0.0
.bss 69268 69268 0 0.0
.data 3224 3224 0 0.0
.rodata 94247 94247 0 0.0
.text 530784 530784 0 0.0
pump-app LP_CC2652R7 (read only) 661267 661267 0 0.0
(read/write) 183484 183484 0 0.0
.bss 73764 73764 0 0.0
.data 3256 3256 0 0.0
.rodata 80387 80387 0 0.0
.text 580396 580396 0 0.0
pump-controller-app LP_CC2652R7 (read only) 654163 654163 0 0.0
(read/write) 190388 190388 0 0.0
.bss 73820 73820 0 0.0
.data 3220 3220 0 0.0
.rodata 83323 83323 0 0.0
.text 570356 570356 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 626362 626362 0 0.0
.app_xip_area 528896 528896 0 0.0
.bss 80116 80116 0 0.0
.data 696 696 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 625074 625074 0 0.0
.app_xip_area 529072 529072 0 0.0
.bss 78692 78692 0 0.0
.data 660 660 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 574210 574210 0 0.0
.app_xip_area 468588 468588 0 0.0
.bss 88016 88016 0 0.0
.data 572 572 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 908184 908184 0 0.0
(read/write) 134528 134528 0 0.0
.bss 132472 132472 0 0.0
.data 2052 2052 0 0.0
.text 908176 908176 0 0.0
BRD4161A+rpc (read only) 942528 942528 0 0.0
(read/write) 151208 151208 0 0.0
.bss 148952 148952 0 0.0
.data 2256 2256 0 0.0
.text 942520 942520 0 0.0
BRD4161A+rs911x (read only) 746548 746548 0 0.0
(read/write) 128752 128752 0 0.0
.bss 126772 126772 0 0.0
.data 1980 1980 0 0.0
.text 746540 746540 0 0.0
lock-app BRD4161A+wf200 (read only) 916560 916560 0 0.0
(read/write) 127540 127540 0 0.0
.bss 125604 125604 0 0.0
.data 1936 1936 0 0.0
.text 916552 916552 0 0.0
window-app BRD4161A (read only) 845416 845416 0 0.0
(read/write) 132616 132616 0 0.0
.bss 130648 130648 0 0.0
.data 1964 1964 0 0.0
.text 845408 845408 0 0.0
esp32 all-clusters-app c3devkit (read only) 999682 999682 0 0.0
(read/write) 1474506 1474506 0 0.0
.dram0.bss 68376 68376 0 0.0
.dram0.data 14428 14428 0 0.0
.flash.rodata 207248 207248 0 0.0
.flash.text 999682 999682 0 0.0
.iram0.text 62020 62020 0 0.0
m5stack (read only) 1054807 1054807 0 0.0
(read/write) 476936 476936 0 0.0
.dram0.bss 73896 73896 0 0.0
.dram0.data 34176 34176 0 0.0
.flash.rodata 237028 237028 0 0.0
.flash.text 1049423 1049423 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 684236 684236 0 0.0
.bss 81320 81320 0 0.0
.data 2008 2008 0 0.0
.text 599204 599204 0 0.0
lock k32w061+release (read/write) 729036 729036 0 0.0
.bss 81744 81744 0 0.0
.data 1968 1968 0 0.0
.text 643620 643620 0 0.0
linux all-clusters-app debug (read only) 2729929 2729929 0 0.0
(read/write) 173144 173144 0 0.0
.bss 83360 83360 0 0.0
.data 2000 2000 0 0.0
.data.rel.ro 81656 81656 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 1008 1008 0 0.0
.rodata 235173 235173 0 0.0
.text 2320130 2320130 0 0.0
bridge-app debug+rpc (read only) 1885025 1885025 0 0.0
(read/write) 120440 120440 0 0.0
.bss 71360 71360 0 0.0
.data 3424 3424 0 0.0
.data.rel.ro 40312 40312 0 0.0
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 688 688 0 0.0
.rodata 160449 160449 0 0.0
.text 1602178 1602178 0 0.0
chip-tool debug (read only) 8976293 8976293 0 0.0
(read/write) 576464 576464 0 0.0
.bss 22592 22592 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 546472 546472 0 0.0
.dynamic 624 624 0 0.0
.got 4952 4952 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 463189 463189 0 0.0
.text 7189957 7189957 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 8816212 8816212 0 0.0
(read/write) 642641 642641 0 0.0
.bss 40913 40913 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 581752 581752 0 0.0
.dynamic 560 560 0 0.0
.got 14960 14960 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 430900 430900 0 0.0
.text 6926804 6926804 0 0.0
lighting-app debug+rpc (read only) 2319385 2319385 0 0.0
(read/write) 151392 151392 0 0.0
.bss 73408 73408 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 70248 70248 0 0.0
.dynamic 608 608 0 0.0
.got 4320 4320 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 184617 184617 0 0.0
.text 1968514 1968514 0 0.0
lock-app debug (read only) 2225601 2225601 0 0.0
(read/write) 145976 145976 0 0.0
.bss 72032 72032 0 0.0
.data 1504 1504 0 0.0
.data.rel.ro 66760 66760 0 0.0
.dynamic 592 592 0 0.0
.got 4312 4312 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 194353 194353 0 0.0
.text 1871346 1871346 0 0.0
ota-provider-app debug (read only) 2054241 2054241 0 0.0
(read/write) 138992 138992 0 0.0
.bss 71424 71424 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 60104 60104 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 175099 175099 0 0.0
.text 1722018 1722018 0 0.0
ota-requestor-app debug (read only) 2085297 2085297 0 0.0
(read/write) 141800 141800 0 0.0
.bss 72064 72064 0 0.0
.data 1928 1928 0 0.0
.data.rel.ro 62184 62184 0 0.0
.dynamic 592 592 0 0.0
.got 4320 4320 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 171372 171372 0 0.0
.text 1755314 1755314 0 0.0
shell debug (read only) 2554985 2554985 0 0.0
(read/write) 197104 197104 0 0.0
.bss 114088 114088 0 0.0
.data 1376 1376 0 0.0
.data.rel.ro 75920 75920 0 0.0
.dynamic 592 592 0 0.0
.got 4184 4184 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 216722 216722 0 0.0
.text 2176738 2176738 0 0.0
thermostat-no-ble arm64 (read only) 2360916 2360916 0 0.0
(read/write) 174593 174593 0 0.0
.bss 86273 86273 0 0.0
.data 1496 1496 0 0.0
.data.rel.ro 79048 79048 0 0.0
.dynamic 560 560 0 0.0
.got 4736 4736 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 145828 145828 0 0.0
.text 1985936 1985936 0 0.0
tv-app debug (read only) 2840833 2840833 0 0.0
(read/write) 276608 276608 0 0.0
.bss 189272 189272 0 0.0
.data 4640 4640 0 0.0
.data.rel.ro 76456 76456 0 0.0
.dynamic 592 592 0 0.0
.got 4696 4696 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 217163 217163 0 0.0
.text 2441618 2441618 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2418124 2418124 0 0.0
.bss 205884 205884 0 0.0
.data 5856 5856 0 0.0
.text 1380724 1380724 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1177691 1177691 0 0.0
bss 139600 139600 0 0.0
rodata 150804 150804 0 0.0
text 808632 808632 0 0.0
p6 all-clusters-app default (read/write) 2528576 2528576 0 0.0
.bss 139256 139256 0 0.0
.data 2792 2792 0 0.0
.text 1486840 1486840 0 0.0
light-app default (read/write) 2419176 2419176 0 0.0
.bss 132720 132720 0 0.0
.data 2592 2592 0 0.0
.text 1377440 1377440 0 0.0
lock-app default (read/write) 2428464 2428464 0 0.0
.bss 132544 132544 0 0.0
.data 2552 2552 0 0.0
.text 1386728 1386728 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 804440 804440 0 0.0
bss 72232 72232 0 0.0
noinit 40416 40416 0 0.0
text 571258 571258 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit a0502f3 into project-chip:master May 3, 2022
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