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

[Tizen] Improve app-preferences get/set/remove functions #18792

Merged
merged 3 commits into from
May 31, 2022

Conversation

arkq
Copy link
Contributor

@arkq arkq commented May 25, 2022

Problem

Out-of-bound read when logging data in KeyValueStoreManagerImpl on Tizen.

Change overview

  • Do not check for key existence before calling get/set functions. The key existence status will be reported by these functions anyway.
  • Prevent memory leaks with scope allocators instead of manually calling free() functions.
  • Prevent out-of-bound read when logging non-string values by passing the data length to the printf-like function with "%.*s" specifier.

Testing

Running example app on Tizen to see whether terminal will not be corrupted after printing non-string data:

I/CHIP    ( 1607): DL: Get data [vendor-id:*]
I/CHIP    ( 1607): DL: Get data [product-id:]
I/CHIP    ( 1607): DIS: Advertise commission parameter vendorID=42 productID=20 discriminator=0000/00

@github-actions
Copy link

github-actions bot commented May 25, 2022

PR #18792: Size comparison from a3fdd05 to 3ee9b09

Full report (37 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section a3fdd05 3ee9b09 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 667479 667479 0 0.0
(read/write) 184368 184368 0 0.0
.bss 74828 74828 0 0.0
.data 3400 3400 0 0.0
.rodata 100103 100103 0 0.0
.text 567148 567148 0 0.0
lock-ftd LP_CC2652R7 (read only) 676511 676511 0 0.0
(read/write) 166328 166328 0 0.0
.bss 72876 72876 0 0.0
.data 3236 3236 0 0.0
.rodata 94551 94551 0 0.0
.text 581476 581476 0 0.0
lock-mtd LP_CC2652R7 (read only) 625919 625919 0 0.0
(read/write) 145708 145708 0 0.0
.bss 68612 68612 0 0.0
.data 3236 3236 0 0.0
.rodata 94431 94431 0 0.0
.text 530996 530996 0 0.0
pump-app LP_CC2652R7 (read only) 676307 676307 0 0.0
(read/write) 167956 167956 0 0.0
.bss 73276 73276 0 0.0
.data 3272 3272 0 0.0
.rodata 88715 88715 0 0.0
.text 587108 587108 0 0.0
pump-controller-app LP_CC2652R7 (read only) 654291 654291 0 0.0
(read/write) 189572 189572 0 0.0
.bss 73132 73132 0 0.0
.data 3232 3232 0 0.0
.rodata 83499 83499 0 0.0
.text 570312 570312 0 0.0
shell LP_CC2652R7 (read only) 660494 660494 0 0.0
(read/write) 186912 186912 0 0.0
.bss 77188 77188 0 0.0
.data 3404 3404 0 0.0
.rodata 97070 97070 0 0.0
.text 563200 563200 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 622134 622134 0 0.0
.app_xip_area 525412 525412 0 0.0
.bss 79364 79364 0 0.0
.data 704 704 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 627450 627450 0 0.0
.app_xip_area 532200 532200 0 0.0
.bss 77924 77924 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 571218 571218 0 0.0
.app_xip_area 466292 466292 0 0.0
.bss 87304 87304 0 0.0
.data 584 584 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 912284 912284 0 0.0
(read/write) 133436 133436 0 0.0
.bss 131384 131384 0 0.0
.data 2052 2052 0 0.0
.text 912276 912276 0 0.0
BRD4161A+rpc (read only) 946456 946456 0 0.0
(read/write) 150128 150128 0 0.0
.bss 147872 147872 0 0.0
.data 2256 2256 0 0.0
.text 946448 946448 0 0.0
BRD4161A+rs911x (read only) 786852 786852 0 0.0
(read/write) 129704 129704 0 0.0
.bss 127644 127644 0 0.0
.data 2060 2060 0 0.0
.text 786844 786844 0 0.0
lock-app BRD4161A+wf200 (read only) 947056 947056 0 0.0
(read/write) 124180 124180 0 0.0
.bss 122156 122156 0 0.0
.data 2024 2024 0 0.0
.text 947048 947048 0 0.0
window-app BRD4161A (read only) 897188 897188 0 0.0
(read/write) 133496 133496 0 0.0
.bss 131448 131448 0 0.0
.data 2048 2048 0 0.0
.text 897180 897180 0 0.0
esp32 all-clusters-app c3devkit (read only) 1001112 1001112 0 0.0
(read/write) 1479114 1479114 0 0.0
.dram0.bss 69392 69392 0 0.0
.dram0.data 14616 14616 0 0.0
.flash.rodata 209672 209672 0 0.0
.flash.text 1001112 1001112 0 0.0
.iram0.text 62954 62954 0 0.0
m5stack (read only) 1056139 1056139 0 0.0
(read/write) 481144 481144 0 0.0
.dram0.bss 74904 74904 0 0.0
.dram0.data 34200 34200 0 0.0
.flash.rodata 240044 240044 0 0.0
.flash.text 1050755 1050755 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 681216 681216 0 0.0
.bss 80424 80424 0 0.0
.data 2008 2008 0 0.0
.text 597080 597080 0 0.0
lock k32w061+release (read/write) 729316 729316 0 0.0
.bss 80856 80856 0 0.0
.data 1976 1976 0 0.0
.text 644780 644780 0 0.0
linux all-clusters-app debug (read only) 2747161 2747161 0 0.0
(read/write) 178240 178240 0 0.0
.bss 86464 86464 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 83560 83560 0 0.0
.dynamic 608 608 0 0.0
.got 4496 4496 0 0.0
.init 27 27 0 0.0
.init_array 1016 1016 0 0.0
.rodata 240317 240317 0 0.0
.text 2333202 2333202 0 0.0
bridge-app debug+rpc (read only) 2022281 2022281 0 0.0
(read/write) 147928 147928 0 0.0
.bss 73152 73152 0 0.0
.data 3936 3936 0 0.0
.data.rel.ro 65272 65272 0 0.0
.dynamic 592 592 0 0.0
.got 4272 4272 0 0.0
.init 27 27 0 0.0
.init_array 688 688 0 0.0
.rodata 167977 167977 0 0.0
.text 1698146 1698146 0 0.0
chip-tool debug (read only) 9609981 9609981 0 0.0
(read/write) 596824 596824 0 0.0
.bss 23968 23968 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 565400 565400 0 0.0
.dynamic 624 624 0 0.0
.got 5008 5008 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 492797 492797 0 0.0
.text 7738005 7738005 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9349380 9349380 0 0.0
(read/write) 663057 663057 0 0.0
.bss 42241 42241 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 600760 600760 0 0.0
.dynamic 560 560 0 0.0
.got 15024 15024 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 456652 456652 0 0.0
.text 7378228 7378228 0 0.0
lighting-app debug+rpc (read only) 2314665 2314665 0 0.0
(read/write) 153536 153536 0 0.0
.bss 74944 74944 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 70792 70792 0 0.0
.dynamic 608 608 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 187017 187017 0 0.0
.text 1962258 1962258 0 0.0
lock-app debug (read only) 2239633 2239633 0 0.0
(read/write) 148600 148600 0 0.0
.bss 73632 73632 0 0.0
.data 1568 1568 0 0.0
.data.rel.ro 67688 67688 0 0.0
.dynamic 592 592 0 0.0
.got 4336 4336 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 198489 198489 0 0.0
.text 1881186 1881186 0 0.0
ota-provider-app debug (read only) 2064873 2064873 0 0.0
(read/write) 141424 141424 0 0.0
.bss 73056 73056 0 0.0
.data 1768 1768 0 0.0
.data.rel.ro 60792 60792 0 0.0
.dynamic 608 608 0 0.0
.got 4504 4504 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 179680 179680 0 0.0
.text 1726626 1726626 0 0.0
ota-requestor-app debug (read only) 2093825 2093825 0 0.0
(read/write) 144232 144232 0 0.0
.bss 73728 73728 0 0.0
.data 1992 1992 0 0.0
.data.rel.ro 62856 62856 0 0.0
.dynamic 592 592 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 175648 175648 0 0.0
.text 1758146 1758146 0 0.0
shell debug (read only) 2563337 2563337 0 0.0
(read/write) 202328 202328 0 0.0
.bss 117416 117416 0 0.0
.data 1376 1376 0 0.0
.data.rel.ro 77776 77776 0 0.0
.dynamic 608 608 0 0.0
.got 4192 4192 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 221362 221362 0 0.0
.text 2181714 2181714 0 0.0
thermostat-no-ble arm64 (read only) 2360276 2360276 0 0.0
(read/write) 177441 177441 0 0.0
.bss 88177 88177 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 79944 79944 0 0.0
.dynamic 560 560 0 0.0
.got 4768 4768 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 147716 147716 0 0.0
.text 1983488 1983488 0 0.0
tv-app debug (read only) 2873497 2873497 0 0.0
(read/write) 280416 280416 0 0.0
.bss 191320 191320 0 0.0
.data 4672 4672 0 0.0
.data.rel.ro 78144 78144 0 0.0
.dynamic 592 592 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 221617 221617 0 0.0
.text 2469394 2469394 0 0.0
tv-casting-app debug (read only) 5438721 5438721 0 0.0
(read/write) 226400 226400 0 0.0
.bss 78904 78904 0 0.0
.data 2400 2400 0 0.0
.data.rel.ro 138888 138888 0 0.0
.dynamic 608 608 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 864 864 0 0.0
.rodata 339841 339841 0 0.0
.text 4739122 4739122 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2419216 2419216 0 0.0
.bss 202852 202852 0 0.0
.data 5872 5872 0 0.0
.text 1381860 1381860 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1181875 1181875 0 0.0
bss 139552 139552 0 0.0
rodata 152844 152844 0 0.0
text 810628 810628 0 0.0
p6 all-clusters-app default (read/write) 2537544 2537544 0 0.0
.bss 137352 137352 0 0.0
.data 2800 2800 0 0.0
.text 1495808 1495808 0 0.0
light-app default (read/write) 2420856 2420856 0 0.0
.bss 129688 129688 0 0.0
.data 2600 2600 0 0.0
.text 1379120 1379120 0 0.0
lock-app default (read/write) 2435136 2435136 0 0.0
.bss 129496 129496 0 0.0
.data 2568 2568 0 0.0
.text 1393400 1393400 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 780088 780088 0 0.0
bss 70824 70824 0 0.0
noinit 40416 40416 0 0.0
text 551574 551574 0 0.0
lighting-app tlsr9518adk80d (read/write) 800104 800104 0 0.0
bss 71076 71076 0 0.0
noinit 40416 40416 0 0.0
text 568308 568308 0 0.0

@arkq arkq force-pushed the tizen-app-prefs branch 2 times, most recently from 8d3ad05 to a003d88 Compare May 25, 2022 13:04
@github-actions
Copy link

github-actions bot commented May 25, 2022

PR #18792: Size comparison from a3fdd05 to a003d88

Full report (37 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section a3fdd05 a003d88 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 667479 667479 0 0.0
(read/write) 184368 184368 0 0.0
.bss 74828 74828 0 0.0
.data 3400 3400 0 0.0
.rodata 100103 100103 0 0.0
.text 567148 567148 0 0.0
lock-ftd LP_CC2652R7 (read only) 676511 676511 0 0.0
(read/write) 166328 166328 0 0.0
.bss 72876 72876 0 0.0
.data 3236 3236 0 0.0
.rodata 94551 94551 0 0.0
.text 581476 581476 0 0.0
lock-mtd LP_CC2652R7 (read only) 625919 625919 0 0.0
(read/write) 145708 145708 0 0.0
.bss 68612 68612 0 0.0
.data 3236 3236 0 0.0
.rodata 94431 94431 0 0.0
.text 530996 530996 0 0.0
pump-app LP_CC2652R7 (read only) 676307 676307 0 0.0
(read/write) 167956 167956 0 0.0
.bss 73276 73276 0 0.0
.data 3272 3272 0 0.0
.rodata 88715 88715 0 0.0
.text 587108 587108 0 0.0
pump-controller-app LP_CC2652R7 (read only) 654291 654291 0 0.0
(read/write) 189572 189572 0 0.0
.bss 73132 73132 0 0.0
.data 3232 3232 0 0.0
.rodata 83499 83499 0 0.0
.text 570312 570312 0 0.0
shell LP_CC2652R7 (read only) 660494 660494 0 0.0
(read/write) 186912 186912 0 0.0
.bss 77188 77188 0 0.0
.data 3404 3404 0 0.0
.rodata 97070 97070 0 0.0
.text 563200 563200 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 622134 622134 0 0.0
.app_xip_area 525412 525412 0 0.0
.bss 79364 79364 0 0.0
.data 704 704 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 627450 627450 0 0.0
.app_xip_area 532200 532200 0 0.0
.bss 77924 77924 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 571218 571218 0 0.0
.app_xip_area 466292 466292 0 0.0
.bss 87304 87304 0 0.0
.data 584 584 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 912284 912284 0 0.0
(read/write) 133436 133436 0 0.0
.bss 131384 131384 0 0.0
.data 2052 2052 0 0.0
.text 912276 912276 0 0.0
BRD4161A+rpc (read only) 946456 946456 0 0.0
(read/write) 150128 150128 0 0.0
.bss 147872 147872 0 0.0
.data 2256 2256 0 0.0
.text 946448 946448 0 0.0
BRD4161A+rs911x (read only) 786852 786852 0 0.0
(read/write) 129704 129704 0 0.0
.bss 127644 127644 0 0.0
.data 2060 2060 0 0.0
.text 786844 786844 0 0.0
lock-app BRD4161A+wf200 (read only) 947056 947056 0 0.0
(read/write) 124180 124180 0 0.0
.bss 122156 122156 0 0.0
.data 2024 2024 0 0.0
.text 947048 947048 0 0.0
window-app BRD4161A (read only) 897188 897188 0 0.0
(read/write) 133496 133496 0 0.0
.bss 131448 131448 0 0.0
.data 2048 2048 0 0.0
.text 897180 897180 0 0.0
esp32 all-clusters-app c3devkit (read only) 1001112 1001112 0 0.0
(read/write) 1479114 1479114 0 0.0
.dram0.bss 69392 69392 0 0.0
.dram0.data 14616 14616 0 0.0
.flash.rodata 209672 209672 0 0.0
.flash.text 1001112 1001112 0 0.0
.iram0.text 62954 62954 0 0.0
m5stack (read only) 1056139 1056139 0 0.0
(read/write) 481144 481144 0 0.0
.dram0.bss 74904 74904 0 0.0
.dram0.data 34200 34200 0 0.0
.flash.rodata 240044 240044 0 0.0
.flash.text 1050755 1050755 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 681216 681216 0 0.0
.bss 80424 80424 0 0.0
.data 2008 2008 0 0.0
.text 597080 597080 0 0.0
lock k32w061+release (read/write) 729316 729316 0 0.0
.bss 80856 80856 0 0.0
.data 1976 1976 0 0.0
.text 644780 644780 0 0.0
linux all-clusters-app debug (read only) 2747161 2747161 0 0.0
(read/write) 178240 178240 0 0.0
.bss 86464 86464 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 83560 83560 0 0.0
.dynamic 608 608 0 0.0
.got 4496 4496 0 0.0
.init 27 27 0 0.0
.init_array 1016 1016 0 0.0
.rodata 240317 240317 0 0.0
.text 2333202 2333202 0 0.0
bridge-app debug+rpc (read only) 2022281 2022281 0 0.0
(read/write) 147928 147928 0 0.0
.bss 73152 73152 0 0.0
.data 3936 3936 0 0.0
.data.rel.ro 65272 65272 0 0.0
.dynamic 592 592 0 0.0
.got 4272 4272 0 0.0
.init 27 27 0 0.0
.init_array 688 688 0 0.0
.rodata 167977 167977 0 0.0
.text 1698146 1698146 0 0.0
chip-tool debug (read only) 9609981 9609981 0 0.0
(read/write) 596824 596824 0 0.0
.bss 23968 23968 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 565400 565400 0 0.0
.dynamic 624 624 0 0.0
.got 5008 5008 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 492797 492797 0 0.0
.text 7738005 7738005 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9349380 9349380 0 0.0
(read/write) 663057 663057 0 0.0
.bss 42241 42241 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 600760 600760 0 0.0
.dynamic 560 560 0 0.0
.got 15024 15024 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 456652 456652 0 0.0
.text 7378228 7378228 0 0.0
lighting-app debug+rpc (read only) 2314665 2314665 0 0.0
(read/write) 153536 153536 0 0.0
.bss 74944 74944 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 70792 70792 0 0.0
.dynamic 608 608 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 187017 187017 0 0.0
.text 1962258 1962258 0 0.0
lock-app debug (read only) 2239633 2239633 0 0.0
(read/write) 148600 148600 0 0.0
.bss 73632 73632 0 0.0
.data 1568 1568 0 0.0
.data.rel.ro 67688 67688 0 0.0
.dynamic 592 592 0 0.0
.got 4336 4336 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 198489 198489 0 0.0
.text 1881186 1881186 0 0.0
ota-provider-app debug (read only) 2064873 2064873 0 0.0
(read/write) 141424 141424 0 0.0
.bss 73056 73056 0 0.0
.data 1768 1768 0 0.0
.data.rel.ro 60792 60792 0 0.0
.dynamic 608 608 0 0.0
.got 4504 4504 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 179680 179680 0 0.0
.text 1726626 1726626 0 0.0
ota-requestor-app debug (read only) 2093825 2093825 0 0.0
(read/write) 144232 144232 0 0.0
.bss 73728 73728 0 0.0
.data 1992 1992 0 0.0
.data.rel.ro 62856 62856 0 0.0
.dynamic 592 592 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 175648 175648 0 0.0
.text 1758146 1758146 0 0.0
shell debug (read only) 2563337 2563337 0 0.0
(read/write) 202328 202328 0 0.0
.bss 117416 117416 0 0.0
.data 1376 1376 0 0.0
.data.rel.ro 77776 77776 0 0.0
.dynamic 608 608 0 0.0
.got 4192 4192 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 221362 221362 0 0.0
.text 2181714 2181714 0 0.0
thermostat-no-ble arm64 (read only) 2360276 2360276 0 0.0
(read/write) 177441 177441 0 0.0
.bss 88177 88177 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 79944 79944 0 0.0
.dynamic 560 560 0 0.0
.got 4768 4768 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 147716 147716 0 0.0
.text 1983488 1983488 0 0.0
tv-app debug (read only) 2873497 2873497 0 0.0
(read/write) 280416 280416 0 0.0
.bss 191320 191320 0 0.0
.data 4672 4672 0 0.0
.data.rel.ro 78144 78144 0 0.0
.dynamic 592 592 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 221617 221617 0 0.0
.text 2469394 2469394 0 0.0
tv-casting-app debug (read only) 5438721 5438721 0 0.0
(read/write) 226400 226400 0 0.0
.bss 78904 78904 0 0.0
.data 2400 2400 0 0.0
.data.rel.ro 138888 138888 0 0.0
.dynamic 608 608 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 864 864 0 0.0
.rodata 339841 339841 0 0.0
.text 4739122 4739122 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2419216 2419216 0 0.0
.bss 202852 202852 0 0.0
.data 5872 5872 0 0.0
.text 1381860 1381860 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1181875 1181875 0 0.0
bss 139552 139552 0 0.0
rodata 152844 152844 0 0.0
text 810628 810628 0 0.0
p6 all-clusters-app default (read/write) 2537544 2537544 0 0.0
.bss 137352 137352 0 0.0
.data 2800 2800 0 0.0
.text 1495808 1495808 0 0.0
light-app default (read/write) 2420856 2420856 0 0.0
.bss 129688 129688 0 0.0
.data 2600 2600 0 0.0
.text 1379120 1379120 0 0.0
lock-app default (read/write) 2435136 2435136 0 0.0
.bss 129496 129496 0 0.0
.data 2568 2568 0 0.0
.text 1393400 1393400 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 780088 780088 0 0.0
bss 70824 70824 0 0.0
noinit 40416 40416 0 0.0
text 551574 551574 0 0.0
lighting-app tlsr9518adk80d (read/write) 800104 800104 0 0.0
bss 71076 71076 0 0.0
noinit 40416 40416 0 0.0
text 568308 568308 0 0.0

src/platform/Tizen/AppPreference.cpp Show resolved Hide resolved
src/platform/Tizen/AppPreference.cpp Outdated Show resolved Hide resolved
arkq added 3 commits May 30, 2022 08:34
Improvements:

- Do not check for key existence before calling get/set functions. The
	key existence status will be reported by these functions anyway.

- Prevent memory leaks with scope allocators instead of manually calling
	free() functions.

- Prevent out-of-bound read when logging non-string values by passing
	the data length to the printf-like function with "%.*s" specifier.
Using ternary "if"s with logging macros forbids using simple
augmentation with file name and/or line number, e.g.:

	#define ChipLogError(MOD, MSG, ...) \
	  ::Log(MOD, "%s:%d " MSG, __FILE__, __LINE__, ##__VA_ARGS__)
@arkq arkq force-pushed the tizen-app-prefs branch from c155e13 to 110eac1 Compare May 30, 2022 06:36
@github-actions
Copy link

github-actions bot commented May 30, 2022

PR #18792: Size comparison from 4d84a4a to 110eac1

Full report (30 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 4d84a4a 110eac1 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 647575 647575 0 0.0
(read/write) 158928 158928 0 0.0
.bss 74612 74612 0 0.0
.data 3400 3400 0 0.0
.rodata 84159 84159 0 0.0
.text 563180 563180 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 613591 613591 0 0.0
(read/write) 158156 158156 0 0.0
.bss 73900 73900 0 0.0
.data 3340 3340 0 0.0
.rodata 73471 73471 0 0.0
.text 539884 539884 0 0.0
lock-ftd LP_CC2652R7 (read only) 679559 679559 0 0.0
(read/write) 163296 163296 0 0.0
.bss 72636 72636 0 0.0
.data 3264 3264 0 0.0
.rodata 96135 96135 0 0.0
.text 582940 582940 0 0.0
lock-mtd LP_CC2652R7 (read only) 628967 628967 0 0.0
(read/write) 145752 145752 0 0.0
.bss 68372 68372 0 0.0
.data 3264 3264 0 0.0
.rodata 96015 96015 0 0.0
.text 532460 532460 0 0.0
pump-app LP_CC2652R7 (read only) 675971 675971 0 0.0
(read/write) 168052 168052 0 0.0
.bss 73036 73036 0 0.0
.data 3300 3300 0 0.0
.rodata 88611 88611 0 0.0
.text 586876 586876 0 0.0
pump-controller-app LP_CC2652R7 (read only) 653907 653907 0 0.0
(read/write) 189972 189972 0 0.0
.bss 72892 72892 0 0.0
.data 3260 3260 0 0.0
.rodata 83347 83347 0 0.0
.text 570080 570080 0 0.0
shell LP_CC2652R7 (read only) 640606 640606 0 0.0
(read/write) 154484 154484 0 0.0
.bss 76964 76964 0 0.0
.data 3404 3404 0 0.0
.rodata 81142 81142 0 0.0
.text 559232 559232 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 621506 621506 0 0.0
.app_xip_area 525012 525012 0 0.0
.bss 79136 79136 0 0.0
.data 704 704 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 630214 630214 0 0.0
.app_xip_area 535192 535192 0 0.0
.bss 77696 77696 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 570838 570838 0 0.0
.app_xip_area 465896 465896 0 0.0
.bss 87296 87296 0 0.0
.data 612 612 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 914272 914272 0 0.0
(read/write) 133216 133216 0 0.0
.bss 131120 131120 0 0.0
.data 2092 2092 0 0.0
.text 914264 914264 0 0.0
BRD4161A+rpc (read only) 948508 948508 0 0.0
(read/write) 149904 149904 0 0.0
.bss 147608 147608 0 0.0
.data 2296 2296 0 0.0
.text 948500 948500 0 0.0
BRD4161A+rs911x (read only) 788836 788836 0 0.0
(read/write) 129488 129488 0 0.0
.bss 127388 127388 0 0.0
.data 2100 2100 0 0.0
.text 788828 788828 0 0.0
lock-app BRD4161A+wf200 (read only) 954064 954064 0 0.0
(read/write) 128268 128268 0 0.0
.bss 126204 126204 0 0.0
.data 2064 2064 0 0.0
.text 954056 954056 0 0.0
window-app BRD4161A (read only) 899216 899216 0 0.0
(read/write) 133280 133280 0 0.0
.bss 131192 131192 0 0.0
.data 2088 2088 0 0.0
.text 899208 899208 0 0.0
esp32 all-clusters-app c3devkit (read only) 1004814 1004814 0 0.0
(read/write) 1479522 1479522 0 0.0
.dram0.bss 69176 69176 0 0.0
.dram0.data 14648 14648 0 0.0
.flash.rodata 210256 210256 0 0.0
.flash.text 1004814 1004814 0 0.0
.iram0.text 62954 62954 0 0.0
m5stack (read only) 1059995 1059995 0 0.0
(read/write) 481744 481744 0 0.0
.dram0.bss 74696 74696 0 0.0
.dram0.data 34208 34208 0 0.0
.flash.rodata 240844 240844 0 0.0
.flash.text 1054611 1054611 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 680676 680676 0 0.0
.bss 80200 80200 0 0.0
.data 2008 2008 0 0.0
.text 596764 596764 0 0.0
lock k32w061+release (read/write) 732092 732092 0 0.0
.bss 80632 80632 0 0.0
.data 1976 1976 0 0.0
.text 647780 647780 0 0.0
linux chip-tool-no-interactive-ipv6only arm64 (read only) 9422028 9422028 0 0.0
(read/write) 668785 668785 0 0.0
.bss 42257 42257 0 0.0
.data 1176 1176 0 0.0
.data.rel.ro 606528 606528 0 0.0
.dynamic 528 528 0 0.0
.got 15016 15016 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 459956 459956 0 0.0
.text 7434004 7434004 0 0.0
thermostat-no-ble arm64 (read only) 2365900 2365900 0 0.0
(read/write) 177313 177313 0 0.0
.bss 87969 87969 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 80016 80016 0 0.0
.dynamic 528 528 0 0.0
.got 4800 4800 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 148156 148156 0 0.0
.text 1988624 1988624 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2424480 2424480 0 0.0
.bss 202652 202652 0 0.0
.data 5872 5872 0 0.0
.text 1387124 1387124 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1185703 1185703 0 0.0
bss 139308 139308 0 0.0
rodata 153488 153488 0 0.0
text 814036 814036 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1133579 1133579 0 0.0
bss 138600 138600 0 0.0
rodata 129972 129972 0 0.0
text 786264 786264 0 0.0
p6 all-clusters-app default (read/write) 2539952 2539952 0 0.0
.bss 137136 137136 0 0.0
.data 2800 2800 0 0.0
.text 1498216 1498216 0 0.0
all-clusters-minimal-app default (read/write) 2484712 2484712 0 0.0
.bss 136424 136424 0 0.0
.data 2744 2744 0 0.0
.text 1442976 1442976 0 0.0
light-app default (read/write) 2420192 2420192 0 0.0
.bss 129464 129464 0 0.0
.data 2600 2600 0 0.0
.text 1378456 1378456 0 0.0
lock-app default (read/write) 2438216 2438216 0 0.0
.bss 129280 129280 0 0.0
.data 2568 2568 0 0.0
.text 1396480 1396480 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 779464 779464 0 0.0
bss 70596 70596 0 0.0
noinit 40416 40416 0 0.0
text 551326 551326 0 0.0
lighting-app tlsr9518adk80d (read/write) 799492 799492 0 0.0
bss 70856 70856 0 0.0
noinit 40416 40416 0 0.0
text 568060 568060 0 0.0

@arkq arkq merged commit 6a871ad into project-chip:master May 31, 2022
@arkq arkq deleted the tizen-app-prefs branch May 31, 2022 18:09
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.

3 participants