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

Shutdown Python REPL correctly #18437

Merged
merged 3 commits into from
May 19, 2022

Conversation

agners
Copy link
Contributor

@agners agners commented May 13, 2022

Problem

Change overview

Uses atexit module to Shutdown the CHIP stack when they Python REPL quits. Also addresses an issue where the Storage manager tries to access the chipStack after Shutdown.

Testing

Using chip-repl in dev environment, quit while debugger is attached. No more segfaults.

agners added 2 commits May 13, 2022 19:00
Otherwise, we later fail to access the builtins.chipStack:
AttributeError: module 'builtins' has no attribute 'chipStack'
@github-actions
Copy link

github-actions bot commented May 13, 2022

PR #18437: Size comparison from 46f5178 to 44199be

Full report (34 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 46f5178 44199be change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 691363 691363 0 0.0
(read/write) 160988 160988 0 0.0
.bss 75332 75332 0 0.0
.data 3412 3412 0 0.0
.rodata 102619 102619 0 0.0
.text 588264 588264 0 0.0
lock-ftd LP_CC2652R7 (read only) 678739 678739 0 0.0
(read/write) 164700 164700 0 0.0
.bss 73476 73476 0 0.0
.data 3236 3236 0 0.0
.rodata 94339 94339 0 0.0
.text 583916 583916 0 0.0
lock-mtd LP_CC2652R7 (read only) 627563 627563 0 0.0
(read/write) 146308 146308 0 0.0
.bss 69212 69212 0 0.0
.data 3236 3236 0 0.0
.rodata 94219 94219 0 0.0
.text 532852 532852 0 0.0
pump-app LP_CC2652R7 (read only) 663303 663303 0 0.0
(read/write) 181424 181424 0 0.0
.bss 73740 73740 0 0.0
.data 3268 3268 0 0.0
.rodata 80527 80527 0 0.0
.text 582296 582296 0 0.0
pump-controller-app LP_CC2652R7 (read only) 656495 656495 0 0.0
(read/write) 188032 188032 0 0.0
.bss 73796 73796 0 0.0
.data 3232 3232 0 0.0
.rodata 83615 83615 0 0.0
.text 572400 572400 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 628454 628454 0 0.0
.app_xip_area 531012 531012 0 0.0
.bss 80084 80084 0 0.0
.data 708 708 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 627366 627366 0 0.0
.app_xip_area 531380 531380 0 0.0
.bss 78660 78660 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 576154 576154 0 0.0
.app_xip_area 470452 470452 0 0.0
.bss 88080 88080 0 0.0
.data 584 584 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 918728 918728 0 0.0
(read/write) 134560 134560 0 0.0
.bss 132496 132496 0 0.0
.data 2060 2060 0 0.0
.text 918720 918720 0 0.0
BRD4161A+rpc (read only) 952932 952932 0 0.0
(read/write) 151240 151240 0 0.0
.bss 148976 148976 0 0.0
.data 2264 2264 0 0.0
.text 952924 952924 0 0.0
BRD4161A+rs911x (read only) 787724 787724 0 0.0
(read/write) 129776 129776 0 0.0
.bss 127708 127708 0 0.0
.data 2068 2068 0 0.0
.text 787716 787716 0 0.0
lock-app BRD4161A+wf200 (read only) 946816 946816 0 0.0
(read/write) 124268 124268 0 0.0
.bss 122244 122244 0 0.0
.data 2024 2024 0 0.0
.text 946808 946808 0 0.0
window-app BRD4161A (read only) 899032 899032 0 0.0
(read/write) 134504 134504 0 0.0
.bss 132456 132456 0 0.0
.data 2048 2048 0 0.0
.text 899024 899024 0 0.0
esp32 all-clusters-app c3devkit (read only) 999828 999828 0 0.0
(read/write) 1477138 1477138 0 0.0
.dram0.bss 68472 68472 0 0.0
.dram0.data 14568 14568 0 0.0
.flash.rodata 208616 208616 0 0.0
.flash.text 999828 999828 0 0.0
.iram0.text 62954 62954 0 0.0
m5stack (read only) 1053755 1053755 0 0.0
(read/write) 479040 479040 0 0.0
.dram0.bss 73992 73992 0 0.0
.dram0.data 34184 34184 0 0.0
.flash.rodata 238868 238868 0 0.0
.flash.text 1048371 1048371 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 686376 686376 0 0.0
.bss 81272 81272 0 0.0
.data 2016 2016 0 0.0
.text 601384 601384 0 0.0
lock k32w061+release (read/write) 731720 731720 0 0.0
.bss 81704 81704 0 0.0
.data 1976 1976 0 0.0
.text 646336 646336 0 0.0
linux all-clusters-app debug (read only) 2742809 2742809 0 0.0
(read/write) 174552 174552 0 0.0
.bss 83904 83904 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 82456 82456 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1008 1008 0 0.0
.rodata 236613 236613 0 0.0
.text 2330322 2330322 0 0.0
bridge-app debug+rpc (read only) 1897449 1897449 0 0.0
(read/write) 121080 121080 0 0.0
.bss 71520 71520 0 0.0
.data 3488 3488 0 0.0
.data.rel.ro 40712 40712 0 0.0
.dynamic 592 592 0 0.0
.got 4056 4056 0 0.0
.init 27 27 0 0.0
.init_array 688 688 0 0.0
.rodata 161753 161753 0 0.0
.text 1612338 1612338 0 0.0
chip-tool debug (read only) 9225605 9225605 0 0.0
(read/write) 577008 577008 0 0.0
.bss 22816 22816 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 546752 546752 0 0.0
.dynamic 624 624 0 0.0
.got 5000 5000 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 472533 472533 0 0.0
.text 7428613 7428613 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9020596 9020596 0 0.0
(read/write) 643121 643121 0 0.0
.bss 41105 41105 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 582008 582008 0 0.0
.dynamic 560 560 0 0.0
.got 14976 14976 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 439236 439236 0 0.0
.text 7121828 7121828 0 0.0
lighting-app debug+rpc (read only) 2331065 2331065 0 0.0
(read/write) 152032 152032 0 0.0
.bss 73568 73568 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 70664 70664 0 0.0
.dynamic 608 608 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 185913 185913 0 0.0
.text 1977938 1977938 0 0.0
lock-app debug (read only) 2238537 2238537 0 0.0
(read/write) 146616 146616 0 0.0
.bss 72192 72192 0 0.0
.data 1568 1568 0 0.0
.data.rel.ro 67160 67160 0 0.0
.dynamic 592 592 0 0.0
.got 4336 4336 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 195689 195689 0 0.0
.text 1881954 1881954 0 0.0
ota-provider-app debug (read only) 2067713 2067713 0 0.0
(read/write) 139728 139728 0 0.0
.bss 71680 71680 0 0.0
.data 1768 1768 0 0.0
.data.rel.ro 60488 60488 0 0.0
.dynamic 608 608 0 0.0
.got 4504 4504 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 176851 176851 0 0.0
.text 1732466 1732466 0 0.0
ota-requestor-app debug (read only) 2097585 2097585 0 0.0
(read/write) 142536 142536 0 0.0
.bss 72320 72320 0 0.0
.data 1992 1992 0 0.0
.data.rel.ro 62584 62584 0 0.0
.dynamic 592 592 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 172956 172956 0 0.0
.text 1764770 1764770 0 0.0
shell debug (read only) 2567793 2567793 0 0.0
(read/write) 198288 198288 0 0.0
.bss 114408 114408 0 0.0
.data 1376 1376 0 0.0
.data.rel.ro 76744 76744 0 0.0
.dynamic 592 592 0 0.0
.got 4208 4208 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 218066 218066 0 0.0
.text 2186946 2186946 0 0.0
thermostat-no-ble arm64 (read only) 2370244 2370244 0 0.0
(read/write) 175153 175153 0 0.0
.bss 86417 86417 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 79408 79408 0 0.0
.dynamic 560 560 0 0.0
.got 4768 4768 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 146980 146980 0 0.0
.text 1993376 1993376 0 0.0
tv-app debug (read only) 2855481 2855481 0 0.0
(read/write) 277472 277472 0 0.0
.bss 189624 189624 0 0.0
.data 4672 4672 0 0.0
.data.rel.ro 76928 76928 0 0.0
.dynamic 592 592 0 0.0
.got 4720 4720 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 218635 218635 0 0.0
.text 2453618 2453618 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2420356 2420356 0 0.0
.bss 205820 205820 0 0.0
.data 5872 5872 0 0.0
.text 1382956 1382956 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180271 1180271 0 0.0
bss 139680 139680 0 0.0
rodata 151792 151792 0 0.0
text 809956 809956 0 0.0
p6 all-clusters-app default (read/write) 2531960 2531960 0 0.0
.bss 139328 139328 0 0.0
.data 2808 2808 0 0.0
.text 1490224 1490224 0 0.0
light-app default (read/write) 2422016 2422016 0 0.0
.bss 132656 132656 0 0.0
.data 2608 2608 0 0.0
.text 1380280 1380280 0 0.0
lock-app default (read/write) 2431544 2431544 0 0.0
.bss 132472 132472 0 0.0
.data 2568 2568 0 0.0
.text 1389808 1389808 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 806528 806528 0 0.0
bss 72176 72176 0 0.0
noinit 40416 40416 0 0.0
text 572768 572768 0 0.0

@andy31415 andy31415 merged commit 3d015f7 into project-chip:master May 19, 2022
@agners agners deleted the shutdown-repl-correctly branch June 29, 2022 22:09
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.

Abort on REPL shutdown due to live objects
3 participants