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

Use Pool for mDNS udp endpoint, fix endpoint leak #12417

Merged
merged 1 commit into from
Dec 2, 2021

Conversation

kghost
Copy link
Contributor

@kghost kghost commented Dec 1, 2021

Problem

There are 2 problems:

  1. In ServerBase::Listen of src/lib/dnssd/minimal_mdns/Server.cpp. If JoinMulticastGroup, endpointIndex won't advance, the unicast_query_udp assigned to this slot will be override by next item.
  2. Server class in src/lib/dnssd/minimal_mdns/Server.h is derived from ServerBase, when destructing Server instance, the mAllocatedStorage array is disposed before destructor of ServerBase is called, so ~ServerBase will access already disposed memory.

Change overview

Use memory pool to manage objects instead of an array.
Reorder destructor of those objects

Testing

Manually tested with unit-tests using x64 linux

@github-actions
Copy link

github-actions bot commented Dec 1, 2021

PR #12417: Size comparison from a7b18b8 to 43d7be6

Increases above 0.2%:

platform target config section a7b18b8 43d7be6 change % change
linux all-clusters-app debug (read only) 1781513 1787041 5528 0.3
(read/write) 125192 125544 352 0.3
.data.rel.ro 65728 66000 272 0.4
.text 1502098 1507010 4912 0.3
bridge-app debug+rpc (read only) 1352565 1357789 5224 0.4
(read/write) 71312 71664 352 0.5
.data.rel.ro 29488 29768 280 0.9
.text 1138533 1143157 4624 0.4
lighting-app debug+rpc (read only) 1632633 1638177 5544 0.3
(read/write) 104400 104752 352 0.3
.data.rel.ro 57072 57344 272 0.5
.text 1362450 1367378 4928 0.4
ota-provider-app debug (read only) 1313009 1318505 5496 0.4
(read/write) 69768 70120 352 0.5
.data.rel.ro 26024 26312 288 1.1
.text 1097538 1102450 4912 0.4
ota-requestor-app debug (read only) 1412993 1418489 5496 0.4
(read/write) 73664 73984 320 0.4
.data.rel.ro 27736 28008 272 1.0
.text 1182258 1187170 4912 0.4
shell debug (read only) 808969 814161 5192 0.6
(read/write) 60104 60424 320 0.5
.data.rel.ro 38528 38808 280 0.7
.text 623474 628082 4608 0.7
tv-app debug (read only) 1927281 1932809 5528 0.3
.data.rel.ro 61696 61976 280 0.5
.text 1617298 1622210 4912 0.3
Increases (16 builds for esp32, linux, mbed, p6)
platform target config section a7b18b8 43d7be6 change % change
esp32 all-clusters-app c3devkit (read only) 837356 837638 282 0.0
(read/write) 1224050 1224154 104 0.0
.dram0.bss 58528 58560 32 0.1
.flash.rodata 166248 166320 72 0.0
.flash.text 837356 837638 282 0.0
m5stack (read only) 908839 909227 388 0.0
(read/write) 423308 423404 96 0.0
.dram0.bss 63928 63952 24 0.0
.flash.rodata 194100 194172 72 0.0
.flash.text 903455 903843 388 0.0
linux all-clusters-app debug (read only) 1781513 1787041 5528 0.3
(read/write) 125192 125544 352 0.3
.bss 53072 53136 64 0.1
.data.rel.ro 65728 66000 272 0.4
.rodata 139797 139861 64 0.0
.text 1502098 1507010 4912 0.3
bridge-app debug+rpc (read only) 1352565 1357789 5224 0.4
(read/write) 71312 71664 352 0.5
.bss 35120 35184 64 0.2
.data.rel.ro 29488 29768 280 0.9
.rodata 113820 113868 48 0.0
.text 1138533 1143157 4624 0.4
chip-tool debug (read only) 6272725 6278253 5528 0.1
(read/write) 197904 198256 352 0.2
.bss 33448 33512 64 0.2
.data.rel.ro 157880 158168 288 0.2
.rodata 295624 295688 64 0.0
.text 5574133 5579045 4912 0.1
lighting-app debug+rpc (read only) 1632633 1638177 5544 0.3
(read/write) 104400 104752 352 0.3
.bss 40784 40848 64 0.2
.data.rel.ro 57072 57344 272 0.5
.rodata 132273 132337 64 0.0
.text 1362450 1367378 4928 0.4
ota-provider-app debug (read only) 1313009 1318505 5496 0.4
(read/write) 69768 70120 352 0.5
.bss 37696 37760 64 0.2
.data.rel.ro 26024 26312 288 1.1
.rodata 115024 115056 32 0.0
.text 1097538 1102450 4912 0.4
ota-requestor-app debug (read only) 1412993 1418489 5496 0.4
(read/write) 73664 73984 320 0.4
.bss 39808 39872 64 0.2
.data.rel.ro 27736 28008 272 1.0
.rodata 126848 126880 32 0.0
.text 1182258 1187170 4912 0.4
shell debug (read only) 808969 814161 5192 0.6
(read/write) 60104 60424 320 0.5
.bss 16872 16904 32 0.2
.data.rel.ro 38528 38808 280 0.7
.rodata 79794 79826 32 0.0
.text 623474 628082 4608 0.7
tv-app debug (read only) 1927281 1932809 5528 0.3
(read/write) 314032 314376 344 0.1
.bss 245176 245232 56 0.0
.data.rel.ro 61696 61976 280 0.5
.rodata 161448 161512 64 0.0
.text 1617298 1622210 4912 0.3
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2296632 2296960 328 0.0
.bss 181612 181636 24 0.0
.text 1259232 1259560 328 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2281312 2281640 328 0.0
.bss 172636 172660 24 0.0
.text 1243912 1244240 328 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2254344 2254736 392 0.0
.bss 171452 171476 24 0.0
.text 1216944 1217336 392 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2045928 2046256 328 0.0
.bss 156624 156652 28 0.0
.text 1008528 1008856 328 0.0
p6 all-clusters-app default (read/write) 2318024 2318840 816 0.0
.bss 109688 109716 28 0.0
.text 1276288 1277104 816 0.1
lock-app default (read/write) 2229112 2229920 808 0.0
.bss 96408 96436 28 0.0
.text 1187376 1188184 808 0.1
Decreases (6 builds for mbed, p6)
platform target config section a7b18b8 43d7be6 change % change
mbed all-clusters-app CY8CPROTO_062_4343W+release .heap 849664 849640 -24 -0.0
lighting-app CY8CPROTO_062_4343W+release .heap 858328 858304 -24 -0.0
lock-app CY8CPROTO_062_4343W+release .heap 859528 859504 -24 -0.0
shell CY8CPROTO_062_4343W+release .heap 874960 874928 -32 -0.0
p6 all-clusters-app default .heap 921200 921168 -32 -0.0
lock-app default .heap 934656 934624 -32 -0.0
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section a7b18b8 43d7be6 change % change
efr32 lighting-app BRD4161A (read only) 763296 763296 0 0.0
(read/write) 119972 119972 0 0.0
.bss 118164 118164 0 0.0
.data 1808 1808 0 0.0
.text 763288 763288 0 0.0
BRD4161A+rpc (read only) 791784 791784 0 0.0
(read/write) 138276 138276 0 0.0
.bss 136364 136364 0 0.0
.data 1908 1908 0 0.0
.text 791776 791776 0 0.0
lock-app BRD4161A (read only) 737176 737176 0 0.0
(read/write) 117684 117684 0 0.0
.bss 115916 115916 0 0.0
.data 1764 1764 0 0.0
.text 737168 737168 0 0.0
window-app BRD4161A (read only) 740264 740264 0 0.0
(read/write) 118116 118116 0 0.0
.bss 116340 116340 0 0.0
.data 1772 1772 0 0.0
.text 740256 740256 0 0.0
esp32 all-clusters-app c3devkit (read only) 837356 837638 282 0.0
(read/write) 1224050 1224154 104 0.0
.dram0.bss 58528 58560 32 0.1
.dram0.data 14028 14028 0 0.0
.flash.rodata 166248 166320 72 0.0
.flash.text 837356 837638 282 0.0
.iram0.text 61394 61394 0 0.0
m5stack (read only) 908839 909227 388 0.0
(read/write) 423308 423404 96 0.0
.dram0.bss 63928 63952 24 0.0
.dram0.data 34000 34000 0 0.0
.flash.rodata 194100 194172 72 0.0
.flash.text 903455 903843 388 0.0
.iram0.text 122943 122943 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 724524 724524 0 0.0
.bss 78772 78772 0 0.0
.data 1840 1840 0 0.0
.text 638112 638112 0 0.0
lock-app k32w061+debug (read/write) 613524 613524 0 0.0
.bss 69212 69212 0 0.0
.data 1804 1804 0 0.0
.text 536708 536708 0 0.0
shell k32w061+debug (read/write) 679304 679304 0 0.0
.bss 80796 80796 0 0.0
.data 1776 1776 0 0.0
.text 590932 590932 0 0.0
linux all-clusters-app debug (read only) 1781513 1787041 5528 0.3
(read/write) 125192 125544 352 0.3
.bss 53072 53136 64 0.1
.data 1104 1104 0 0.0
.data.rel.ro 65728 66000 272 0.4
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 560 560 0 0.0
.rodata 139797 139861 64 0.0
.text 1502098 1507010 4912 0.3
bridge-app debug+rpc (read only) 1352565 1357789 5224 0.4
(read/write) 71312 71664 352 0.5
.bss 35120 35184 64 0.2
.data 1680 1680 0 0.0
.data.rel.ro 29488 29768 280 0.9
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 408 408 0 0.0
.rodata 113820 113868 48 0.0
.text 1138533 1143157 4624 0.4
chip-tool debug (read only) 6272725 6278253 5528 0.1
(read/write) 197904 198256 352 0.2
.bss 33448 33512 64 0.2
.data 1008 1008 0 0.0
.data.rel.ro 157880 158168 288 0.2
.dynamic 592 592 0 0.0
.got 4472 4472 0 0.0
.init 27 27 0 0.0
.init_array 480 480 0 0.0
.rodata 295624 295688 64 0.0
.text 5574133 5579045 4912 0.1
lighting-app debug+rpc (read only) 1632633 1638177 5544 0.3
(read/write) 104400 104752 352 0.3
.bss 40784 40848 64 0.2
.data 1232 1232 0 0.0
.data.rel.ro 57072 57344 272 0.5
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 132273 132337 64 0.0
.text 1362450 1367378 4928 0.4
ota-provider-app debug (read only) 1313009 1318505 5496 0.4
(read/write) 69768 70120 352 0.5
.bss 37696 37760 64 0.2
.data 912 912 0 0.0
.data.rel.ro 26024 26312 288 1.1
.dynamic 592 592 0 0.0
.got 4048 4048 0 0.0
.init 27 27 0 0.0
.init_array 448 448 0 0.0
.rodata 115024 115056 32 0.0
.text 1097538 1102450 4912 0.4
ota-requestor-app debug (read only) 1412993 1418489 5496 0.4
(read/write) 73664 73984 320 0.4
.bss 39808 39872 64 0.2
.data 976 976 0 0.0
.data.rel.ro 27736 28008 272 1.0
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 472 472 0 0.0
.rodata 126848 126880 32 0.0
.text 1182258 1187170 4912 0.4
shell debug (read only) 808969 814161 5192 0.6
(read/write) 60104 60424 320 0.5
.bss 16872 16904 32 0.2
.data 240 240 0 0.0
.data.rel.ro 38528 38808 280 0.7
.dynamic 592 592 0 0.0
.got 3504 3504 0 0.0
.init 27 27 0 0.0
.init_array 344 344 0 0.0
.rodata 79794 79826 32 0.0
.text 623474 628082 4608 0.7
tv-app debug (read only) 1927281 1932809 5528 0.3
(read/write) 314032 314376 344 0.1
.bss 245176 245232 56 0.0
.data 1504 1504 0 0.0
.data.rel.ro 61696 61976 280 0.5
.dynamic 592 592 0 0.0
.got 4424 4424 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 161448 161512 64 0.0
.text 1617298 1622210 4912 0.3
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2296632 2296960 328 0.0
.bss 181612 181636 24 0.0
.data 5168 5168 0 0.0
.heap 849664 849640 -24 -0.0
.text 1259232 1259560 328 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2281312 2281640 328 0.0
.bss 172636 172660 24 0.0
.data 5480 5480 0 0.0
.heap 858328 858304 -24 -0.0
.text 1243912 1244240 328 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2254344 2254736 392 0.0
.bss 171452 171476 24 0.0
.data 5464 5464 0 0.0
.heap 859528 859504 -24 -0.0
.text 1216944 1217336 392 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139744 1139744 0 0.0
.bss 11752 11752 0 0.0
.data 4368 4368 0 0.0
.heap 1020328 1020328 0 0.0
.text 103128 103128 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2045928 2046256 328 0.0
.bss 156624 156652 28 0.0
.data 4864 4864 0 0.0
.heap 874960 874928 -32 -0.0
.text 1008528 1008856 328 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 876807 876807 0 0.0
bss 113136 113136 0 0.0
rodata 97368 97368 0 0.0
text 590764 590764 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 839255 839255 0 0.0
bss 109488 109488 0 0.0
rodata 88632 88632 0 0.0
text 564932 564932 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 801842 801842 0 0.0
bss 114512 114512 0 0.0
rodata 92628 92628 0 0.0
text 520220 520220 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 847635 847635 0 0.0
bss 110176 110176 0 0.0
rodata 93108 93108 0 0.0
text 569012 569012 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 772906 772906 0 0.0
bss 111584 111584 0 0.0
rodata 88396 88396 0 0.0
text 498560 498560 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497327 497327 0 0.0
bss 51824 51824 0 0.0
rodata 45780 45780 0 0.0
text 339436 339436 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 853679 853679 0 0.0
bss 110312 110312 0 0.0
rodata 94840 94840 0 0.0
text 573080 573080 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 846743 846743 0 0.0
bss 110188 110188 0 0.0
rodata 92976 92976 0 0.0
text 568140 568140 0 0.0
shell nrf52840dk_nrf52840 (read/write) 779227 779227 0 0.0
bss 109616 109616 0 0.0
rodata 73216 73216 0 0.0
text 521888 521888 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 694274 694274 0 0.0
bss 110600 110600 0 0.0
rodata 67860 67860 0 0.0
text 442496 442496 0 0.0
p6 all-clusters-app default (read/write) 2318024 2318840 816 0.0
.bss 109688 109716 28 0.0
.data 2456 2456 0 0.0
.heap 921200 921168 -32 -0.0
.text 1276288 1277104 816 0.1
lock-app default (read/write) 2229112 2229920 808 0.0
.bss 96408 96436 28 0.0
.data 2280 2280 0 0.0
.heap 934656 934624 -32 -0.0
.text 1187376 1188184 808 0.1
qpg lighting-app qpg6100+debug (read only) 496884 496884 0 0.0
(read/write) 114140 114140 0 0.0
.bss 79656 79656 0 0.0
.data 940 940 0 0.0
.text 491564 491564 0 0.0
lock-app qpg6100+debug (read only) 469480 469480 0 0.0
(read/write) 114140 114140 0 0.0
.bss 78568 78568 0 0.0
.data 892 892 0 0.0
.text 464160 464160 0 0.0
persistent-storage-app qpg6100+debug (read only) 108020 108020 0 0.0
(read/write) 114140 114140 0 0.0
.bss 36688 36688 0 0.0
.data 292 292 0 0.0
.text 102700 102700 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 778686 778686 0 0.0
bss 79716 79716 0 0.0
noinit 37160 37160 0 0.0
text 541466 541466 0 0.0

