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

Fix shutdown ordering issue in Server.cpp. #34035

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

bzbarsky-apple
Copy link
Contributor

We could end up shutting down the exchange manager while we still had live sessions/exchanges, at which point shutting down those would crash as they tried to get information from the exchange manager.

The fix is to document the required shutdown ordering and enforce it correctly in CHIPDeviceControllerFactory and Server.

Fixes #20880

We could end up shutting down the exchange manager while we still had live
sessions/exchanges, at which point shutting down those would crash as they tried
to get information from the exchange manager.

The fix is to document the required shutdown ordering and enforce it correctly
in CHIPDeviceControllerFactory and Server.

Fixes project-chip#20880
Copy link

github-actions bot commented Jun 20, 2024

PR #34035: Size comparison from 3f59179 to ad237ff

Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, mbed, nrfconnect, nxp, qpg, stm32, telink, tizen)
platform target config section 3f59179 ad237ff change % change
bl602 lighting-app bl602 FLASH 1270534 1270550 16 0.0
RAM 95328 95328 0 0.0
bl602+mfd FLASH 1284812 1284828 16 0.0
RAM 95480 95480 0 0.0
bl602+rpc FLASH 1309734 1309750 16 0.0
RAM 103760 103760 0 0.0
bl702 lighting-app bl702 FLASH 1091430 1091446 16 0.0
RAM 14897 14897 0 0.0
bl702+mfd FLASH 1102124 1102140 16 0.0
RAM 15049 15049 0 0.0
bl702+rpc FLASH 1181240 1181256 16 0.0
RAM 23925 23925 0 0.0
bl706-eth FLASH 874774 874790 16 0.0
RAM 27016 27016 0 0.0
bl706-wifi FLASH 1127068 1127090 22 0.0
RAM 14349 14349 0 0.0
bl702l lighting-app bl702l FLASH 1078316 1078332 16 0.0
RAM 21468 21468 0 0.0
bl702l+mfd FLASH 1089578 1089594 16 0.0
RAM 21628 21628 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 798100 798108 8 0.0
RAM 103088 103088 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 813752 813768 16 0.0
RAM 113568 113568 0 0.0
lock-mtd LP_EM_CC1354P10_6 FLASH 803276 803292 16 0.0
RAM 107688 107688 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 756052 756068 16 0.0
RAM 101788 101788 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 741724 741732 8 0.0
RAM 102036 102036 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 605750 605766 16 0.0
RAM 204512 204512 0 0.0
lock CC3235SF_LAUNCHXL FLASH 650770 650786 16 0.0
RAM 204772 204772 0 0.0
efr32 lighting-app BRD4187C FLASH 888232 888224 -8 -0.0
RAM 183424 183424 0 0.0
lock-app BRD4338a FLASH 699848 699864 16 0.0
RAM 242228 242228 0 0.0
window-app BRD4187C FLASH 969748 969748 0 0.0
RAM 167856 167856 0 0.0
esp32 all-clusters-app c3devkit DRAM 88324 88324 0 0.0
FLASH 1468934 1468950 16 0.0
IRAM 75570 75570 0 0.0
m5stack DRAM 114796 114796 0 0.0
FLASH 1538059 1538099 40 0.0
IRAM 125403 125403 0 0.0
linux air-purifier-app debug unknown 4592 4592 0 0.0
FLASH 2528192 2528240 48 0.0
RAM 125072 125072 0 0.0
all-clusters-app debug unknown 5368 5368 0 0.0
FLASH 5578270 5578318 48 0.0
RAM 479304 479304 0 0.0
all-clusters-minimal-app debug unknown 5288 5288 0 0.0
FLASH 5050696 5050744 48 0.0
RAM 232856 232856 0 0.0
bridge-app debug unknown 5256 5256 0 0.0
FLASH 4476408 4476456 48 0.0
RAM 212768 212768 0 0.0
chip-tool debug unknown 5728 5728 0 0.0
FLASH 11548231 11548279 48 0.0
RAM 531386 531386 0 0.0
chip-tool-ipv6only arm64 unknown 19816 19816 0 0.0
FLASH 10680388 10680468 80 0.0
RAM 580120 580120 0 0.0
fabric-admin debug unknown 5584 5584 0 0.0
FLASH 10547127 10547175 48 0.0
RAM 525466 525466 0 0.0
fabric-bridge-app debug unknown 5264 5264 0 0.0
FLASH 4346936 4346984 48 0.0
RAM 204896 204896 0 0.0
lighting-app debug+rpc+ui unknown 5904 5904 0 0.0
FLASH 5372770 5372818 48 0.0
RAM 221672 221672 0 0.0
lock-app debug unknown 5192 5192 0 0.0
FLASH 4540008 4540056 48 0.0
RAM 200192 200192 0 0.0
ota-provider-app debug unknown 4576 4576 0 0.0
FLASH 4195768 4195816 48 0.0
RAM 194432 194432 0 0.0
ota-requestor-app debug unknown 4512 4512 0 0.0
FLASH 4321256 4321304 48 0.0
RAM 199088 199088 0 0.0
shell debug unknown 4112 4112 0 0.0
FLASH 2793965 2794013 48 0.0
RAM 150416 150416 0 0.0
thermostat-no-ble arm64 unknown 9184 9184 0 0.0
FLASH 4167060 4167108 48 0.0
RAM 235784 235784 0 0.0
tv-app debug unknown 5472 5472 0 0.0
FLASH 5593624 5593704 80 0.0
RAM 341672 341672 0 0.0
tv-casting-app debug unknown 5096 5096 0 0.0
FLASH 9595926 9595958 32 0.0
RAM 348848 348848 0 0.0
mbed lock-app-release cy8cproto_062_4343w FLASH 1502020 1502084 64 0.0
RAM 226672 226672 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 880892 880904 12 0.0
RAM 139693 139693 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 951704 951712 8 0.0
RAM 138121 138121 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 826448 826456 8 0.0
RAM 138591 138591 0 0.0
nxp contact k32w0+release FLASH 575604 575620 16 0.0
RAM 70024 70024 0 0.0
k32w1+release FLASH 590728 590744 16 0.0
RAM 74056 74056 0 0.0
light k32w0+release FLASH 609680 609696 16 0.0
RAM 69500 69500 0 0.0
k32w1+release FLASH 674232 674240 8 0.0
RAM 82808 82808 0 0.0
qpg lighting-app qpg6105+debug FLASH 650600 650608 8 0.0
RAM 104556 104556 0 0.0
lock-app qpg6105+debug FLASH 610700 610708 8 0.0
RAM 99232 99232 0 0.0
stm32 light STM32WB5MM-DK FLASH 472136 472144 8 0.0
RAM 141652 141652 0 0.0
telink air-quality-sensor-app tlsr9528a_retention FLASH 632130 632146 16 0.0
RAM 50528 50528 0 0.0
all-clusters-app tlsr9118bdk40d FLASH 657126 657142 16 0.0
RAM 145872 145872 0 0.0
all-clusters-minimal-app tlsr9528a FLASH 777190 777206 16 0.0
RAM 110684 110684 0 0.0
bridge-app tlsr9258a FLASH 675114 675130 16 0.0
RAM 95304 95304 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 633714 633730 16 0.0
RAM 50572 50572 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 719492 719508 16 0.0
RAM 77148 77148 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 612268 612284 16 0.0
RAM 142104 142104 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 799822 799838 16 0.0
RAM 100508 100508 0 0.0
lock-app-dfu tlsr9528a FLASH 665278 665294 16 0.0
RAM 69860 69860 0 0.0
ota-requestor-app tlsr9258a FLASH 694444 694460 16 0.0
RAM 95028 95028 0 0.0
pump-app tlsr9518adk80d FLASH 615978 615994 16 0.0
RAM 56952 56952 0 0.0
pump-controller-app tlsr9518adk80d FLASH 606362 606378 16 0.0
RAM 56752 56752 0 0.0
shell tlsr9518adk80d FLASH 466154 466170 16 0.0
RAM 72484 72484 0 0.0
smoke_co_alarm-app tlsr9528a_retention FLASH 640074 640090 16 0.0
RAM 52200 52200 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d FLASH 650188 650204 16 0.0
RAM 60388 60388 0 0.0
thermostat tlsr9518adk80d FLASH 625252 625268 16 0.0
RAM 57084 57084 0 0.0
window-covering tlsr9118bdk40d FLASH 518710 518726 16 0.0
RAM 97800 97800 0 0.0
tizen all-clusters-app arm unknown 1560 1560 0 0.0
FLASH 1633264 1633300 36 0.0
RAM 46020 46020 0 0.0
chip-tool-ubsan arm unknown 2364 2364 0 0.0
FLASH 15881842 15882050 208 0.0
RAM 6972008 6972112 104 0.0

src/app/server/Server.cpp Show resolved Hide resolved
@mergify mergify bot merged commit 674dca8 into project-chip:master Jun 21, 2024
68 checks passed
@bzbarsky-apple bzbarsky-apple deleted the fix-shutdown-crash branch June 21, 2024 20:11
pimpalemahesh pushed a commit to pimpalemahesh/connectedhomeip that referenced this pull request Jun 24, 2024
We could end up shutting down the exchange manager while we still had live
sessions/exchanges, at which point shutting down those would crash as they tried
to get information from the exchange manager.

The fix is to document the required shutdown ordering and enforce it correctly
in CHIPDeviceControllerFactory and Server.

Fixes project-chip#20880
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.

Shutdown while there are live exchanges will crash
4 participants