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

Simplify ExchangeMessageDispatch, preventing it from dangling #12794

Merged
merged 2 commits into from
Dec 22, 2021

Conversation

kghost
Copy link
Contributor

@kghost kghost commented Dec 9, 2021

Problem

ExchangeMessageDispatch in ExchangeContext is dangling if CASE/PASE session is release before exchange context

Change overview

the message dispatch for case/pase is allocated inside case/pase session, but sometime the ExchangeContext holding a pointer to the dispatch can live longer than the case/pase session, due to some refer is holding by the retrans table. Causing another dangling pointer. Where triggers another crash when disposing the ExchangeContext

  • Make the ExchangeMessageDispatch an empty virtual object. ApplicationExchangeDispatch and SessionEstablishmentExchangeDispatch are global singleton now, and it doesn't contain any data field.
    • ExchangeMessageDispatch is no longer reference counted.
    • mDispatch inside ExchangeContext becomes a reference, which always hold a valid dispatcher.
    • Inline PrepareMessage and SendPreparedMessage, the implementation is same in all derived classes
    • Make OnMessageReceived non-virtual, the implementation is same in all derived classes

Testing

Verified using unit-tests

@github-actions
Copy link

github-actions bot commented Dec 15, 2021

PR #12794: Size comparison from 7ae1cc9 to 5a44abb

Increases above 0.2%:

platform target config section 7ae1cc9 5a44abb change % change
linux thermostat-no-ble arm64 .got 3840 3888 48 1.2
Increases (8 builds for linux, mbed, p6)
platform target config section 7ae1cc9 5a44abb change % change
linux chip-tool-ipv6only arm64 .got 53864 53912 48 0.1
thermostat-no-ble arm64 .got 3840 3888 48 1.2
mbed all-clusters-app CY8CPROTO_062_4343W+release .heap 840864 840912 48 0.0
lighting-app CY8CPROTO_062_4343W+release .heap 848712 848760 48 0.0
lock-app CY8CPROTO_062_4343W+release .heap 849688 849736 48 0.0
p6 all-clusters-app default .heap 912272 912320 48 0.0
light-app default .heap 923520 923568 48 0.0
lock-app default .heap 924680 924728 48 0.0
Decreases (29 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 7ae1cc9 5a44abb change % change
efr32 lighting-app BRD4161A (read only) 834376 833780 -596 -0.1
(read/write) 128632 128580 -52 -0.0
.bss 126760 126712 -48 -0.0
.text 834368 833772 -596 -0.1
BRD4161A+rpc (read only) 821980 821400 -580 -0.1
(read/write) 145304 145256 -48 -0.0
.bss 143336 143288 -48 -0.0
.text 821972 821392 -580 -0.1
window-app BRD4161A (read only) 811616 811004 -612 -0.1
(read/write) 127576 127528 -48 -0.0
.bss 125744 125696 -48 -0.0
.text 811608 810996 -612 -0.1
esp32 all-clusters-app c3devkit (read only) 877288 877208 -80 -0.0
(read/write) 1313434 1313378 -56 -0.0
.dram0.bss 71080 71048 -32 -0.0
.flash.rodata 175096 175072 -24 -0.0
.flash.text 877288 877208 -80 -0.0
m5stack (read only) 965191 964983 -208 -0.0
(read/write) 454720 454656 -64 -0.0
.dram0.bss 77552 77512 -40 -0.1
.flash.rodata 211332 211308 -24 -0.0
.flash.text 959807 959599 -208 -0.0
k32w lighting-app k32w061+se05x+release (read/write) 688072 687952 -120 -0.0
.bss 79344 79296 -48 -0.1
.text 601028 600956 -72 -0.0
lock-app k32w061+debug (read/write) 638012 637892 -120 -0.0
.bss 77496 77448 -48 -0.1
.text 552856 552784 -72 -0.0
shell k32w061+debug (read/write) 643416 643288 -128 -0.0
.bss 79804 79748 -56 -0.1
.text 555972 555900 -72 -0.0
linux chip-tool-ipv6only arm64 (read only) 6894636 6892604 -2032 -0.0
(read/write) 324033 323921 -112 -0.0
.bss 56001 55905 -96 -0.2
.data.rel.ro 209248 209176 -72 -0.0
.rodata 366380 366044 -336 -0.1
.text 5844996 5843364 -1632 -0.0
thermostat-no-ble arm64 (read only) 2003596 2001612 -1984 -0.1
(read/write) 145265 145137 -128 -0.1
.bss 65633 65537 -96 -0.1
.data.rel.ro 72064 71992 -72 -0.1
.rodata 127996 127644 -352 -0.3
.text 1664112 1662544 -1568 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2335416 2335320 -96 -0.0
.bss 190332 190284 -48 -0.0
.text 1297992 1297896 -96 -0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2330952 2330864 -88 -0.0
.bss 182192 182144 -48 -0.0
.text 1293552 1293464 -88 -0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2304072 2303920 -152 -0.0
.bss 181232 181184 -48 -0.0
.text 1266672 1266520 -152 -0.0
shell CY8CPROTO_062_4343W+release (read/write) 2054328 2054312 -16 -0.0
.text 1016928 1016912 -16 -0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 923587 923435 -152 -0.0
bss 119852 119804 -48 -0.0
rodata 103620 103596 -24 -0.0
text 624516 624448 -68 -0.0
nrf52840dk_nrf52840+rpc (read/write) 886627 886475 -152 -0.0
bss 116200 116152 -48 -0.0
rodata 94916 94892 -24 -0.0
text 599252 599184 -68 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 849602 849450 -152 -0.0
bss 121224 121176 -48 -0.0
rodata 98876 98852 -24 -0.0
text 554952 554880 -72 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 898327 898207 -120 -0.0
bss 119028 118980 -48 -0.0
rodata 99736 99712 -24 -0.0
text 604156 604088 -68 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 824602 824466 -136 -0.0
bss 120440 120392 -48 -0.0
rodata 95028 95004 -24 -0.0
text 534688 534616 -72 -0.0
pump-app nrf52840dk_nrf52840 (read/write) 903283 903163 -120 -0.0
bss 118940 118892 -48 -0.0
rodata 101092 101068 -24 -0.0
text 607760 607692 -68 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 896523 896371 -152 -0.0
bss 118820 118772 -48 -0.0
rodata 99228 99204 -24 -0.0
text 602956 602888 -68 -0.0
shell nrf52840dk_nrf52840 (read/write) 782767 782723 -44 -0.0
rodata 74396 74384 -12 -0.0
text 524232 524208 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 697838 697794 -44 -0.0
rodata 69040 69028 -12 -0.0
text 444868 444840 -28 -0.0
p6 all-clusters-app default (read/write) 2388392 2387672 -720 -0.0
.bss 118532 118484 -48 -0.0
.text 1346656 1345936 -720 -0.1
light-app default (read/write) 2328696 2327976 -720 -0.0
.bss 107448 107400 -48 -0.0
.text 1286960 1286240 -720 -0.1
lock-app default (read/write) 2304760 2304032 -728 -0.0
.bss 106328 106280 -48 -0.0
.text 1263024 1262296 -728 -0.1
qpg lighting-app qpg6105+debug (read only) 532772 532684 -88 -0.0
.bss 88096 88048 -48 -0.1
.text 527452 527364 -88 -0.0
lock-app qpg6105+debug (read only) 507140 507052 -88 -0.0
.bss 87232 87184 -48 -0.1
.text 501820 501732 -88 -0.0
telink lighting-app tlsr9518adk80d (read/write) 832822 832758 -64 -0.0
bss 88336 88296 -40 -0.0
text 580514 580504 -10 -0.0
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 7ae1cc9 5a44abb change % change
efr32 lighting-app BRD4161A (read only) 834376 833780 -596 -0.1
(read/write) 128632 128580 -52 -0.0
.bss 126760 126712 -48 -0.0
.data 1868 1868 0 0.0
.text 834368 833772 -596 -0.1
BRD4161A+rpc (read only) 821980 821400 -580 -0.1
(read/write) 145304 145256 -48 -0.0
.bss 143336 143288 -48 -0.0
.data 1968 1968 0 0.0
.text 821972 821392 -580 -0.1
window-app BRD4161A (read only) 811616 811004 -612 -0.1
(read/write) 127576 127528 -48 -0.0
.bss 125744 125696 -48 -0.0
.data 1832 1832 0 0.0
.text 811608 810996 -612 -0.1
esp32 all-clusters-app c3devkit (read only) 877288 877208 -80 -0.0
(read/write) 1313434 1313378 -56 -0.0
.dram0.bss 71080 71048 -32 -0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 175096 175072 -24 -0.0
.flash.text 877288 877208 -80 -0.0
.iram0.text 62076 62076 0 0.0
m5stack (read only) 965191 964983 -208 -0.0
(read/write) 454720 454656 -64 -0.0
.dram0.bss 77552 77512 -40 -0.1
.dram0.data 34048 34048 0 0.0
.flash.rodata 211332 211308 -24 -0.0
.flash.text 959807 959599 -208 -0.0
.iram0.text 123451 123451 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 688072 687952 -120 -0.0
.bss 79344 79296 -48 -0.1
.data 1900 1900 0 0.0
.text 601028 600956 -72 -0.0
lock-app k32w061+debug (read/write) 638012 637892 -120 -0.0
.bss 77496 77448 -48 -0.1
.data 1860 1860 0 0.0
.text 552856 552784 -72 -0.0
shell k32w061+debug (read/write) 643416 643288 -128 -0.0
.bss 79804 79748 -56 -0.1
.data 1840 1840 0 0.0
.text 555972 555900 -72 -0.0
linux chip-tool-ipv6only arm64 (read only) 6894636 6892604 -2032 -0.0
(read/write) 324033 323921 -112 -0.0
.bss 56001 55905 -96 -0.2
.data 1192 1192 0 0.0
.data.rel.ro 209248 209176 -72 -0.0
.dynamic 560 560 0 0.0
.got 53864 53912 48 0.1
.init 24 24 0 0.0
.init_array 176 176 0 0.0
.rodata 366380 366044 -336 -0.1
.text 5844996 5843364 -1632 -0.0
thermostat-no-ble arm64 (read only) 2003596 2001612 -1984 -0.1
(read/write) 145265 145137 -128 -0.1
.bss 65633 65537 -96 -0.1
.data 832 832 0 0.0
.data.rel.ro 72064 71992 -72 -0.1
.dynamic 560 560 0 0.0
.got 3840 3888 48 1.2
.init 24 24 0 0.0
.init_array 288 288 0 0.0
.rodata 127996 127644 -352 -0.3
.text 1664112 1662544 -1568 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2335416 2335320 -96 -0.0
.bss 190332 190284 -48 -0.0
.data 5248 5248 0 0.0
.heap 840864 840912 48 0.0
.text 1297992 1297896 -96 -0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2330952 2330864 -88 -0.0
.bss 182192 182144 -48 -0.0
.data 5544 5544 0 0.0
.heap 848712 848760 48 0.0
.text 1293552 1293464 -88 -0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2304072 2303920 -152 -0.0
.bss 181232 181184 -48 -0.0
.data 5528 5528 0 0.0
.heap 849688 849736 48 0.0
.text 1266672 1266520 -152 -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 4368 4368 0 0.0
.heap 1020320 1020320 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2054328 2054312 -16 -0.0
.bss 156980 156980 0 0.0
.data 4864 4864 0 0.0
.heap 874600 874600 0 0.0
.text 1016928 1016912 -16 -0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 923587 923435 -152 -0.0
bss 119852 119804 -48 -0.0
rodata 103620 103596 -24 -0.0
text 624516 624448 -68 -0.0
nrf52840dk_nrf52840+rpc (read/write) 886627 886475 -152 -0.0
bss 116200 116152 -48 -0.0
rodata 94916 94892 -24 -0.0
text 599252 599184 -68 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 849602 849450 -152 -0.0
bss 121224 121176 -48 -0.0
rodata 98876 98852 -24 -0.0
text 554952 554880 -72 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 898327 898207 -120 -0.0
bss 119028 118980 -48 -0.0
rodata 99736 99712 -24 -0.0
text 604156 604088 -68 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 824602 824466 -136 -0.0
bss 120440 120392 -48 -0.0
rodata 95028 95004 -24 -0.0
text 534688 534616 -72 -0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497447 497447 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339488 339488 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 903283 903163 -120 -0.0
bss 118940 118892 -48 -0.0
rodata 101092 101068 -24 -0.0
text 607760 607692 -68 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 896523 896371 -152 -0.0
bss 118820 118772 -48 -0.0
rodata 99228 99204 -24 -0.0
text 602956 602888 -68 -0.0
shell nrf52840dk_nrf52840 (read/write) 782767 782723 -44 -0.0
bss 109624 109624 0 0.0
rodata 74396 74384 -12 -0.0
text 524232 524208 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 697838 697794 -44 -0.0
bss 110604 110604 0 0.0
rodata 69040 69028 -12 -0.0
text 444868 444840 -28 -0.0
p6 all-clusters-app default (read/write) 2388392 2387672 -720 -0.0
.bss 118532 118484 -48 -0.0
.data 2536 2536 0 0.0
.heap 912272 912320 48 0.0
.text 1346656 1345936 -720 -0.1
light-app default (read/write) 2328696 2327976 -720 -0.0
.bss 107448 107400 -48 -0.0
.data 2376 2376 0 0.0
.heap 923520 923568 48 0.0
.text 1286960 1286240 -720 -0.1
lock-app default (read/write) 2304760 2304032 -728 -0.0
.bss 106328 106280 -48 -0.0
.data 2336 2336 0 0.0
.heap 924680 924728 48 0.0
.text 1263024 1262296 -728 -0.1
qpg lighting-app qpg6105+debug (read only) 532772 532684 -88 -0.0
(read/write) 146936 146936 0 0.0
.bss 88096 88048 -48 -0.1
.data 996 996 0 0.0
.text 527452 527364 -88 -0.0
lock-app qpg6105+debug (read only) 507140 507052 -88 -0.0
(read/write) 146940 146940 0 0.0
.bss 87232 87184 -48 -0.1
.data 952 952 0 0.0
.text 501820 501732 -88 -0.0
persistent-storage-app qpg6105+debug (read only) 106448 106448 0 0.0
(read/write) 146938 146938 0 0.0
.bss 36146 36146 0 0.0
.data 288 288 0 0.0
.text 101128 101128 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 832822 832758 -64 -0.0
bss 88336 88296 -40 -0.0
noinit 37160 37160 0 0.0
text 580514 580504 -10 -0.0

@github-actions
Copy link

github-actions bot commented Dec 21, 2021

PR #12794: Size comparison from bf7feea to 3a661b2

Increases above 0.2%:

platform target config section bf7feea 3a661b2 change % change
linux thermostat-no-ble arm64 .got 3888 3936 48 1.2
Increases (21 builds for esp32, k32w, linux, mbed, nrfconnect, qpg, telink)
platform target config section bf7feea 3a661b2 change % change
esp32 all-clusters-app c3devkit (read only) 883166 883244 78 0.0
.flash.text 883166 883244 78 0.0
k32w light k32w061+release (read/write) 648764 648772 8 0.0
.text 564548 564604 56 0.0
lock k32w061+release (read/write) 633472 633496 24 0.0
.text 549588 549660 72 0.0
linux chip-tool-ipv6only arm64 .got 56712 56760 48 0.1
thermostat-no-ble arm64 .got 3888 3936 48 1.2
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2340104 2340144 40 0.0
.text 1302680 1302720 40 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2330576 2330672 96 0.0
.text 1293176 1293272 96 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2303672 2303704 32 0.0
.text 1266272 1266304 32 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2053688 2053736 48 0.0
.text 1016288 1016336 48 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 935967 936007 40 0.0
text 631864 631948 84 0.0
nrf52840dk_nrf52840+rpc text 627176 627260 84 0.0
nrf5340dk_nrf5340_cpuapp text 559308 559384 76 0.0
lock-app nrf52840dk_nrf52840 text 609692 609772 80 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 832042 832066 24 0.0
text 537172 537252 80 0.0
pump-app nrf52840dk_nrf52840 (read/write) 909375 909399 24 0.0
text 610928 611012 84 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 906191 906215 24 0.0
text 608440 608520 80 0.0
shell nrf52840dk_nrf52840 (read/write) 796079 796131 52 0.0
text 532048 532120 72 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 708710 708762 52 0.0
text 449544 449612 68 0.0
qpg lighting-app qpg6105+debug (read only) 532232 532296 64 0.0
.text 526912 526976 64 0.0
lock-app qpg6105+debug (read only) 503912 503968 56 0.0
.text 498592 498648 56 0.0
telink lighting-app tlsr9518adk80d (read/write) 832258 832346 88 0.0
text 580366 580514 148 0.0
Decreases (27 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section bf7feea 3a661b2 change % change
efr32 lighting-app BRD4161A (read only) 830568 830308 -260 -0.0
(read/write) 127384 127332 -52 -0.0
.bss 125504 125456 -48 -0.0
.text 830560 830300 -260 -0.0
BRD4161A+rpc (read only) 818196 817952 -244 -0.0
(read/write) 144048 144000 -48 -0.0
.bss 142072 142024 -48 -0.0
.text 818188 817944 -244 -0.0
window-app BRD4161A (read only) 803944 803700 -244 -0.0
(read/write) 126320 126272 -48 -0.0
.bss 124488 124440 -48 -0.0
.text 803936 803692 -244 -0.0
esp32 all-clusters-app c3devkit (read/write) 1312986 1312930 -56 -0.0
.dram0.bss 69384 69352 -32 -0.0
.flash.rodata 176320 176296 -24 -0.0
m5stack (read only) 943435 943339 -96 -0.0
(read/write) 442080 442016 -64 -0.0
.dram0.bss 73888 73848 -40 -0.1
.flash.rodata 203128 203104 -24 -0.0
.flash.text 938051 937955 -96 -0.0
k32w light k32w061+release .bss 76512 76464 -48 -0.1
lock k32w061+release .bss 76224 76176 -48 -0.1
linux chip-tool-ipv6only arm64 (read only) 7006076 7004108 -1968 -0.0
(read/write) 326289 326193 -96 -0.0
.bss 54641 54561 -80 -0.1
.data.rel.ro 210144 210072 -72 -0.0
.rodata 384228 383892 -336 -0.1
.text 5928548 5926980 -1568 -0.0
thermostat-no-ble arm64 (read only) 2017908 2015988 -1920 -0.1
(read/write) 144497 144369 -128 -0.1
.bss 64417 64321 -96 -0.1
.data.rel.ro 72376 72304 -72 -0.1
.rodata 128932 128580 -352 -0.3
.text 1676304 1674816 -1488 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release .bss 188660 188612 -48 -0.0
lighting-app CY8CPROTO_062_4343W+release .bss 180936 180888 -48 -0.0
lock-app CY8CPROTO_062_4343W+release .bss 179984 179936 -48 -0.0
nrfconnect lighting-app nrf52840dk_nrf52840 bss 118428 118380 -48 -0.0
rodata 108124 108100 -24 -0.0
nrf52840dk_nrf52840+rpc (read/write) 922367 922359 -8 -0.0
bss 115472 115424 -48 -0.0
rodata 101540 101516 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 859730 859722 -8 -0.0
bss 116712 116664 -48 -0.0
rodata 103048 103024 -24 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 908111 908103 -8 -0.0
bss 117616 117568 -48 -0.0
rodata 103428 103404 -24 -0.0
nrf5340dk_nrf5340_cpuapp bss 115928 115880 -48 -0.0
rodata 98392 98368 -24 -0.0
pump-app nrf52840dk_nrf52840 bss 117376 117328 -48 -0.0
rodata 103644 103620 -24 -0.0
pump-controller-app nrf52840dk_nrf52840 bss 117404 117356 -48 -0.0
rodata 102900 102876 -24 -0.0
shell nrf52840dk_nrf52840 rodata 78096 78084 -12 -0.0
nrf5340dk_nrf5340_cpuapp rodata 72396 72384 -12 -0.0
p6 all-clusters-app default (read/write) 2392056 2391872 -184 -0.0
.bss 116860 116812 -48 -0.0
.text 1350320 1350136 -184 -0.0
light-app default (read/write) 2325104 2324920 -184 -0.0
.bss 106184 106136 -48 -0.0
.text 1283368 1283184 -184 -0.0
lock-app default (read/write) 2297312 2297136 -176 -0.0
.bss 105064 105016 -48 -0.0
.text 1255576 1255400 -176 -0.0
qpg lighting-app qpg6105+debug .bss 86840 86792 -48 -0.1
lock-app qpg6105+debug .bss 85976 85928 -48 -0.1
telink lighting-app tlsr9518adk80d bss 87088 87048 -40 -0.0
Full report (31 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section bf7feea 3a661b2 change % change
efr32 lighting-app BRD4161A (read only) 830568 830308 -260 -0.0
(read/write) 127384 127332 -52 -0.0
.bss 125504 125456 -48 -0.0
.data 1876 1876 0 0.0
.text 830560 830300 -260 -0.0
BRD4161A+rpc (read only) 818196 817952 -244 -0.0
(read/write) 144048 144000 -48 -0.0
.bss 142072 142024 -48 -0.0
.data 1976 1976 0 0.0
.text 818188 817944 -244 -0.0
window-app BRD4161A (read only) 803944 803700 -244 -0.0
(read/write) 126320 126272 -48 -0.0
.bss 124488 124440 -48 -0.0
.data 1832 1832 0 0.0
.text 803936 803692 -244 -0.0
esp32 all-clusters-app c3devkit (read only) 883166 883244 78 0.0
(read/write) 1312986 1312930 -56 -0.0
.dram0.bss 69384 69352 -32 -0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 176320 176296 -24 -0.0
.flash.text 883166 883244 78 0.0
.iram0.text 62254 62254 0 0.0
m5stack (read only) 943435 943339 -96 -0.0
(read/write) 442080 442016 -64 -0.0
.dram0.bss 73888 73848 -40 -0.1
.dram0.data 34056 34056 0 0.0
.flash.rodata 203128 203104 -24 -0.0
.flash.text 938051 937955 -96 -0.0
.iram0.text 122671 122671 0 0.0
k32w light k32w061+release (read/write) 648764 648772 8 0.0
.bss 76512 76464 -48 -0.1
.data 1904 1904 0 0.0
.text 564548 564604 56 0.0
lock k32w061+release (read/write) 633472 633496 24 0.0
.bss 76224 76176 -48 -0.1
.data 1860 1860 0 0.0
.text 549588 549660 72 0.0
linux chip-tool-ipv6only arm64 (read only) 7006076 7004108 -1968 -0.0
(read/write) 326289 326193 -96 -0.0
.bss 54641 54561 -80 -0.1
.data 1096 1096 0 0.0
.data.rel.ro 210144 210072 -72 -0.0
.dynamic 560 560 0 0.0
.got 56712 56760 48 0.1
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 384228 383892 -336 -0.1
.text 5928548 5926980 -1568 -0.0
thermostat-no-ble arm64 (read only) 2017908 2015988 -1920 -0.1
(read/write) 144497 144369 -128 -0.1
.bss 64417 64321 -96 -0.1
.data 880 880 0 0.0
.data.rel.ro 72376 72304 -72 -0.1
.dynamic 560 560 0 0.0
.got 3888 3936 48 1.2
.init 24 24 0 0.0
.init_array 296 296 0 0.0
.rodata 128932 128580 -352 -0.3
.text 1676304 1674816 -1488 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2340104 2340144 40 0.0
.bss 188660 188612 -48 -0.0
.data 5272 5272 0 0.0
.text 1302680 1302720 40 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2330576 2330672 96 0.0
.bss 180936 180888 -48 -0.0
.data 5552 5552 0 0.0
.text 1293176 1293272 96 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2303672 2303704 32 0.0
.bss 179984 179936 -48 -0.0
.data 5544 5544 0 0.0
.text 1266272 1266304 32 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 4368 4368 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2053688 2053736 48 0.0
.bss 156972 156972 0 0.0
.data 4864 4864 0 0.0
.text 1016288 1016336 48 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 935967 936007 40 0.0
bss 118428 118380 -48 -0.0
rodata 108124 108100 -24 -0.0
text 631864 631948 84 0.0
nrf52840dk_nrf52840+rpc (read/write) 922367 922359 -8 -0.0
bss 115472 115424 -48 -0.0
rodata 101540 101516 -24 -0.0
text 627176 627260 84 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 859730 859722 -8 -0.0
bss 116712 116664 -48 -0.0
rodata 103048 103024 -24 -0.0
text 559308 559384 76 0.0
lock-app nrf52840dk_nrf52840 (read/write) 908111 908103 -8 -0.0
bss 117616 117568 -48 -0.0
rodata 103428 103404 -24 -0.0
text 609692 609772 80 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 832042 832066 24 0.0
bss 115928 115880 -48 -0.0
rodata 98392 98368 -24 -0.0
text 537172 537252 80 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 542351 542351 0 0.0
bss 52588 52588 0 0.0
rodata 50668 50668 0 0.0
text 376892 376892 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 909375 909399 24 0.0
bss 117376 117328 -48 -0.0
rodata 103644 103620 -24 -0.0
text 610928 611012 84 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 906191 906215 24 0.0
bss 117404 117356 -48 -0.0
rodata 102900 102876 -24 -0.0
text 608440 608520 80 0.0
shell nrf52840dk_nrf52840 (read/write) 796079 796131 52 0.0
bss 109464 109464 0 0.0
rodata 78096 78084 -12 -0.0
text 532048 532120 72 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 708710 708762 52 0.0
bss 107352 107352 0 0.0
rodata 72396 72384 -12 -0.0
text 449544 449612 68 0.0
p6 all-clusters-app default (read/write) 2392056 2391872 -184 -0.0
.bss 116860 116812 -48 -0.0
.data 2552 2552 0 0.0
.text 1350320 1350136 -184 -0.0
light-app default (read/write) 2325104 2324920 -184 -0.0
.bss 106184 106136 -48 -0.0
.data 2384 2384 0 0.0
.text 1283368 1283184 -184 -0.0
lock-app default (read/write) 2297312 2297136 -176 -0.0
.bss 105064 105016 -48 -0.0
.data 2336 2336 0 0.0
.text 1255576 1255400 -176 -0.0
qpg lighting-app qpg6105+debug (read only) 532232 532296 64 0.0
(read/write) 146936 146936 0 0.0
.bss 86840 86792 -48 -0.1
.data 1004 1004 0 0.0
.text 526912 526976 64 0.0
lock-app qpg6105+debug (read only) 503912 503968 56 0.0
(read/write) 146940 146940 0 0.0
.bss 85976 85928 -48 -0.1
.data 952 952 0 0.0
.text 498592 498648 56 0.0
persistent-storage-app qpg6105+debug (read only) 106448 106448 0 0.0
(read/write) 146938 146938 0 0.0
.bss 36146 36146 0 0.0
.data 288 288 0 0.0
.text 101128 101128 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 832258 832346 88 0.0
bss 87088 87048 -40 -0.0
noinit 37160 37160 0 0.0
text 580366 580514 148 0.0

@github-actions
Copy link

github-actions bot commented Dec 22, 2021

PR #12794: Size comparison from 6e035c8 to 7b4fbe8

Increases above 0.2%:

platform target config section 6e035c8 7b4fbe8 change % change
linux thermostat-no-ble arm64 .got 3888 3936 48 1.2
Increases (21 builds for esp32, k32w, linux, mbed, nrfconnect, qpg, telink)
platform target config section 6e035c8 7b4fbe8 change % change
esp32 all-clusters-app c3devkit (read only) 884820 884898 78 0.0
.flash.text 884820 884898 78 0.0
k32w light k32w061+release (read/write) 647512 647520 8 0.0
.text 563576 563632 56 0.0
lock k32w061+release (read/write) 632224 632248 24 0.0
.text 548620 548692 72 0.0
linux chip-tool-ipv6only arm64 .got 56728 56776 48 0.1
thermostat-no-ble arm64 .got 3888 3936 48 1.2
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2341320 2341360 40 0.0
.text 1303896 1303936 40 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2329120 2329160 40 0.0
.text 1291720 1291760 40 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2302152 2302192 40 0.0
.text 1264752 1264792 40 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2053840 2053888 48 0.0
.text 1016440 1016488 48 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 text 631024 631108 84 0.0
nrf52840dk_nrf52840+rpc (read/write) 921015 921055 40 0.0
text 626336 626420 84 0.0
nrf5340dk_nrf5340_cpuapp text 558468 558544 76 0.0
lock-app nrf52840dk_nrf52840 (read/write) 906775 906799 24 0.0
text 608852 608932 80 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 830690 830714 24 0.0
text 536332 536412 80 0.0
pump-app nrf52840dk_nrf52840 text 610088 610172 84 0.0
pump-controller-app nrf52840dk_nrf52840 text 607600 607680 80 0.0
shell nrf52840dk_nrf52840 (read/write) 796079 796131 52 0.0
text 532048 532120 72 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 708710 708762 52 0.0
text 449544 449612 68 0.0
qpg lighting-app qpg6105+debug (read only) 531120 531192 72 0.0
.text 525800 525872 72 0.0
lock-app qpg6105+debug (read only) 502812 502860 48 0.0
.text 497492 497540 48 0.0
telink lighting-app tlsr9518adk80d (read/write) 830770 830850 80 0.0
text 579380 579528 148 0.0
Decreases (27 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 6e035c8 7b4fbe8 change % change
efr32 lighting-app BRD4161A (read only) 829152 828908 -244 -0.0
(read/write) 127104 127052 -52 -0.0
.bss 125224 125176 -48 -0.0
.text 829144 828900 -244 -0.0
BRD4161A+rpc (read only) 816796 816552 -244 -0.0
(read/write) 143768 143720 -48 -0.0
.bss 141792 141744 -48 -0.0
.text 816788 816544 -244 -0.0
window-app BRD4161A (read only) 802616 802372 -244 -0.0
(read/write) 126040 125992 -48 -0.0
.bss 124208 124160 -48 -0.0
.text 802608 802364 -244 -0.0
esp32 all-clusters-app c3devkit (read/write) 1312466 1312410 -56 -0.0
.dram0.bss 69104 69072 -32 -0.0
.flash.rodata 176088 176064 -24 -0.0
m5stack (read only) 945571 945471 -100 -0.0
(read/write) 441592 441528 -64 -0.0
.dram0.bss 73608 73568 -40 -0.1
.flash.rodata 202920 202896 -24 -0.0
.flash.text 940187 940087 -100 -0.0
k32w light k32w061+release .bss 76232 76184 -48 -0.1
lock k32w061+release .bss 75944 75896 -48 -0.1
linux chip-tool-ipv6only arm64 (read only) 6999268 6997300 -1968 -0.0
(read/write) 325953 325841 -112 -0.0
.bss 54305 54209 -96 -0.2
.data.rel.ro 210128 210056 -72 -0.0
.rodata 384220 383884 -336 -0.1
.text 5921604 5920036 -1568 -0.0
thermostat-no-ble arm64 (read only) 2013428 2011508 -1920 -0.1
(read/write) 144033 143937 -96 -0.1
.bss 64065 63985 -80 -0.1
.data.rel.ro 72272 72200 -72 -0.1
.rodata 128820 128468 -352 -0.3
.text 1672016 1670512 -1504 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release .bss 188380 188332 -48 -0.0
lighting-app CY8CPROTO_062_4343W+release .bss 180656 180608 -48 -0.0
lock-app CY8CPROTO_062_4343W+release .bss 179704 179656 -48 -0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 934663 934655 -8 -0.0
bss 118148 118100 -48 -0.0
rodata 107908 107884 -24 -0.0
nrf52840dk_nrf52840+rpc bss 115192 115144 -48 -0.0
rodata 101324 101300 -24 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 858394 858370 -24 -0.0
bss 116432 116384 -48 -0.0
rodata 102832 102808 -24 -0.0
lock-app nrf52840dk_nrf52840 bss 117336 117288 -48 -0.0
rodata 103212 103188 -24 -0.0
nrf5340dk_nrf5340_cpuapp bss 115648 115600 -48 -0.0
rodata 98176 98152 -24 -0.0
pump-app nrf52840dk_nrf52840 (read/write) 908071 908063 -8 -0.0
bss 117096 117048 -48 -0.0
rodata 103428 103404 -24 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 904887 904879 -8 -0.0
bss 117124 117076 -48 -0.0
rodata 102684 102660 -24 -0.0
shell nrf52840dk_nrf52840 rodata 78096 78084 -12 -0.0
nrf5340dk_nrf5340_cpuapp rodata 72396 72384 -12 -0.0
p6 all-clusters-app default (read/write) 2393848 2393688 -160 -0.0
.bss 116580 116532 -48 -0.0
.text 1352112 1351952 -160 -0.0
light-app default (read/write) 2323808 2323648 -160 -0.0
.bss 105904 105856 -48 -0.0
.text 1282072 1281912 -160 -0.0
lock-app default (read/write) 2296032 2295864 -168 -0.0
.bss 104784 104736 -48 -0.0
.text 1254296 1254128 -168 -0.0
qpg lighting-app qpg6105+debug .bss 86704 86656 -48 -0.1
lock-app qpg6105+debug .bss 85840 85792 -48 -0.1
telink lighting-app tlsr9518adk80d bss 86808 86768 -40 -0.0
Full report (31 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 6e035c8 7b4fbe8 change % change
efr32 lighting-app BRD4161A (read only) 829152 828908 -244 -0.0
(read/write) 127104 127052 -52 -0.0
.bss 125224 125176 -48 -0.0
.data 1876 1876 0 0.0
.text 829144 828900 -244 -0.0
BRD4161A+rpc (read only) 816796 816552 -244 -0.0
(read/write) 143768 143720 -48 -0.0
.bss 141792 141744 -48 -0.0
.data 1976 1976 0 0.0
.text 816788 816544 -244 -0.0
window-app BRD4161A (read only) 802616 802372 -244 -0.0
(read/write) 126040 125992 -48 -0.0
.bss 124208 124160 -48 -0.0
.data 1832 1832 0 0.0
.text 802608 802364 -244 -0.0
esp32 all-clusters-app c3devkit (read only) 884820 884898 78 0.0
(read/write) 1312466 1312410 -56 -0.0
.dram0.bss 69104 69072 -32 -0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 176088 176064 -24 -0.0
.flash.text 884820 884898 78 0.0
.iram0.text 62254 62254 0 0.0
m5stack (read only) 945571 945471 -100 -0.0
(read/write) 441592 441528 -64 -0.0
.dram0.bss 73608 73568 -40 -0.1
.dram0.data 34056 34056 0 0.0
.flash.rodata 202920 202896 -24 -0.0
.flash.text 940187 940087 -100 -0.0
.iram0.text 122671 122671 0 0.0
k32w light k32w061+release (read/write) 647512 647520 8 0.0
.bss 76232 76184 -48 -0.1
.data 1904 1904 0 0.0
.text 563576 563632 56 0.0
lock k32w061+release (read/write) 632224 632248 24 0.0
.bss 75944 75896 -48 -0.1
.data 1860 1860 0 0.0
.text 548620 548692 72 0.0
linux chip-tool-ipv6only arm64 (read only) 6999268 6997300 -1968 -0.0
(read/write) 325953 325841 -112 -0.0
.bss 54305 54209 -96 -0.2
.data 1096 1096 0 0.0
.data.rel.ro 210128 210056 -72 -0.0
.dynamic 560 560 0 0.0
.got 56728 56776 48 0.1
.init 24 24 0 0.0
.init_array 168 168 0 0.0
.rodata 384220 383884 -336 -0.1
.text 5921604 5920036 -1568 -0.0
thermostat-no-ble arm64 (read only) 2013428 2011508 -1920 -0.1
(read/write) 144033 143937 -96 -0.1
.bss 64065 63985 -80 -0.1
.data 880 880 0 0.0
.data.rel.ro 72272 72200 -72 -0.1
.dynamic 560 560 0 0.0
.got 3888 3936 48 1.2
.init 24 24 0 0.0
.init_array 296 296 0 0.0
.rodata 128820 128468 -352 -0.3
.text 1672016 1670512 -1504 -0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2341320 2341360 40 0.0
.bss 188380 188332 -48 -0.0
.data 5280 5280 0 0.0
.text 1303896 1303936 40 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2329120 2329160 40 0.0
.bss 180656 180608 -48 -0.0
.data 5552 5552 0 0.0
.text 1291720 1291760 40 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2302152 2302192 40 0.0
.bss 179704 179656 -48 -0.0
.data 5544 5544 0 0.0
.text 1264752 1264792 40 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 4368 4368 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2053840 2053888 48 0.0
.bss 156972 156972 0 0.0
.data 4864 4864 0 0.0
.text 1016440 1016488 48 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 934663 934655 -8 -0.0
bss 118148 118100 -48 -0.0
rodata 107908 107884 -24 -0.0
text 631024 631108 84 0.0
nrf52840dk_nrf52840+rpc (read/write) 921015 921055 40 0.0
bss 115192 115144 -48 -0.0
rodata 101324 101300 -24 -0.0
text 626336 626420 84 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 858394 858370 -24 -0.0
bss 116432 116384 -48 -0.0
rodata 102832 102808 -24 -0.0
text 558468 558544 76 0.0
lock-app nrf52840dk_nrf52840 (read/write) 906775 906799 24 0.0
bss 117336 117288 -48 -0.0
rodata 103212 103188 -24 -0.0
text 608852 608932 80 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 830690 830714 24 0.0
bss 115648 115600 -48 -0.0
rodata 98176 98152 -24 -0.0
text 536332 536412 80 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 542351 542351 0 0.0
bss 52588 52588 0 0.0
rodata 50668 50668 0 0.0
text 376892 376892 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 908071 908063 -8 -0.0
bss 117096 117048 -48 -0.0
rodata 103428 103404 -24 -0.0
text 610088 610172 84 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 904887 904879 -8 -0.0
bss 117124 117076 -48 -0.0
rodata 102684 102660 -24 -0.0
text 607600 607680 80 0.0
shell nrf52840dk_nrf52840 (read/write) 796079 796131 52 0.0
bss 109464 109464 0 0.0
rodata 78096 78084 -12 -0.0
text 532048 532120 72 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 708710 708762 52 0.0
bss 107352 107352 0 0.0
rodata 72396 72384 -12 -0.0
text 449544 449612 68 0.0
p6 all-clusters-app default (read/write) 2393848 2393688 -160 -0.0
.bss 116580 116532 -48 -0.0
.data 2552 2552 0 0.0
.text 1352112 1351952 -160 -0.0
light-app default (read/write) 2323808 2323648 -160 -0.0
.bss 105904 105856 -48 -0.0
.data 2384 2384 0 0.0
.text 1282072 1281912 -160 -0.0
lock-app default (read/write) 2296032 2295864 -168 -0.0
.bss 104784 104736 -48 -0.0
.data 2336 2336 0 0.0
.text 1254296 1254128 -168 -0.0
qpg lighting-app qpg6105+debug (read only) 531120 531192 72 0.0
(read/write) 146936 146936 0 0.0
.bss 86704 86656 -48 -0.1
.data 1004 1004 0 0.0
.text 525800 525872 72 0.0
lock-app qpg6105+debug (read only) 502812 502860 48 0.0
(read/write) 146940 146940 0 0.0
.bss 85840 85792 -48 -0.1
.data 952 952 0 0.0
.text 497492 497540 48 0.0
persistent-storage-app qpg6105+debug (read only) 106448 106448 0 0.0
(read/write) 146938 146938 0 0.0
.bss 36146 36146 0 0.0
.data 288 288 0 0.0
.text 101128 101128 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 830770 830850 80 0.0
bss 86808 86768 -40 -0.0
noinit 37160 37160 0 0.0
text 579380 579528 148 0.0

@kghost kghost merged commit 9a80f75 into project-chip:master Dec 22, 2021
@kghost kghost deleted the exchange-dispatch branch December 22, 2021 08:49
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Jan 7, 2022
The fix in project-chip#12794 means that the CASESession and PASESession objects do
not need to persist for ExchangeMessageDispatch::SendMessage to succeed
at the final ACK of session establishment.  Instead, SendMessage uses the
SessionEstablishmentExchangeDispatch global singleton.

Ths means we can address 13146 such that CASESession and PASESession may
actually be freed or reused when completion callbacks fire.  This will
only work, however, if these objects clear themselves as delegates for
their exchange contexts when discarding references to these.  This
commit does so.

This commit also reorders all calls to mDelegate->OnSessionEstablished and
mDelegate->OnSessionEstablishmentError to occur last in any given method
in case mDelegate frees or reuses the CASESession or PASESession objects
on execution of these completion callbacks.

With this, we can remove the behavior in the OperationalDeviceProxy which
that was defering release of the CASESession object until after an
iteration of the event loop.  Now when OnSessionEstablished fires, the
CASESession can be reused or discared immediately.
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Jan 7, 2022
The fix in project-chip#12794 means that the CASESession and PASESession objects do
not need to persist for ExchangeMessageDispatch::SendMessage to succeed
at the final ACK of session establishment.  Instead, SendMessage uses the
SessionEstablishmentExchangeDispatch global singleton.

Ths means we can address 13146 such that CASESession and PASESession may
actually be freed or reused when completion callbacks fire.  This will
only work, however, if these objects clear themselves as delegates for
their exchange contexts when discarding references to these.  This
commit does so.

This commit also reorders all calls to mDelegate->OnSessionEstablished and
mDelegate->OnSessionEstablishmentError to occur last in any given method
in case mDelegate frees or reuses the CASESession or PASESession objects
on execution of these completion callbacks.

With this, we can remove the behavior in the OperationalDeviceProxy which
that was defering release of the CASESession object until after an
iteration of the event loop.  Now when OnSessionEstablished fires, the
CASESession can be reused or discared immediately.
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Jan 7, 2022
The fix in project-chip#12794 means that the CASESession and PASESession objects do
not need to persist for ExchangeMessageDispatch::SendMessage to succeed
at the final ACK of session establishment.  Instead, SendMessage uses the
SessionEstablishmentExchangeDispatch global singleton.

This means we can address 13146 such that CASESession and PASESession may
actually be freed or reused when completion callbacks fire.  This will
only work, however, if these objects clear themselves as delegates for
their exchange contexts when discarding references to these.  This
commit does so.

This commit also reorders all calls to mDelegate->OnSessionEstablished and
mDelegate->OnSessionEstablishmentError to occur last in any given method
in case mDelegate frees or reuses the CASESession or PASESession objects
on execution of these completion callbacks.

With this, we can remove the behavior in the OperationalDeviceProxy which
that was defering release of the CASESession object until after an
iteration of the event loop.  Now when OnSessionEstablished fires, the
CASESession can be reused or discared immediately.
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Jan 7, 2022
The fix in project-chip#12794 means that the CASESession and PASESession objects do
not need to persist for ExchangeMessageDispatch::SendMessage to succeed
at the final ACK of session establishment.  Instead, SendMessage uses the
SessionEstablishmentExchangeDispatch global singleton.

This means we can address 13146 such that CASESession and PASESession may
actually be freed or reused when completion callbacks fire.  This will
only work, however, if these objects clear themselves as delegates for
their exchange contexts when discarding references to these.  This
commit does so.

This commit also reorders all calls to mDelegate->OnSessionEstablished and
mDelegate->OnSessionEstablishmentError to occur last in any given method
in case mDelegate frees or reuses the CASESession or PASESession objects
on execution of these completion callbacks.

With this, we can remove the code in the OperationalDeviceProxy that
defers release of the CASESession object until after an iteration of the
event loop.  Now when OnSessionEstablished fires, the CASESession can be
reused or discarded immediately.
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Jan 7, 2022
The fix in project-chip#12794 means that the CASESession and PASESession objects do
not need to persist for ExchangeMessageDispatch::SendMessage to succeed
at the final ACK of session establishment.  Instead, SendMessage uses the
SessionEstablishmentExchangeDispatch global singleton.

This means we can address 13146 such that CASESession and PASESession may
actually be freed or reused when completion callbacks fire.  This will
only work, however, if these objects clear themselves as delegates for
their exchange contexts when discarding references to these.  This
commit does so.

This commit also reorders all calls to mDelegate->OnSessionEstablished and
mDelegate->OnSessionEstablishmentError to occur last in any given method
in case mDelegate frees or reuses the CASESession or PASESession objects
on execution of these completion callbacks.

With this, we can remove the code in the OperationalDeviceProxy that
defers release of the CASESession object until after an iteration of the
event loop.  Now when OnSessionEstablished fires, the CASESession can be
reused or discarded immediately.
msandstedt added a commit that referenced this pull request Jan 7, 2022
The fix in #12794 means that the CASESession and PASESession objects do
not need to persist for ExchangeMessageDispatch::SendMessage to succeed
at the final ACK of session establishment.  Instead, SendMessage uses the
SessionEstablishmentExchangeDispatch global singleton.

This means we can address 13146 such that CASESession and PASESession may
actually be freed or reused when completion callbacks fire.  This will
only work, however, if these objects clear themselves as delegates for
their exchange contexts when discarding references to these.  This
commit does so.

This commit also reorders all calls to mDelegate->OnSessionEstablished and
mDelegate->OnSessionEstablishmentError to occur last in any given method
in case mDelegate frees or reuses the CASESession or PASESession objects
on execution of these completion callbacks.

With this, we can remove the code in the OperationalDeviceProxy that
defers release of the CASESession object until after an iteration of the
event loop.  Now when OnSessionEstablished fires, the CASESession can be
reused or discarded immediately.
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Jan 7, 2022
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Jan 8, 2022
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Jan 27, 2022
msandstedt added a commit to msandstedt/connectedhomeip that referenced this pull request Feb 3, 2022
step0035 pushed a commit to hank820/connectedhomeip that referenced this pull request Feb 8, 2022
The fix in project-chip#12794 means that the CASESession and PASESession objects do
not need to persist for ExchangeMessageDispatch::SendMessage to succeed
at the final ACK of session establishment.  Instead, SendMessage uses the
SessionEstablishmentExchangeDispatch global singleton.

This means we can address 13146 such that CASESession and PASESession may
actually be freed or reused when completion callbacks fire.  This will
only work, however, if these objects clear themselves as delegates for
their exchange contexts when discarding references to these.  This
commit does so.

This commit also reorders all calls to mDelegate->OnSessionEstablished and
mDelegate->OnSessionEstablishmentError to occur last in any given method
in case mDelegate frees or reuses the CASESession or PASESession objects
on execution of these completion callbacks.

With this, we can remove the code in the OperationalDeviceProxy that
defers release of the CASESession object until after an iteration of the
event loop.  Now when OnSessionEstablished fires, the CASESession can be
reused or discarded immediately.
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