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

Disable c++ static destructors on exit #26772

Merged

Conversation

rawadhilal88
Copy link
Contributor

@rawadhilal88 rawadhilal88 commented May 23, 2023

On iOS, tv casting mobile apps have been experiencing unexpected crashes after they were closed by users or the OS itself. The reason was mainly due to the ObjectLifeCycle state of properties within the static instances of SystemLayer, the UDPEndPointManager and TCPEndpointManager not being in the expected state (Uninitialized or Shutdown) upon c++ upon system exit(). This is because in the destructor of the static instances, there's a validation of state which is mismatching causing a crash through the chipDie call. For example, since the following code was not executed when applicationWillTerminate is invoked by the system, the c++ static destructors are invoked upon exit() and hence the internal logic for the ObjectLifeCycle class is hitting an assertion error.

chip::DeviceLayer::SystemLayer().Shutdown();
chip::DeviceLayer::UDPEndPointManager()->Shutdown();
chip::DeviceLayer::TCPEndPointManager()->Shutdown();

Given that iOS already handle memory clean up upon an app exit, the fix disables the C++ static destructors that is called when application is terminated. This prevents the app from crashing when it's already terminated (after exit() is invoked).

@CLAassistant
Copy link

CLAassistant commented May 23, 2023

CLA assistant check
All committers have signed the CLA.

@rawadhilal88 rawadhilal88 force-pushed the master-fix-ios-termination-crash branch 2 times, most recently from 2b292f2 to 92cfcde Compare May 23, 2023 21:33
@rawadhilal88
Copy link
Contributor Author

@bzbarsky-apple Can you please help review?

@pullapprove pullapprove bot requested a review from bzbarsky-apple May 23, 2023 21:43
@github-actions
Copy link

github-actions bot commented May 23, 2023

PR #26772: Size comparison from c24294a to c16b348