@kghost kghost force-pushed the fix-mdns-udp-leak branch from 43d7be6 to ba9fdc3 Compare December 2, 2021 17:16
@todo
Copy link

todo bot commented Dec 2, 2021

this wastes one copy of the data and that could be optimized away

/// TODO: this wastes one copy of the data and that could be optimized away
if (info->mAddressType == chip::Inet::IPAddressType::kIPv6)
{
err = udp->SendTo(mIpv6BroadcastAddress, port, data.CloneData(), udp->GetBoundInterface());
}
#if INET_CONFIG_ENABLE_IPV4
else if (info->mAddressType == chip::Inet::IPAddressType::kIPv4)
{
err = udp->SendTo(mIpv4BroadcastAddress, port, data.CloneData(), udp->GetBoundInterface());
}
#endif


This comment was generated by todo based on a TODO comment in 6d4b0b9 in #12417. cc @kghost.

@kghost kghost force-pushed the fix-mdns-udp-leak branch from 6d4b0b9 to 9cb6acd Compare December 2, 2021 20:19
@github-actions
Copy link

github-actions bot commented Dec 2, 2021

PR #12417: Size comparison from 803f3b8 to 9cb6acd

Increases above 0.2%:

platform target config section 803f3b8 9cb6acd change % change
linux all-clusters-app debug (read only) 1835665 1841385 5720 0.3
(read/write) 123840 124160 320 0.3
.data.rel.ro 66816 67088 272 0.4
.text 1547506 1552674 5168 0.3
bridge-app debug+rpc (read only) 1417669 1423085 5416 0.4
(read/write) 74032 74384 352 0.5
.data.rel.ro 31248 31528 280 0.9
.text 1194261 1199125 4864 0.4
lighting-app debug+rpc (read only) 1701465 1707169 5704 0.3
(read/write) 107088 107376 288 0.3
.data.rel.ro 58752 59024 272 0.5
.text 1420530 1425682 5152 0.4
ota-provider-app debug (read only) 1378201 1383921 5720 0.4
(read/write) 72264 72616 352 0.5
.data.rel.ro 27592 27880 288 1.0
.text 1153714 1158882 5168 0.4
ota-requestor-app debug (read only) 1478225 1483945 5720 0.4
(read/write) 76160 76480 320 0.4
.data.rel.ro 29304 29576 272 0.9
.text 1238386 1243554 5168 0.4
shell debug (read only) 813129 818529 5400 0.7
(read/write) 60264 60584 320 0.5
.data.rel.ro 38656 38936 280 0.7
.text 623538 628386 4848 0.8
tv-app debug (read only) 1995169 2000889 5720 0.3
.data.rel.ro 63440 63720 280 0.4
.text 1673618 1678786 5168 0.3
Increases (17 builds for esp32, linux, mbed, p6)
platform target config section 803f3b8 9cb6acd change % change
esp32 all-clusters-app c3devkit (read only) 847268 847592 324 0.0
(read/write) 1223618 1223722 104 0.0
.dram0.bss 56472 56504 32 0.1
.flash.rodata 167632 167704 72 0.0
.flash.text 847268 847592 324 0.0
m5stack (read only) 917827 918219 392 0.0
(read/write) 422596 422692 96 0.0
.dram0.bss 61864 61888 24 0.0
.flash.rodata 195436 195508 72 0.0
.flash.text 912443 912835 392 0.0
linux all-clusters-app debug (read only) 1835665 1841385 5720 0.3
(read/write) 123840 124160 320 0.3
.bss 50640 50672 32 0.1
.data.rel.ro 66816 67088 272 0.4
.text 1547506 1552674 5168 0.3
bridge-app debug+rpc (read only) 1417669 1423085 5416 0.4
(read/write) 74032 74384 352 0.5
.bss 36048 36112 64 0.2
.data.rel.ro 31248 31528 280 0.9
.text 1194261 1199125 4864 0.4
chip-tool debug (read only) 6613133 6618837 5704 0.1
(read/write) 201744 202096 352 0.2
.bss 34344 34408 64 0.2
.data.rel.ro 160824 161112 288 0.2
.text 5896373 5901525 5152 0.1
lighting-app debug+rpc (read only) 1701465 1707169 5704 0.3
(read/write) 107088 107376 288 0.3
.bss 41744 41776 32 0.1
.data.rel.ro 58752 59024 272 0.5
.text 1420530 1425682 5152 0.4
ota-provider-app debug (read only) 1378201 1383921 5720 0.4
(read/write) 72264 72616 352 0.5
.bss 38624 38688 64 0.2
.data.rel.ro 27592 27880 288 1.0
.text 1153714 1158882 5168 0.4
ota-requestor-app debug (read only) 1478225 1483945 5720 0.4
(read/write) 76160 76480 320 0.4
.bss 40736 40800 64 0.2
.data.rel.ro 29304 29576 272 0.9
.text 1238386 1243554 5168 0.4
shell debug (read only) 813129 818529 5400 0.7
(read/write) 60264 60584 320 0.5
.bss 16904 16936 32 0.2
.data.rel.ro 38656 38936 280 0.7
.text 623538 628386 4848 0.8
tv-app debug (read only) 1995169 2000889 5720 0.3
(read/write) 316760 317072 312 0.1
.bss 246112 246168 56 0.0
.data.rel.ro 63440 63720 280 0.4
.text 1673618 1678786 5168 0.3
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2308576 2309032 456 0.0
.bss 179532 179556 24 0.0
.text 1271152 1271608 456 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2295096 2295488 392 0.0
.bss 173224 173248 24 0.0
.text 1257696 1258088 392 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2268128 2268584 456 0.0
.bss 172040 172064 24 0.0
.text 1230728 1231184 456 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2046576 2046968 392 0.0
.bss 156704 156732 28 0.0
.text 1009176 1009568 392 0.0
p6 all-clusters-app default (read/write) 2338416 2339256 840 0.0
.bss 107720 107748 28 0.0
.text 1296680 1297520 840 0.1
light-app default (read/write) 2278016 2278864 848 0.0
.bss 98452 98480 28 0.0
.text 1236280 1237128 848 0.1
lock-app default (read/write) 2253368 2254216 848 0.0
.bss 97108 97136 28 0.0
.text 1211632 1212480 848 0.1
Decreases (7 builds for mbed, p6)
platform target config section 803f3b8 9cb6acd change % change
mbed all-clusters-app CY8CPROTO_062_4343W+release .heap 851728 851704 -24 -0.0
lighting-app CY8CPROTO_062_4343W+release .heap 857728 857704 -24 -0.0
lock-app CY8CPROTO_062_4343W+release .heap 858912 858888 -24 -0.0
shell CY8CPROTO_062_4343W+release .heap 874872 874840 -32 -0.0
p6 all-clusters-app default .heap 923168 923136 -32 -0.0
light-app default .heap 932552 932528 -24 -0.0
lock-app default .heap 933936 933912 -24 -0.0
Full report (39 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 803f3b8 9cb6acd change % change
efr32 lighting-app BRD4161A (read only) 751432 751432 0 0.0
(read/write) 120008 120008 0 0.0
.bss 118176 118176 0 0.0
.data 1828 1828 0 0.0
.text 751424 751424 0 0.0
BRD4161A+rpc (read only) 780080 780080 0 0.0
(read/write) 138312 138312 0 0.0
.bss 136376 136376 0 0.0
.data 1936 1936 0 0.0
.text 780072 780072 0 0.0
lock-app BRD4161A (read only) 725272 725272 0 0.0
(read/write) 117712 117712 0 0.0
.bss 115928 115928 0 0.0
.data 1784 1784 0 0.0
.text 725264 725264 0 0.0
window-app BRD4161A (read only) 728600 728600 0 0.0
(read/write) 118136 118136 0 0.0
.bss 116344 116344 0 0.0
.data 1792 1792 0 0.0
.text 728592 728592 0 0.0
esp32 all-clusters-app c3devkit (read only) 847268 847592 324 0.0
(read/write) 1223618 1223722 104 0.0
.dram0.bss 56472 56504 32 0.1
.dram0.data 14052 14052 0 0.0
.flash.rodata 167632 167704 72 0.0
.flash.text 847268 847592 324 0.0
.iram0.text 61394 61394 0 0.0
m5stack (read only) 917827 918219 392 0.0
(read/write) 422596 422692 96 0.0
.dram0.bss 61864 61888 24 0.0
.dram0.data 34016 34016 0 0.0
.flash.rodata 195436 195508 72 0.0
.flash.text 912443 912835 392 0.0
.iram0.text 122943 122943 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 728608 728608 0 0.0
.bss 79280 79280 0 0.0
.data 1860 1860 0 0.0
.text 641668 641668 0 0.0
lock-app k32w061+debug (read/write) 617592 617592 0 0.0
.bss 69720 69720 0 0.0
.data 1824 1824 0 0.0
.text 540248 540248 0 0.0
shell k32w061+debug (read/write) 683460 683460 0 0.0
.bss 81376 81376 0 0.0
.data 1796 1796 0 0.0
.text 594488 594488 0 0.0
linux all-clusters-app debug (read only) 1835665 1841385 5720 0.3
(read/write) 123840 124160 320 0.3
.bss 50640 50672 32 0.1
.data 1120 1120 0 0.0
.data.rel.ro 66816 67088 272 0.4
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 146357 146357 0 0.0
.text 1547506 1552674 5168 0.3
bridge-app debug+rpc (read only) 1417669 1423085 5416 0.4
(read/write) 74032 74384 352 0.5
.bss 36048 36112 64 0.2
.data 1728 1728 0 0.0
.data.rel.ro 31248 31528 280 0.9
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 408 408 0 0.0
.rodata 119404 119404 0 0.0
.text 1194261 1199125 4864 0.4
chip-tool debug (read only) 6613133 6618837 5704 0.1
(read/write) 201744 202096 352 0.2
.bss 34344 34408 64 0.2
.data 1024 1024 0 0.0
.data.rel.ro 160824 161112 288 0.2
.dynamic 592 592 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 480 480 0 0.0
.rodata 307128 307128 0 0.0
.text 5896373 5901525 5152 0.1
lighting-app debug+rpc (read only) 1701465 1707169 5704 0.3
(read/write) 107088 107376 288 0.3
.bss 41744 41776 32 0.1
.data 1280 1280 0 0.0
.data.rel.ro 58752 59024 272 0.5
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 139185 139185 0 0.0
.text 1420530 1425682 5152 0.4
ota-provider-app debug (read only) 1378201 1383921 5720 0.4
(read/write) 72264 72616 352 0.5
.bss 38624 38688 64 0.2
.data 928 928 0 0.0
.data.rel.ro 27592 27880 288 1.0
.dynamic 592 592 0 0.0
.got 4048 4048 0 0.0
.init 27 27 0 0.0
.init_array 448 448 0 0.0
.rodata 120680 120680 0 0.0
.text 1153714 1158882 5168 0.4
ota-requestor-app debug (read only) 1478225 1483945 5720 0.4
(read/write) 76160 76480 320 0.4
.bss 40736 40800 64 0.2
.data 992 992 0 0.0
.data.rel.ro 29304 29576 272 0.9
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 472 472 0 0.0
.rodata 132592 132592 0 0.0
.text 1238386 1243554 5168 0.4
shell debug (read only) 813129 818529 5400 0.7
(read/write) 60264 60584 320 0.5
.bss 16904 16936 32 0.2
.data 256 256 0 0.0
.data.rel.ro 38656 38936 280 0.7
.dynamic 592 592 0 0.0
.got 3504 3504 0 0.0
.init 27 27 0 0.0
.init_array 344 344 0 0.0
.rodata 83506 83506 0 0.0
.text 623538 628386 4848 0.8
tv-app debug (read only) 1995169 2000889 5720 0.3
(read/write) 316760 317072 312 0.1
.bss 246112 246168 56 0.0
.data 1520 1520 0 0.0
.data.rel.ro 63440 63720 280 0.4
.dynamic 592 592 0 0.0
.got 4424 4424 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 169224 169224 0 0.0
.text 1673618 1678786 5168 0.3
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2308576 2309032 456 0.0
.bss 179532 179556 24 0.0
.data 5184 5184 0 0.0
.heap 851728 851704 -24 -0.0
.text 1271152 1271608 456 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2295096 2295488 392 0.0
.bss 173224 173248 24 0.0
.data 5496 5496 0 0.0
.heap 857728 857704 -24 -0.0
.text 1257696 1258088 392 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2268128 2268584 456 0.0
.bss 172040 172064 24 0.0
.data 5496 5496 0 0.0
.heap 858912 858888 -24 -0.0
.text 1230728 1231184 456 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2046576 2046968 392 0.0
.bss 156704 156732 28 0.0
.data 4872 4872 0 0.0
.heap 874872 874840 -32 -0.0
.text 1009176 1009568 392 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 891323 891323 0 0.0
bss 113728 113728 0 0.0
rodata 99372 99372 0 0.0
text 602684 602684 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 854699 854699 0 0.0
bss 110076 110076 0 0.0
rodata 90732 90732 0 0.0
text 577680 577680 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 817234 817234 0 0.0
bss 115100 115100 0 0.0
rodata 94628 94628 0 0.0
text 533024 533024 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 862179 862179 0 0.0
bss 110764 110764 0 0.0
rodata 95108 95108 0 0.0
text 580936 580936 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 788334 788334 0 0.0
bss 112176 112176 0 0.0
rodata 90400 90400 0 0.0
text 511368 511368 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 868195 868195 0 0.0
bss 110900 110900 0 0.0
rodata 96844 96844 0 0.0
text 585004 585004 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 861275 861275 0 0.0
bss 110780 110780 0 0.0
rodata 94980 94980 0 0.0
text 580064 580064 0 0.0
shell nrf52840dk_nrf52840 (read/write) 779911 779911 0 0.0
bss 109696 109696 0 0.0
rodata 73796 73796 0 0.0
text 521916 521916 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 694938 694938 0 0.0
bss 110680 110680 0 0.0
rodata 68436 68436 0 0.0
text 442520 442520 0 0.0
p6 all-clusters-app default (read/write) 2338416 2339256 840 0.0
.bss 107720 107748 28 0.0
.data 2456 2456 0 0.0
.heap 923168 923136 -32 -0.0
.text 1296680 1297520 840 0.1
light-app default (read/write) 2278016 2278864 848 0.0
.bss 98452 98480 28 0.0
.data 2336 2336 0 0.0
.heap 932552 932528 -24 -0.0
.text 1236280 1237128 848 0.1
lock-app default (read/write) 2253368 2254216 848 0.0
.bss 97108 97136 28 0.0
.data 2296 2296 0 0.0
.heap 933936 933912 -24 -0.0
.text 1211632 1212480 848 0.1
qpg lighting-app qpg6100+debug (read only) 510408 510408 0 0.0
(read/write) 122332 122332 0 0.0
.bss 80240 80240 0 0.0
.data 964 964 0 0.0
.text 505088 505088 0 0.0
lock-app qpg6100+debug (read only) 483232 483232 0 0.0
(read/write) 122332 122332 0 0.0
.bss 79152 79152 0 0.0
.data 916 916 0 0.0
.text 477912 477912 0 0.0
persistent-storage-app qpg6100+debug (read only) 108208 108208 0 0.0
(read/write) 122332 122332 0 0.0
.bss 36696 36696 0 0.0
.data 292 292 0 0.0
.text 102888 102888 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 794430 794430 0 0.0
bss 80304 80304 0 0.0
noinit 37160 37160 0 0.0
text 554474 554474 0 0.0

@andy31415 andy31415 merged commit e03dc66 into project-chip:master Dec 2, 2021
@kghost kghost deleted the fix-mdns-udp-leak branch December 2, 2021 22:29
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this pull request Dec 3, 2021
andy31415 pushed a commit that referenced this pull request Dec 4, 2021
* Catch or release ObjectPool leaks

#### Problem

No action is taken if an `ObjectPool` is destroyed while objects
remain live. For the `BitMapObjectPool` case, such objects can't
be safely touched. For `HeapObjectPool` such objects can be used
but can't be released.

Some leaks have been fixed (#11983, #12031), but there are still
a few remaining.

Fixes #11880 _Possible use of destroyed pool objects_

#### Change overview

- Add an `ObjectPool` template argument specifying what to do if
  it is destroyed with live objects: abort with an error message
  (the default), release the live objects (which calls their
  destructors), or ignore the condition (transitionally, until
  all leaks are fixed).

- Fix shutdown ordering in `DeviceControllerSystemState`.

- For existing pools in `SessionManager`, `InteractionModelEngine`,
  and `GroupDataProviderImpl`, ignore the condition.

#### Testing

CI; no changes to functionality.

* new uses in #12417
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