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

Issue 15578 - assert before refcount overflow #22103

Conversation

jtung-apple
Copy link
Contributor

Problem

As Issue #15578 points out - there is no protection for overflowing the refcount of PacketBuffer, and when that happens, another AddRef/Free would result in this memory getting deallocated, while there are still UINT16_MAX holders of the pointer, leading to use-after-free.

We could potentially have PacketBufferHandle do a check, and hold some error state, but 1) this doesn't prevent PacketBuffer itself from being broken, and 2) the change may introduce other issues.

Capping the refcount or making the refcount type larger just delay the use-after-free problem.

Seems like there is likely some other severe bug if the refcount gets incremented so much that it's about to overflow, and so making an assert here - to abort safely if this unexpected scenario should occur - is the only solution that makes sense.

Change overview

Before incrementing the refcount assert that the value is not already UINT16_MAX.

Testing

No testing done - this is a fairly trivial sanity safeguard for an edge case.

@github-actions
Copy link

github-actions bot commented Aug 23, 2022

PR #22103: Size comparison from 4ab1882 to c0bd50f

Increases (33 builds for cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, psoc6, telink)
platform target config section 4ab1882 c0bd50f change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 178460 178492 32 0.0
lock-ftd LP_CC2652R7 (read/write) 167552 167584 32 0.0
lock-mtd LP_CC2652R7 (read/write) 180480 180512 32 0.0
pump-app LP_CC2652R7 (read/write) 157688 157720 32 0.0
pump-controller-app LP_CC2652R7 (read/write) 173300 173332 32 0.0
shell LP_CC2652R7 (read/write) 181296 181320 24 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586746 586762 16 0.0
.app_xip_area 463404 463420 16 0.0
lock cyw930739m2evb_01 (read/write) 592546 592562 16 0.0
.app_xip_area 464420 464436 16 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599674 599746 72 0.0
.app_xip_area 477052 477124 72 0.0
efr32 lighting-app BRD4161A (read/write) 1107636 1107676 40 0.0
.text 969212 969252 40 0.0
BRD4161A+rpc (read/write) 971588 971652 64 0.0
.text 818468 818532 64 0.0
window-app BRD4161A (read/write) 1098932 1098980 48 0.0
.text 959044 959092 48 0.0
k32w light k32w0+release (read/write) 646676 646692 16 0.0
.text 571480 571496 16 0.0
linux all-clusters-app debug (read only) 3038505 3038601 96 0.0
.rodata 274667 274699 32 0.0
.text 2584690 2584754 64 0.0
all-clusters-minimal-app debug (read only) 2874369 2874449 80 0.0
.rodata 274859 274891 32 0.0
.text 2423138 2423186 48 0.0
bridge-app debug+rpc (read only) 2373017 2373097 80 0.0
.rodata 203496 203528 32 0.0
.text 2006898 2006946 48 0.0
chip-tool debug (read only) 10878753 10878833 80 0.0
.rodata 562965 562997 32 0.0
.text 8809060 8809108 48 0.0
chip-tool-ipv6only arm64 (read only) 10261012 10261124 112 0.0
.rodata 493572 493604 32 0.0
.text 8129284 8129364 80 0.0
lighting-app debug+rpc (read only) 2597849 2597929 80 0.0
.rodata 220400 220432 32 0.0
.text 2206546 2206594 48 0.0
lock-app debug (read only) 2580945 2581025 80 0.0
.rodata 237360 237392 32 0.0
.text 2176930 2176978 48 0.0
ota-provider-app debug (read only) 2358105 2358185 80 0.0
.rodata 209336 209368 32 0.0
.text 1985298 1985346 48 0.0
ota-requestor-app debug (read only) 2523705 2523785 80 0.0
.rodata 216160 216192 32 0.0
.text 2134930 2134978 48 0.0
shell debug (read only) 2606809 2606889 80 0.0
.rodata 234770 234802 32 0.0
.text 2213618 2213666 48 0.0
thermostat-no-ble arm64 (read only) 2357300 2357412 112 0.0
.rodata 140620 140652 32 0.0
.text 1978960 1979040 80 0.0
tv-app debug (read only) 3183433 3183513 80 0.0
.rodata 259112 259144 32 0.0
.text 2734578 2734626 48 0.0
tv-casting-app debug (read only) 5503985 5504065 80 0.0
.rodata 344305 344337 32 0.0
.text 4888066 4888114 48 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2454536 2454632 96 0.0
.text 1417180 1417276 96 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180799 1180863 64 0.0
rodata 143360 143392 32 0.0
text 814736 814760 24 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159883 1159931 48 0.0
rodata 134948 134980 32 0.0
text 803144 803168 24 0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_info 26644546 26644547 1 0.0
light cy8ckit_062s2_43012 .debug_info 21845797 21845798 1 0.0
telink light-switch-app tlsr9518adk80d (read/write) 808744 808800 56 0.0
text 571322 571348 26 0.0
lighting-app tlsr9518adk80d (read/write) 830680 830736 56 0.0
text 589412 589436 24 0.0
Decreases (10 builds for bl602, cc13x2_26x2, psoc6)
platform target config section 4ab1882 c0bd50f change % change
bl602 lighting-app bl602 .text 1051100 1051096 -4 -0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 673035 673003 -32 -0.0
.text 583884 583852 -32 -0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637755 637715 -40 -0.0
.text 559452 559412 -40 -0.0
lock-ftd LP_CC2652R7 (read only) 674151 674119 -32 -0.0
.text 597000 596968 -32 -0.0
lock-mtd LP_CC2652R7 (read only) 656911 656879 -32 -0.0
.text 554664 554632 -32 -0.0
pump-app LP_CC2652R7 (read only) 684823 684791 -32 -0.0
.text 594380 594348 -32 -0.0
pump-controller-app LP_CC2652R7 (read only) 669331 669299 -32 -0.0
.text 583336 583304 -32 -0.0
shell LP_CC2652R7 (read only) 665718 665694 -24 -0.0
.text 579620 579596 -24 -0.0
psoc6 all-clusters-minimal cy8ckit_062s2_43012 .debug_info 26381242 26381241 -1 -0.0
lock cy8ckit_062s2_43012 .debug_info 22200966 22200965 -1 -0.0
Full report (43 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
platform target config section 4ab1882 c0bd50f change % change
bl602 lighting-app bl602 (read/write) 1383930 1383930 0 0.0
.bss 120266 120266 0 0.0
.data 4480 4480 0 0.0
.text 1051100 1051096 -4 -0.0
bl602+rpc (read/write) 1429586 1429586 0 0.0
.bss 127706 127706 0 0.0
.data 4600 4600 0 0.0
.text 1082856 1082856 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 673035 673003 -32 -0.0
(read/write) 178460 178492 32 0.0
.bss 74388 74388 0 0.0
.data 3372 3372 0 0.0
.rodata 88835 88835 0 0.0
.text 583884 583852 -32 -0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637755 637715 -40 -0.0
(read/write) 157948 157948 0 0.0
.bss 73660 73660 0 0.0
.data 3372 3372 0 0.0
.rodata 77979 77979 0 0.0
.text 559452 559412 -40 -0.0
lock-ftd LP_CC2652R7 (read only) 674151 674119 -32 -0.0
(read/write) 167552 167584 32 0.0
.bss 71484 71484 0 0.0
.data 3296 3296 0 0.0
.rodata 76671 76671 0 0.0
.text 597000 596968 -32 -0.0
lock-mtd LP_CC2652R7 (read only) 656911 656879 -32 -0.0
(read/write) 180480 180512 32 0.0
.bss 67172 67172 0 0.0
.data 3296 3296 0 0.0
.rodata 101767 101767 0 0.0
.text 554664 554632 -32 -0.0
pump-app LP_CC2652R7 (read only) 684823 684791 -32 -0.0
(read/write) 157688 157720 32 0.0
.bss 71524 71524 0 0.0
.data 3296 3296 0 0.0
.rodata 89959 89959 0 0.0
.text 594380 594348 -32 -0.0
pump-controller-app LP_CC2652R7 (read only) 669331 669299 -32 -0.0
(read/write) 173300 173332 32 0.0
.bss 71644 71644 0 0.0
.data 3292 3292 0 0.0
.rodata 85515 85515 0 0.0
.text 583336 583304 -32 -0.0
shell LP_CC2652R7 (read only) 665718 665694 -24 -0.0
(read/write) 181296 181320 24 0.0
.bss 76708 76708 0 0.0
.data 3376 3376 0 0.0
.rodata 85782 85782 0 0.0
.text 579620 579596 -24 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586746 586762 16 0.0
.app_xip_area 463404 463420 16 0.0
.bss 65776 65776 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 592546 592562 16 0.0
.app_xip_area 464420 464436 16 0.0
.bss 70560 70560 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599674 599746 72 0.0
.app_xip_area 477052 477124 72 0.0
.bss 65088 65088 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1107636 1107676 40 0.0
.bss 136332 136332 0 0.0
.data 2072 2072 0 0.0
.text 969212 969252 40 0.0
BRD4161A+rpc (read/write) 971588 971652 64 0.0
.bss 150844 150844 0 0.0
.data 2252 2252 0 0.0
.text 818468 818532 64 0.0
BRD4161A+rs911x (read/write) 1000248 1000248 0 0.0
.bss 169088 169088 0 0.0
.data 2056 2056 0 0.0
.text 829084 829084 0 0.0
lock-app BRD4161A+wf200 (read/write) 1149420 1149420 0 0.0
.bss 152168 152168 0 0.0
.data 2064 2064 0 0.0
.text 995168 995168 0 0.0
window-app BRD4161A (read/write) 1098932 1098980 48 0.0
.bss 137772 137772 0 0.0
.data 2096 2096 0 0.0
.text 959044 959092 48 0.0
esp32 all-clusters-app c3devkit (read only) 1031286 1031286 0 0.0
(read/write) 1489642 1489642 0 0.0
.dram0.bss 71144 71144 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 218456 218456 0 0.0
.flash.text 1031286 1031286 0 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1084403 1084403 0 0.0
(read/write) 491560 491560 0 0.0
.dram0.bss 76648 76648 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 248772 248772 0 0.0
.flash.text 1079019 1079019 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w0+release (read/write) 646676 646692 16 0.0
.bss 70400 70400 0 0.0
.data 2068 2068 0 0.0
.text 571480 571496 16 0.0
lock k32w0+release (read/write) 704220 704220 0 0.0
.bss 70864 70864 0 0.0
.data 2076 2076 0 0.0
.text 628552 628552 0 0.0
linux all-clusters-app debug (read only) 3038505 3038601 96 0.0
(read/write) 156024 156024 0 0.0
.bss 61920 61920 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 85624 85624 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 1168 1168 0 0.0
.rodata 274667 274699 32 0.0
.text 2584690 2584754 64 0.0
all-clusters-minimal-app debug (read only) 2874369 2874449 80 0.0
(read/write) 147624 147624 0 0.0
.bss 61152 61152 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 78120 78120 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1152 1152 0 0.0
.rodata 274859 274891 32 0.0
.text 2423138 2423186 48 0.0
bridge-app debug+rpc (read only) 2373017 2373097 80 0.0
(read/write) 127584 127584 0 0.0
.bss 50656 50656 0 0.0
.data 3600 3600 0 0.0
.data.rel.ro 67464 67464 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 203496 203528 32 0.0
.text 2006898 2006946 48 0.0
chip-tool debug (read only) 10878753 10878833 80 0.0
(read/write) 651328 651328 0 0.0
.bss 25240 25240 0 0.0
.data 3266 3266 0 0.0
.data.rel.ro 616312 616312 0 0.0
.dynamic 608 608 0 0.0
.got 5096 5096 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 562965 562997 32 0.0
.text 8809060 8809108 48 0.0
chip-tool-ipv6only arm64 (read only) 10261012 10261124 112 0.0
(read/write) 699169 699169 0 0.0
.bss 33297 33297 0 0.0
.data 3272 3272 0 0.0
.data.rel.ro 643848 643848 0 0.0
.dynamic 560 560 0 0.0
.got 13784 13784 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 493572 493604 32 0.0
.text 8129284 8129364 80 0.0
lighting-app debug+rpc (read only) 2597849 2597929 80 0.0
(read/write) 130304 130304 0 0.0
.bss 49760 49760 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 72488 72488 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 220400 220432 32 0.0
.text 2206546 2206594 48 0.0
lock-app debug (read only) 2580945 2581025 80 0.0
(read/write) 125512 125512 0 0.0
.bss 48288 48288 0 0.0
.data 1712 1712 0 0.0
.data.rel.ro 69512 69512 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 896 896 0 0.0
.rodata 237360 237392 32 0.0
.text 2176930 2176978 48 0.0
ota-provider-app debug (read only) 2358105 2358185 80 0.0
(read/write) 118976 118976 0 0.0
.bss 47808 47808 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 63336 63336 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 760 760 0 0.0
.rodata 209336 209368 32 0.0
.text 1985298 1985346 48 0.0
ota-requestor-app debug (read only) 2523705 2523785 80 0.0
(read/write) 127384 127384 0 0.0
.bss 50368 50368 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 68744 68744 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 848 848 0 0.0
.rodata 216160 216192 32 0.0
.text 2134930 2134978 48 0.0
shell debug (read only) 2606809 2606889 80 0.0
(read/write) 142144 142144 0 0.0
.bss 57832 57832 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 77224 77224 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 234770 234802 32 0.0
.text 2213618 2213666 48 0.0
thermostat-no-ble arm64 (read only) 2357300 2357412 112 0.0
(read/write) 141825 141825 0 0.0
.bss 55345 55345 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 75984 75984 0 0.0
.dynamic 560 560 0 0.0
.got 5048 5048 0 0.0
.init 24 24 0 0.0
.init_array 408 408 0 0.0
.rodata 140620 140652 32 0.0
.text 1978960 1979040 80 0.0
tv-app debug (read only) 3183433 3183513 80 0.0
(read/write) 257968 257968 0 0.0
.bss 167480 167480 0 0.0
.data 4736 4736 0 0.0
.data.rel.ro 79184 79184 0 0.0
.dynamic 608 608 0 0.0
.got 4856 4856 0 0.0
.init 27 27 0 0.0
.init_array 1072 1072 0 0.0
.rodata 259112 259144 32 0.0
.text 2734578 2734626 48 0.0
tv-casting-app debug (read only) 5503985 5504065 80 0.0
(read/write) 160464 160464 0 0.0
.bss 51480 51480 0 0.0
.data 2432 2432 0 0.0
.data.rel.ro 100120 100120 0 0.0
.dynamic 608 608 0 0.0
.got 4776 4776 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 344305 344337 32 0.0
.text 4888066 4888114 48 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2454536 2454632 96 0.0
.bss 215044 215044 0 0.0
.data 5872 5872 0 0.0
.text 1417180 1417276 96 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180799 1180863 64 0.0
bss 143745 143745 0 0.0
rodata 143360 143392 32 0.0
text 814736 814760 24 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159883 1159931 48 0.0
bss 142972 142972 0 0.0
rodata 134948 134980 32 0.0
text 803144 803168 24 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 881000 881000 0 0.0
(read/write) 1700996 1700996 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 149688 149688 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2656 2656 0 0.0
.debug_abbrev 1217459 1217459 0 0.0
.debug_aranges 111544 111544 0 0.0
.debug_frame 372408 372408 0 0.0
.debug_info 26644546 26644547 1 0.0
.debug_line 3647170 3647170 0 0.0
.debug_loc 3562765 3562765 0 0.0
.debug_ranges 336664 336664 0 0.0
.debug_str 3394161 3394161 0 0.0
.heap 881000 881000 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 569346 569346 0 0.0
.symtab 420416 420416 0 0.0
.text 1540264 1540264 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 881736 881736 0 0.0
(read/write) 1644204 1644204 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 148952 148952 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2656 2656 0 0.0
.debug_abbrev 1209298 1209298 0 0.0
.debug_aranges 111016 111016 0 0.0
.debug_frame 375488 375488 0 0.0
.debug_info 26381242 26381241 -1 -0.0
.debug_line 3667574 3667574 0 0.0
.debug_loc 3550402 3550402 0 0.0
.debug_ranges 335280 335280 0 0.0
.debug_str 3383150 3383150 0 0.0
.heap 881736 881736 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 533820 533820 0 0.0
.symtab 407008 407008 0 0.0
.text 1484208 1484208 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 890080 890080 0 0.0
(read/write) 1561436 1561436 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 140816 140816 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2448 2448 0 0.0
.debug_abbrev 1043971 1043971 0 0.0
.debug_aranges 103184 103184 0 0.0
.debug_frame 345732 345732 0 0.0
.debug_info 21845797 21845798 1 0.0
.debug_line 3238758 3238758 0 0.0
.debug_loc 3249979 3249979 0 0.0
.debug_ranges 301120 301120 0 0.0
.debug_str 3189244 3189244 0 0.0
.heap 890080 890080 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 467101 467101 0 0.0
.symtab 374064 374064 0 0.0
.text 1409784 1409784 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 885584 885584 0 0.0
(read/write) 1598724 1598724 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 145296 145296 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2464 2464 0 0.0
.debug_abbrev 1051147 1051147 0 0.0
.debug_aranges 103856 103856 0 0.0
.debug_frame 348556 348556 0 0.0
.debug_info 22200966 22200965 -1 -0.0
.debug_line 3247442 3247442 0 0.0
.debug_loc 3290068 3290068 0 0.0
.debug_ranges 304536 304536 0 0.0
.debug_str 3216675 3216675 0 0.0
.heap 885584 885584 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 473342 473342 0 0.0
.symtab 377248 377248 0 0.0
.text 1442576 1442576 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 808744 808800 56 0.0
bss 71448 71448 0 0.0
noinit 43488 43488 0 0.0
text 571322 571348 26 0.0
lighting-app tlsr9518adk80d (read/write) 830680 830736 56 0.0
bss 72304 72304 0 0.0
noinit 43488 43488 0 0.0
text 589412 589436 24 0.0

@woody-apple woody-apple enabled auto-merge (squash) August 25, 2022 17:18
@jtung-apple jtung-apple force-pushed the issue-15578-assert-before-refcount-overflow branch from aa4e071 to ccf83df Compare August 25, 2022 20:40
@jtung-apple jtung-apple force-pushed the issue-15578-assert-before-refcount-overflow branch from ccf83df to 132d6db Compare August 25, 2022 22:32
@github-actions
Copy link

github-actions bot commented Aug 26, 2022

PR #22103: Size comparison from 5c2334a to 132d6db

Increases (33 builds for bl602, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, psoc6, telink)
platform target config section 5c2334a 132d6db change % change
bl602 lighting-app bl602 .text 1050856 1050860 4 0.0
bl602+rpc .text 1082872 1082876 4 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 672827 672835 8 0.0
.text 583676 583684 8 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586586 586602 16 0.0
.app_xip_area 463244 463260 16 0.0
lock cyw930739m2evb_01 (read/write) 592346 592362 16 0.0
.app_xip_area 464220 464236 16 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599450 599506 56 0.0
.app_xip_area 476828 476884 56 0.0
efr32 lighting-app BRD4161A (read/write) 1107284 1107340 56 0.0
.text 968860 968916 56 0.0
BRD4161A+rpc (read/write) 971396 971444 48 0.0
.text 818276 818324 48 0.0
window-app BRD4161A (read/write) 1098548 1098612 64 0.0
.text 958660 958724 64 0.0
k32w light k32w0+release (read/write) 646516 646532 16 0.0
.text 571320 571336 16 0.0
lock k32w0+release (read/write) 704012 704028 16 0.0
.text 628344 628360 16 0.0
linux all-clusters-app debug (read only) 3037929 3038041 112 0.0
.rodata 274635 274667 32 0.0
.text 2584146 2584226 80 0.0
all-clusters-minimal-app debug (read only) 2873793 2873889 96 0.0
.rodata 274827 274859 32 0.0
.text 2422594 2422658 64 0.0
bridge-app debug+rpc (read only) 2372313 2372409 96 0.0
.rodata 203464 203496 32 0.0
.text 2006226 2006290 64 0.0
chip-tool debug (read only) 10878417 10878513 96 0.0
.rodata 561365 561397 32 0.0
.text 8796500 8796564 64 0.0
chip-tool-ipv6only arm64 (read only) 10264052 10264164 112 0.0
.rodata 492132 492164 32 0.0
.text 8119796 8119876 80 0.0
lighting-app debug+rpc (read only) 2597257 2597353 96 0.0
.rodata 220368 220400 32 0.0
.text 2205986 2206050 64 0.0
lock-app debug (read only) 2580241 2580337 96 0.0
.rodata 237328 237360 32 0.0
.text 2176258 2176322 64 0.0
ota-provider-app debug (read only) 2357401 2357497 96 0.0
.rodata 209304 209336 32 0.0
.text 1984626 1984690 64 0.0
ota-requestor-app debug (read only) 2522921 2523017 96 0.0
.rodata 216128 216160 32 0.0
.text 2134178 2134242 64 0.0
shell debug (read only) 2606233 2606329 96 0.0
.rodata 234738 234770 32 0.0
.text 2213074 2213138 64 0.0
thermostat-no-ble arm64 (read only) 2356644 2356756 112 0.0
.rodata 140588 140620 32 0.0
.text 1978336 1978416 80 0.0
tv-app debug (read only) 3182745 3182841 96 0.0
.rodata 259080 259112 32 0.0
.text 2733922 2733986 64 0.0
tv-casting-app debug (read only) 5503505 5503617 112 0.0
.rodata 344273 344305 32 0.0
.text 4887618 4887698 80 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2454312 2454344 32 0.0
.text 1416956 1416988 32 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180591 1180655 64 0.0
rodata 143328 143360 32 0.0
text 814556 814584 28 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159675 1159723 48 0.0
rodata 134916 134948 32 0.0
text 802968 802992 24 0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_abbrev 1217558 1217582 24 0.0
all-clusters-minimal cy8ckit_062s2_43012 .debug_abbrev 1209397 1209421 24 0.0
light cy8ckit_062s2_43012 .debug_abbrev 1044070 1044094 24 0.0
lock cy8ckit_062s2_43012 .debug_abbrev 1051505 1051529 24 0.0
telink light-switch-app tlsr9518adk80d (read/write) 808416 808480 64 0.0
text 571026 571056 30 0.0
lighting-app tlsr9518adk80d (read/write) 830384 830448 64 0.0
text 589148 589180 32 0.0
Decreases (6 builds for cc13x2_26x2, esp32, psoc6)
platform target config section 5c2334a 132d6db change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 178668 178660 -8 -0.0
esp32 all-clusters-app c3devkit (read only) 1031178 1031176 -2 -0.0
.flash.text 1031178 1031176 -2 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_info 26646622 26646621 -1 -0.0
all-clusters-minimal cy8ckit_062s2_43012 .debug_info 26383317 26383315 -2 -0.0
light cy8ckit_062s2_43012 .debug_info 21847873 21847871 -2 -0.0
lock cy8ckit_062s2_43012 .debug_info 22227604 22227603 -1 -0.0
Full report (43 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
platform target config section 5c2334a 132d6db change % change
bl602 lighting-app bl602 (read/write) 1383690 1383690 0 0.0
.bss 120266 120266 0 0.0
.data 4480 4480 0 0.0
.text 1050856 1050860 4 0.0
bl602+rpc (read/write) 1429602 1429602 0 0.0
.bss 127706 127706 0 0.0
.data 4600 4600 0 0.0
.text 1082872 1082876 4 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 672827 672835 8 0.0
(read/write) 178668 178660 -8 -0.0
.bss 74388 74388 0 0.0
.data 3372 3372 0 0.0
.rodata 88835 88835 0 0.0
.text 583676 583684 8 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637555 637555 0 0.0
(read/write) 157948 157948 0 0.0
.bss 73660 73660 0 0.0
.data 3372 3372 0 0.0
.rodata 77979 77979 0 0.0
.text 559252 559252 0 0.0
lock-ftd LP_CC2652R7 (read only) 673919 673919 0 0.0
(read/write) 167784 167784 0 0.0
.bss 71484 71484 0 0.0
.data 3296 3296 0 0.0
.rodata 76671 76671 0 0.0
.text 596768 596768 0 0.0
lock-mtd LP_CC2652R7 (read only) 656687 656687 0 0.0
(read/write) 180704 180704 0 0.0
.bss 67172 67172 0 0.0
.data 3296 3296 0 0.0
.rodata 101767 101767 0 0.0
.text 554440 554440 0 0.0
pump-app LP_CC2652R7 (read only) 684551 684551 0 0.0
(read/write) 157960 157960 0 0.0
.bss 71524 71524 0 0.0
.data 3296 3296 0 0.0
.rodata 89927 89927 0 0.0
.text 594140 594140 0 0.0
pump-controller-app LP_CC2652R7 (read only) 669059 669059 0 0.0
(read/write) 173572 173572 0 0.0
.bss 71644 71644 0 0.0
.data 3292 3292 0 0.0
.rodata 85483 85483 0 0.0
.text 583096 583096 0 0.0
shell LP_CC2652R7 (read only) 665526 665526 0 0.0
(read/write) 181488 181488 0 0.0
.bss 76708 76708 0 0.0
.data 3376 3376 0 0.0
.rodata 85782 85782 0 0.0
.text 579428 579428 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586586 586602 16 0.0
.app_xip_area 463244 463260 16 0.0
.bss 65776 65776 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 592346 592362 16 0.0
.app_xip_area 464220 464236 16 0.0
.bss 70560 70560 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599450 599506 56 0.0
.app_xip_area 476828 476884 56 0.0
.bss 65088 65088 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1107284 1107340 56 0.0
.bss 136332 136332 0 0.0
.data 2072 2072 0 0.0
.text 968860 968916 56 0.0
BRD4161A+rpc (read/write) 971396 971444 48 0.0
.bss 150844 150844 0 0.0
.data 2252 2252 0 0.0
.text 818276 818324 48 0.0
BRD4161A+rs911x (read/write) 999896 999896 0 0.0
.bss 169088 169088 0 0.0
.data 2056 2056 0 0.0
.text 828732 828732 0 0.0
lock-app BRD4161A+wf200 (read/write) 1149196 1149196 0 0.0
.bss 152168 152168 0 0.0
.data 2064 2064 0 0.0
.text 994944 994944 0 0.0
window-app BRD4161A (read/write) 1098548 1098612 64 0.0
.bss 137772 137772 0 0.0
.data 2096 2096 0 0.0
.text 958660 958724 64 0.0
esp32 all-clusters-app c3devkit (read only) 1031178 1031176 -2 -0.0
(read/write) 1489650 1489650 0 0.0
.dram0.bss 71160 71160 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 218448 218448 0 0.0
.flash.text 1031178 1031176 -2 -0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1084287 1084287 0 0.0
(read/write) 491568 491568 0 0.0
.dram0.bss 76664 76664 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 248764 248764 0 0.0
.flash.text 1078903 1078903 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w0+release (read/write) 646516 646532 16 0.0
.bss 70400 70400 0 0.0
.data 2068 2068 0 0.0
.text 571320 571336 16 0.0
lock k32w0+release (read/write) 704012 704028 16 0.0
.bss 70864 70864 0 0.0
.data 2076 2076 0 0.0
.text 628344 628360 16 0.0
linux all-clusters-app debug (read only) 3037929 3038041 112 0.0
(read/write) 156024 156024 0 0.0
.bss 61920 61920 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 85624 85624 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 1168 1168 0 0.0
.rodata 274635 274667 32 0.0
.text 2584146 2584226 80 0.0
all-clusters-minimal-app debug (read only) 2873793 2873889 96 0.0
(read/write) 147624 147624 0 0.0
.bss 61152 61152 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 78120 78120 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1152 1152 0 0.0
.rodata 274827 274859 32 0.0
.text 2422594 2422658 64 0.0
bridge-app debug+rpc (read only) 2372313 2372409 96 0.0
(read/write) 127584 127584 0 0.0
.bss 50656 50656 0 0.0
.data 3600 3600 0 0.0
.data.rel.ro 67464 67464 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 203464 203496 32 0.0
.text 2006226 2006290 64 0.0
chip-tool debug (read only) 10878417 10878513 96 0.0
(read/write) 657184 657184 0 0.0
.bss 25240 25240 0 0.0
.data 3266 3266 0 0.0
.data.rel.ro 622168 622168 0 0.0
.dynamic 608 608 0 0.0
.got 5096 5096 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 561365 561397 32 0.0
.text 8796500 8796564 64 0.0
chip-tool-ipv6only arm64 (read only) 10264052 10264164 112 0.0
(read/write) 705073 705073 0 0.0
.bss 33297 33297 0 0.0
.data 3272 3272 0 0.0
.data.rel.ro 649704 649704 0 0.0
.dynamic 560 560 0 0.0
.got 13832 13832 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 492132 492164 32 0.0
.text 8119796 8119876 80 0.0
lighting-app debug+rpc (read only) 2597257 2597353 96 0.0
(read/write) 130304 130304 0 0.0
.bss 49760 49760 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 72488 72488 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 220368 220400 32 0.0
.text 2205986 2206050 64 0.0
lock-app debug (read only) 2580241 2580337 96 0.0
(read/write) 125512 125512 0 0.0
.bss 48288 48288 0 0.0
.data 1712 1712 0 0.0
.data.rel.ro 69512 69512 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 896 896 0 0.0
.rodata 237328 237360 32 0.0
.text 2176258 2176322 64 0.0
ota-provider-app debug (read only) 2357401 2357497 96 0.0
(read/write) 118976 118976 0 0.0
.bss 47808 47808 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 63336 63336 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 760 760 0 0.0
.rodata 209304 209336 32 0.0
.text 1984626 1984690 64 0.0
ota-requestor-app debug (read only) 2522921 2523017 96 0.0
(read/write) 127384 127384 0 0.0
.bss 50368 50368 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 68744 68744 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 848 848 0 0.0
.rodata 216128 216160 32 0.0
.text 2134178 2134242 64 0.0
shell debug (read only) 2606233 2606329 96 0.0
(read/write) 142144 142144 0 0.0
.bss 57832 57832 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 77224 77224 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 234738 234770 32 0.0
.text 2213074 2213138 64 0.0
thermostat-no-ble arm64 (read only) 2356644 2356756 112 0.0
(read/write) 141825 141825 0 0.0
.bss 55345 55345 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 75984 75984 0 0.0
.dynamic 560 560 0 0.0
.got 5048 5048 0 0.0
.init 24 24 0 0.0
.init_array 408 408 0 0.0
.rodata 140588 140620 32 0.0
.text 1978336 1978416 80 0.0
tv-app debug (read only) 3182745 3182841 96 0.0
(read/write) 257968 257968 0 0.0
.bss 167480 167480 0 0.0
.data 4736 4736 0 0.0
.data.rel.ro 79184 79184 0 0.0
.dynamic 608 608 0 0.0
.got 4856 4856 0 0.0
.init 27 27 0 0.0
.init_array 1072 1072 0 0.0
.rodata 259080 259112 32 0.0
.text 2733922 2733986 64 0.0
tv-casting-app debug (read only) 5503505 5503617 112 0.0
(read/write) 160464 160464 0 0.0
.bss 51480 51480 0 0.0
.data 2432 2432 0 0.0
.data.rel.ro 100120 100120 0 0.0
.dynamic 608 608 0 0.0
.got 4776 4776 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 344273 344305 32 0.0
.text 4887618 4887698 80 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2454312 2454344 32 0.0
.bss 215044 215044 0 0.0
.data 5872 5872 0 0.0
.text 1416956 1416988 32 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180591 1180655 64 0.0
bss 143745 143745 0 0.0
rodata 143328 143360 32 0.0
text 814556 814584 28 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159675 1159723 48 0.0
bss 142972 142972 0 0.0
rodata 134916 134948 32 0.0
text 802968 802992 24 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 842120 842120 0 0.0
(read/write) 1740372 1740372 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188568 188568 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2656 2656 0 0.0
.debug_abbrev 1217558 1217582 24 0.0
.debug_aranges 111560 111560 0 0.0
.debug_frame 372476 372476 0 0.0
.debug_info 26646622 26646621 -1 -0.0
.debug_line 3647676 3647676 0 0.0
.debug_loc 3562758 3562758 0 0.0
.debug_ranges 336864 336864 0 0.0
.debug_str 3393925 3393925 0 0.0
.heap 842120 842120 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 569449 569449 0 0.0
.symtab 420640 420640 0 0.0
.text 1540760 1540760 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 842856 842856 0 0.0
(read/write) 1683580 1683580 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187832 187832 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2656 2656 0 0.0
.debug_abbrev 1209397 1209421 24 0.0
.debug_aranges 111032 111032 0 0.0
.debug_frame 375556 375556 0 0.0
.debug_info 26383317 26383315 -2 -0.0
.debug_line 3668080 3668080 0 0.0
.debug_loc 3550395 3550395 0 0.0
.debug_ranges 335480 335480 0 0.0
.debug_str 3382914 3382914 0 0.0
.heap 842856 842856 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 533923 533923 0 0.0
.symtab 407232 407232 0 0.0
.text 1484704 1484704 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 851200 851200 0 0.0
(read/write) 1600828 1600828 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 179696 179696 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2448 2448 0 0.0
.debug_abbrev 1044070 1044094 24 0.0
.debug_aranges 103200 103200 0 0.0
.debug_frame 345800 345800 0 0.0
.debug_info 21847873 21847871 -2 -0.0
.debug_line 3239259 3239259 0 0.0
.debug_loc 3249910 3249910 0 0.0
.debug_ranges 301320 301320 0 0.0
.debug_str 3189008 3189008 0 0.0
.heap 851200 851200 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 467204 467204 0 0.0
.symtab 374288 374288 0 0.0
.text 1410296 1410296 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 846168 846168 0 0.0
(read/write) 1638540 1638540 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 184712 184712 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2464 2464 0 0.0
.debug_abbrev 1051505 1051529 24 0.0
.debug_aranges 103872 103872 0 0.0
.debug_frame 348628 348628 0 0.0
.debug_info 22227604 22227603 -1 -0.0
.debug_line 3248153 3248153 0 0.0
.debug_loc 3289747 3289747 0 0.0
.debug_ranges 304664 304664 0 0.0
.debug_str 3216491 3216491 0 0.0
.heap 846168 846168 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 473419 473419 0 0.0
.symtab 377472 377472 0 0.0
.text 1442976 1442976 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 808416 808480 64 0.0
bss 71448 71448 0 0.0
noinit 43488 43488 0 0.0
text 571026 571056 30 0.0
lighting-app tlsr9518adk80d (read/write) 830384 830448 64 0.0
bss 72304 72304 0 0.0
noinit 43488 43488 0 0.0
text 589148 589180 32 0.0

@woody-apple woody-apple merged commit ebe88a8 into project-chip:master Aug 27, 2022
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
* Issue 15578 - assert before refcount overflow

* changed assert to VerifyOrDieWithMsg for better error reporting and code doc

* use numeric_limits to avoid problems with underlying type change

* restyled
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.

5 participants