Increases (8 builds for bl602, bl702, esp32, nrfconnect, telink)
platform target config section c24294a c16b348 change % change
bl602 lighting-app bl602+rpc (read/write) 1402658 1402666 8 0.0
.text 1067880 1067882 2 0.0
bl702 lighting-app bl702 .debug_info 42151094 42151096 2 0.0
.text 966724 966728 4 0.0
esp32 all-clusters-app c3devkit (read only) 1053820 1053822 2 0.0
.flash.text 1053820 1053822 2 0.0
nrfconnect all-clusters-minimal-app nrf52840dk_nrf52840 text 778532 778536 4 0.0
telink light-switch-app tlsr9518adk80d (read/write) 872348 872356 8 0.0
text 595888 595890 2 0.0
lighting-app-factory-data tlsr9518adk80d text 663240 663242 2 0.0
lighting-app-rpc tlsr9518adk80d text 700172 700174 2 0.0
lock-app tlsr9518adk80d (read/write) 911036 911044 8 0.0
text 609904 609906 2 0.0
Decreases (10 builds for bl702, efr32, psoc6, telink)
platform target config section c24294a c16b348 change % change
bl702 lighting-app bl702+rpc .debug_info 47077156 47077155 -1 -0.0
.text 1040116 1040114 -2 -0.0
efr32 lighting-app BRD4187C (read/write) 1000976 1000968 -8 -0.0
.text 838764 838756 -8 -0.0
lock-app BRD4161A+wf200 (read/write) 1068744 1068736 -8 -0.0
.text 892420 892412 -8 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_info 28317070 28317068 -2 -0.0
all-clusters-minimal cy8ckit_062s2_43012 .debug_info 27936631 27936630 -1 -0.0
lock cy8ckit_062s2_43012 .debug_info 23388564 23388563 -1 -0.0
telink bridge-app tlsr9518adk80d text 638726 638722 -4 -0.0
contact-sensor-app tlsr9518adk80d text 581268 581266 -2 -0.0
ota-requestor-app tlsr9518adk80d text 603312 603310 -2 -0.0
pump-app tlsr9518adk80d text 587434 587432 -2 -0.0
Full report (57 builds for bl602, bl702, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section c24294a c16b348 change % change
bl602 lighting-app bl602 (read/write) 1356390 1356390 0 0.0
.bss 87886 87886 0 0.0
.data 9648 9648 0 0.0
.text 1036526 1036526 0 0.0
bl602+rpc (read/write) 1402658 1402666 8 0.0
.bss 95934 95934 0 0.0
.data 10040 10040 0 0.0
.text 1067880 1067882 2 0.0
bl702 lighting-app bl702 (read only) 3358 3358 0 0.0
(read/write) 1188175 1188175 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 67585 67585 0 0.0
.bss_psram 24656 24656 0 0.0
.comment 48 48 0 0.0
.data 3952 3952 0 0.0
.debug_abbrev 1555717 1555717 0 0.0
.debug_aranges 136024 136024 0 0.0
.debug_frame 500380 500380 0 0.0
.debug_info 42151094 42151096 2 0.0
.debug_line 5370626 5370626 0 0.0
.debug_loc 3495980 3495980 0 0.0
.debug_ranges 375576 375576 0 0.0
.debug_str 3834243 3834243 0 0.0
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 140 140 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 107168 107168 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 582212 582212 0 0.0
.symtab 175632 175632 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 0 0 0 0.0
966724 966728 4 0.0
bl702+rpc (read only) 3358 3358 0 0.0
(read/write) 1276979 1276979 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 75633 75633 0 0.0
.bss_psram 25056 25056 0 0.0
.comment 48 48 0 0.0
.data 4504 4504 0 0.0
.debug_abbrev 1714700 1714700 0 0.0
.debug_aranges 144312 144312 0 0.0
.debug_frame 528392 528392 0 0.0
.debug_info 47077156 47077155 -1 -0.0
.debug_line 5786543 5786543 0 0.0
.debug_loc 3698755 3698755 0 0.0
.debug_ranges 400936 400936 0 0.0
.debug_str 4259760 4259760 0 0.0
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 156 156 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 121248 121248 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 643532 643532 0 0.0
.symtab 194128 194128 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 0 0 0 0.0
1040116 1040114 -2 -0.0
cc32xx lock CC3235SF_LAUNCHXL (blank) 0 0 0 0.0
(read only) 605610 605610 0 0.0
(read/write) 204164 204164 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197576 197576 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 955013 955013 0 0.0
.debug_aranges 104344 104344 0 0.0
.debug_frame 353240 353240 0 0.0
.debug_info 20535270 20535270 0 0.0
.debug_line 2714717 2714717 0 0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1532142 1532142 0 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 96791 96791 0 0.0
.debug_str 3259284 3259284 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104330 104330 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 483853 483853 0 0.0
.symtab 287456 287456 0 0.0
.text 499156 499156 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 524579 524579 0 0.0
.app_xip_area 417373 417373 0 0.0
.bss 62184 62184 0 0.0
.data 712 712 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 529259 529259 0 0.0
.app_xip_area 416749 416749 0 0.0
.bss 67480 67480 0 0.0
.data 720 720 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 566291 566291 0 0.0
.app_xip_area 459845 459845 0 0.0
.bss 61472 61472 0 0.0
.data 668 668 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
switch cyw930739m2evb_01 (read/write) 531059 531059 0 0.0
.app_xip_area 422045 422045 0 0.0
.bss 63960 63960 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A+rs9116 (read/write) 963972 963972 0 0.0
.bss 179680 179680 0 0.0
.data 2136 2136 0 0.0
.text 782136 782136 0 0.0
BRD4187C (read/write) 1000976 1000968 -8 -0.0
.bss 159412 159412 0 0.0
.data 2780 2780 0 0.0
.text 838764 838756 -8 -0.0
lock-app BRD4161A+wf200 (read/write) 1068744 1068736 -8 -0.0
.bss 174152 174152 0 0.0
.data 2152 2152 0 0.0
.text 892420 892412 -8 -0.0
window-app BRD4187C (read/write) 1076244 1076244 0 0.0
.bss 143884 143884 0 0.0
.data 2676 2676 0 0.0
.text 929664 929664 0 0.0
esp32 all-clusters-app c3devkit (read only) 1053820 1053822 2 0.0
(read/write) 1583704 1583704 0 0.0
.dram0.bss 77176 77176 0 0.0
.dram0.data 13964 13964 0 0.0
.flash.rodata 213424 213424 0 0.0
.flash.text 1053820 1053822 2 0.0
.iram0.text 76538 76538 0 0.0
m5stack (read only) 1101307 1101307 0 0.0
(read/write) 492866 492866 0 0.0
.dram0.bss 82192 82192 0 0.0
.dram0.data 34300 34300 0 0.0
.flash.rodata 241220 241220 0 0.0
.flash.text 1095923 1095923 0 0.0
.iram0.text 126055 126055 0 0.0
k32w contact k32w0+release (read only) 583644 583644 0 0.0
(read/write) 82704 82704 0 0.0
.bss 65888 65888 0 0.0
.data 2192 2192 0 0.0
.text 583108 583108 0 0.0
light k32w0+release (read only) 582620 582620 0 0.0
(read/write) 82356 82356 0 0.0
.bss 65552 65552 0 0.0
.data 2180 2180 0 0.0
.text 582084 582084 0 0.0
lock k32w0+release (read only) 556060 556060 0 0.0
(read/write) 80352 80352 0 0.0
.bss 63624 63624 0 0.0
.data 2104 2104 0 0.0
.text 555524 555524 0 0.0
linux all-clusters-app debug (read only) 3147341 3147341 0 0.0
(read/write) 152808 152808 0 0.0
.bss 60192 60192 0 0.0
.data 2160 2160 0 0.0
.data.rel.ro 83952 83952 0 0.0
.dynamic 608 608 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 1120 1120 0 0.0
.rodata 230760 230760 0 0.0
.text 2730629 2730629 0 0.0
all-clusters-minimal-app debug (read only) 2955285 2955285 0 0.0
(read/write) 145696 145696 0 0.0
.bss 59296 59296 0 0.0
.data 2128 2128 0 0.0
.data.rel.ro 77872 77872 0 0.0
.dynamic 608 608 0 0.0
.got 4664 4664 0 0.0
.init 27 27 0 0.0
.init_array 1080 1080 0 0.0
.rodata 224040 224040 0 0.0
.text 2548949 2548949 0 0.0
bridge-app debug (read only) 2517469 2517469 0 0.0
(read/write) 129648 129648 0 0.0
.bss 50232 50232 0 0.0
.data 3824 3824 0 0.0
.data.rel.ro 69608 69608 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 784 784 0 0.0
.rodata 173224 173224 0 0.0
.text 2171925 2171925 0 0.0
chip-tool debug (read only) 13753313 13753313 0 0.0
(read/write) 697384 697384 0 0.0
.bss 26424 26424 0 0.0
.data 3042 3042 0 0.0
.data.rel.ro 661128 661128 0 0.0
.dynamic 608 608 0 0.0
.got 5360 5360 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 657453 657453 0 0.0
.text 11475364 11475364 0 0.0
chip-tool-ipv6only arm64 (read only) 12930812 12930812 0 0.0
(read/write) 749432 749432 0 0.0
.bss 34392 34392 0 0.0
.data 3008 3008 0 0.0
.data.rel.ro 690704 690704 0 0.0
.dynamic 560 560 0 0.0
.got 16120 16120 0 0.0
.init 24 24 0 0.0
.init_array 216 216 0 0.0
.rodata 599808 599808 0 0.0
.text 10553348 10553348 0 0.0
dynamic-bridge-app-ipv6only debug (read only) 2581133 2581133 0 0.0
(read/write) 126840 126840 0 0.0
.bss 47544 47544 0 0.0
.data 2864 2864 0 0.0
.data.rel.ro 70192 70192 0 0.0
.dynamic 624 624 0 0.0
.got 4800 4800 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 175944 175944 0 0.0
.text 2227829 2227829 0 0.0
lighting-app debug+rpc+ui (read only) 3245369 3245369 0 0.0
(read/write) 132272 132272 0 0.0
.bss 48032 48032 0 0.0
.data 2704 2704 0 0.0
.data.rel.ro 74736 74736 0 0.0
.dynamic 656 656 0 0.0
.got 5240 5240 0 0.0
.init 27 27 0 0.0
.init_array 872 872 0 0.0
.rodata 284628 284628 0 0.0
.text 2768946 2768946 0 0.0
lock-app debug (read only) 2657589 2657589 0 0.0
(read/write) 123624 123624 0 0.0
.bss 45952 45952 0 0.0
.data 1904 1904 0 0.0
.data.rel.ro 69648 69648 0 0.0
.dynamic 608 608 0 0.0
.got 4648 4648 0 0.0
.init 27 27 0 0.0
.init_array 832 832 0 0.0
.rodata 206248 206248 0 0.0
.text 2278645 2278645 0 0.0
ota-provider-app debug (read only) 2209549 2209549 0 0.0
(read/write) 103672 103672 0 0.0
.bss 44528 44528 0 0.0
.data 2112 2112 0 0.0
.data.rel.ro 51944 51944 0 0.0
.dynamic 608 608 0 0.0
.got 3800 3800 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 154376 154376 0 0.0
.text 1913653 1913653 0 0.0
ota-requestor-app debug (read only) 2376581 2376581 0 0.0
(read/write) 111464 111464 0 0.0
.bss 46960 46960 0 0.0
.data 2512 2512 0 0.0
.data.rel.ro 56800 56800 0 0.0
.dynamic 608 608 0 0.0
.got 3784 3784 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 158440 158440 0 0.0
.text 2067749 2067749 0 0.0
shell debug (read only) 2683881 2683881 0 0.0
(read/write) 141232 141232 0 0.0
.bss 59144 59144 0 0.0
.data 1232 1232 0 0.0
.data.rel.ro 75016 75016 0 0.0
.dynamic 608 608 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 1056 1056 0 0.0
.rodata 199250 199250 0 0.0
.text 2322610 2322610 0 0.0
thermostat-no-ble arm64 (read only) 2521644 2521644 0 0.0
(read/write) 142456 142456 0 0.0
.bss 53464 53464 0 0.0
.data 1784 1784 0 0.0
.data.rel.ro 77728 77728 0 0.0
.dynamic 560 560 0 0.0
.got 5432 5432 0 0.0
.init 24 24 0 0.0
.init_array 384 384 0 0.0
.rodata 129280 129280 0 0.0
.text 2128948 2128948 0 0.0
tv-app debug (read only) 3313761 3313761 0 0.0
(read/write) 261544 261544 0 0.0
.bss 171264 171264 0 0.0
.data 4080 4080 0 0.0
.data.rel.ro 79480 79480 0 0.0
.dynamic 608 608 0 0.0
.got 5000 5000 0 0.0
.init 27 27 0 0.0
.init_array 1088 1088 0 0.0
.rodata 222648 222648 0 0.0
.text 2894930 2894930 0 0.0
tv-casting-app debug (read only) 7415273 7415273 0 0.0
(read/write) 195312 195312 0 0.0
.bss 52096 52096 0 0.0
.data 1744 1744 0 0.0
.data.rel.ro 134904 134904 0 0.0
.dynamic 608 608 0 0.0
.got 4920 4920 0 0.0
.init 27 27 0 0.0
.init_array 1000 1000 0 0.0
.rodata 317772 317772 0 0.0
.text 6728594 6728594 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2495256 2495256 0 0.0
.bss 216304 216304 0 0.0
.data 5144 5144 0 0.0
.text 1457940 1457940 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1177556 1177556 0 0.0
bss 155605 155605 0 0.0
rodata 132996 132996 0 0.0
text 808240 808240 0 0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1437284 1437284 0 0.0
bss 135345 135345 0 0.0
rodata 229012 229012 0 0.0
text 778836 778836 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1123776 1123776 0 0.0
bss 154757 154757 0 0.0
rodata 109760 109760 0 0.0
text 778532 778536 4 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 840640 840640 0 0.0
(read/write) 1708524 1708524 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 190148 190148 0 0.0
.comment 212 212 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 2552 2552 0 0.0
.debug_abbrev 1285240 1285240 0 0.0
.debug_aranges 131632 131632 0 0.0
.debug_frame 437600 437600 0 0.0
.debug_info 28317070 28317068 -2 -0.0
.debug_line 3812099 3812099 0 0.0
.debug_line_str 957 957 0 0.0
.debug_loclists 2064887 2064887 0 0.0
.debug_rnglists 130689 130689 0 0.0
.debug_str 3771322 3771322 0 0.0
.heap 840640 840640 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 719399 719399 0 0.0
.symtab 467488 467488 0 0.0
.text 1507436 1507436 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 841440 841440 0 0.0
(read/write) 1649604 1649604 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 189348 189348 0 0.0
.comment 212 212 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 2552 2552 0 0.0
.debug_abbrev 1274979 1274979 0 0.0
.debug_aranges 130880 130880 0 0.0
.debug_frame 440040 440040 0 0.0
.debug_info 27936631 27936630 -1 -0.0
.debug_line 3825291 3825291 0 0.0
.debug_line_str 981 981 0 0.0
.debug_loclists 2055798 2055798 0 0.0
.debug_rnglists 129638 129638 0 0.0
.debug_str 3760081 3760081 0 0.0
.heap 841440 841440 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 675766 675766 0 0.0
.symtab 451936 451936 0 0.0
.text 1449316 1449316 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 849736 849736 0 0.0
(read/write) 1571228 1571228 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 181220 181220 0 0.0
.comment 212 212 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 2384 2384 0 0.0
.debug_abbrev 1108676 1108676 0 0.0
.debug_aranges 121032 121032 0 0.0
.debug_frame 403276 403276 0 0.0
.debug_info 23224029 23224029 0 0.0
.debug_line 3388279 3388279 0 0.0
.debug_line_str 942 942 0 0.0
.debug_loclists 1887291 1887291 0 0.0
.debug_rnglists 119267 119267 0 0.0
.debug_str 3566289 3566289 0 0.0
.heap 849736 849736 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 591746 591746 0 0.0
.symtab 414352 414352 0 0.0
.text 1379236 1379236 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 821952 821952 0 0.0
(read/write) 1627764 1627764 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 208996 208996 0 0.0
.comment 212 212 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 2392 2392 0 0.0
.debug_abbrev 1107760 1107760 0 0.0
.debug_aranges 121536 121536 0 0.0
.debug_frame 405368 405368 0 0.0
.debug_info 23388564 23388563 -1 -0.0
.debug_line 3384672 3384672 0 0.0
.debug_line_str 933 933 0 0.0
.debug_loclists 1900735 1900735 0 0.0
.debug_rnglists 119723 119723 0 0.0
.debug_str 3581307 3581307 0 0.0
.heap 821952 821952 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 595760 595760 0 0.0
.symtab 416688 416688 0 0.0
.text 1407988 1407988 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1170688 1170688 0 0.0
.bss 99928 99928 0 0.0
.data 856 856 0 0.0
.text 617788 617788 0 0.0
lock-app qpg6105+debug (read/write) 1139796 1139796 0 0.0
.bss 94824 94824 0 0.0
.data 856 856 0 0.0
.text 586896 586896 0 0.0
telink all-clusters-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1010696 1010696 0 0.0
bss 98928 98928 0 0.0
text 686754 686754 0 0.0
all-clusters-minimal-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 946420 946420 0 0.0
bss 97980 97980 0 0.0
text 648634 648634 0 0.0
bridge-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 924976 924976 0 0.0
bss 100212 100212 0 0.0
text 638726 638722 -4 -0.0
contact-sensor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 856052 856052 0 0.0
bss 89888 89888 0 0.0
text 581268 581266 -2 -0.0
light-switch-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 872348 872356 8 0.0
bss 90044 90044 0 0.0
text 595888 595890 2 0.0
lighting-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 940116 940116 0 0.0
bss 98232 98232 0 0.0
text 655716 655716 0 0.0
lighting-app-factory-data tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 951496 951496 0 0.0
bss 102480 102480 0 0.0
text 663240 663242 2 0.0
lighting-app-rpc tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1008540 1008540 0 0.0
bss 99796 99796 0 0.0
text 700172 700174 2 0.0
lock-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 911036 911044 8 0.0
bss 90540 90540 0 0.0
text 609904 609906 2 0.0
ota-requestor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 878800 878800 0 0.0
bss 91152 91152 0 0.0
text 603312 603310 -2 -0.0
pump-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 862040 862040 0 0.0
bss 90008 90008 0 0.0
text 587434 587432 -2 -0.0
pump-controller-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 848836 848836 0 0.0
bss 89808 89808 0 0.0
text 577554 577554 0 0.0
temperature-measurement-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 845068 845068 0 0.0
bss 89728 89728 0 0.0
text 573260 573260 0 0.0
thermostat tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 876736 876736 0 0.0
bss 91432 91432 0 0.0
text 597602 597602 0 0.0
window-covering tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 873396 873396 0 0.0
bss 91844 91844 0 0.0
text 593294 593294 0 0.0

@andy31415
Copy link
Contributor

Is this safe? Are we expecting constructors to not free resources?
It seems better if we make the main app call freeing resources appropriately.

@rawadhilal88
Copy link
Contributor Author

Is this safe? Are we expecting constructors to not free resources?
It seems better if we make the main app call freeing resources appropriately.

This patch adds the flag -fno-c++-static-destructors, which disables registration of exit-time destructors of static or thread storage duration variables. I.e the destructors for statically initialized c++ classes are called on exit(). This change is only added to the tv-casting-example iOS app as we expect the iOS system to do the resource clean up automatically.

@woody-apple
Copy link
Contributor

This appears quite safe, approving

@mergify mergify bot merged commit 69aaacd into project-chip:master Jun 20, 2023
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