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

Check and fix System::Layer shutdown sequencing #9247

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

kpschoedel
Copy link
Contributor

Problem

There have been multiple instances of code using a System::Layer
object after it has been shut down or destroyed, some previously
fixed in #8865. (In the ancestral code, System::Layer was fully
static.)

Change overview

  • More thoroughly track and check System::Layer object state.
  • Spin out state tracking into lib/support/ObjectLifeCycle.h
  • Fix several sequencing issues.

Testing

CI; no change to visible functionality intended.

#### Problem

There have been multiple instances of code using a `System::Layer`
object after it has been shut down or destroyed, some previously
fixed in project-chip#8865. (In the ancestral code, `System::Layer` was fully
static.)

#### Change overview

- More thoroughly track and check `System::Layer` object state.
- Spin out state tracking into `lib/support/ObjectLifeCycle.h`
- Fix several sequencing issues.

#### Testing

CI; no change to visible functionality intended.
@todo
Copy link

todo bot commented Aug 25, 2021

(#6668): Some exchange has leak, shutting down ExchangeManager will cause a assert fail.

// TODO(#6668): Some exchange has leak, shutting down ExchangeManager will cause a assert fail.
// if (mExchangeMgr != nullptr)
// {
// mExchangeMgr->Shutdown();
// }
if (mSessionMgr != nullptr)
{
mSessionMgr->Shutdown();
}
mStorageDelegate = nullptr;


This comment was generated by todo based on a TODO comment in aa6e189 in #9247. cc @kpschoedel.

@github-actions
Copy link

Size increase report for "gn_qpg-example-build" from d05f16f

File Section File VM
chip-qpg6100-lighting-example.out .text -16 -16
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-qpg6100-lighting-example.out and ./pull_artifact/chip-qpg6100-lighting-example.out:

sections,vmsize,filesize
.debug_info,0,18993
.debug_line,0,1817
.debug_str,0,322
.debug_ranges,0,248
.debug_loc,0,165
[Unmapped],0,16
.debug_aranges,0,-8
.text,-16,-16
.debug_frame,0,-20
.symtab,0,-96
.strtab,0,-100
.debug_abbrev,0,-537

Comparing ./master_artifact/chip-qpg6100-lighting-example.out.map and ./pull_artifact/chip-qpg6100-lighting-example.out.map:

BLOAT EXECUTION FAILED WITH CODE 1:
bloaty: unknown file type for file './pull_artifact/chip-qpg6100-lighting-example.out.map'


@github-actions
Copy link

Size increase report for "esp32-example-build" from d05f16f

File Section File VM
chip-temperature-measurement-app.elf .flash.rodata 4 4
chip-temperature-measurement-app.elf .flash.text -28 -28
chip-bridge-app.elf .flash.text 28 28
chip-bridge-app.elf .flash.rodata 4 4
chip-ipv6only-app.elf .flash.text 172 172
chip-shell.elf .flash.text 108 108
chip-shell.elf .flash.rodata 4 4
chip-all-clusters-app.elf .flash.text 28 28
chip-lock-app.elf .flash.text 28 28
chip-lock-app.elf .flash.rodata 4 4
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-temperature-measurement-app.elf and ./pull_artifact/chip-temperature-measurement-app.elf:

sections,vmsize,filesize
.debug_info,0,24009
.debug_line,0,2416
.debug_abbrev,0,1577
.debug_str,0,324
.debug_loc,0,166
.debug_ranges,0,104
.debug_frame,0,24
[Unmapped],0,24
.debug_aranges,0,8
.flash.rodata,4,4
.strtab,0,3
.shstrtab,0,1
.flash.text,-28,-28

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-bridge-app.elf and ./pull_artifact/chip-bridge-app.elf:

sections,vmsize,filesize
.debug_info,0,25111
.debug_line,0,2484
.debug_abbrev,0,1601
.debug_str,0,324
.debug_loc,0,160
.debug_ranges,0,104
.flash.text,28,28
.debug_frame,0,24
.debug_aranges,0,8
.flash.rodata,4,4
.strtab,0,3
.shstrtab,0,1
[Unmapped],0,-32

Comparing ./master_artifact/chip-ipv6only-app.elf and ./pull_artifact/chip-ipv6only-app.elf:

sections,vmsize,filesize
.flash.text,172,172
[Unmapped],0,-172

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_info,0,14970
.debug_line,0,1707
.debug_abbrev,0,977
.debug_str,0,329
.debug_loc,0,173
.flash.text,108,108
.debug_ranges,0,104
.strtab,0,51
.debug_frame,0,24
.symtab,0,16
.debug_aranges,0,8
.flash.rodata,4,4
.shstrtab,0,1
[Unmapped],0,-112

Comparing ./master_artifact/chip-persistent-storage.elf and ./pull_artifact/chip-persistent-storage.elf:

sections,vmsize,filesize
.debug_info,0,542
.debug_str,0,290
.debug_line,0,42
.debug_abbrev,0,8
.debug_loc,0,-6

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_info,0,33744
.debug_line,0,2915
.debug_abbrev,0,2067
.debug_str,0,323
.debug_ranges,0,96
.debug_loc,0,93
.flash.text,28,28
.debug_aranges,0,8
.debug_frame,0,8
.riscv.attributes,0,2
[Unmapped],0,-28
.symtab,0,-48
.strtab,0,-100

Comparing ./master_artifact/chip-lock-app.elf and ./pull_artifact/chip-lock-app.elf:

sections,vmsize,filesize
.debug_info,0,25940
.debug_line,0,2547
.debug_abbrev,0,1657
.debug_str,0,325
.debug_loc,0,195
.debug_ranges,0,104
.flash.text,28,28
.debug_frame,0,24
.debug_aranges,0,8
.flash.rodata,4,4
.strtab,0,3
.shstrtab,0,1
[Unmapped],0,-32


@github-actions
Copy link

Size increase report for "nrfconnect-example-build" from d05f16f

File Section File VM
chip-shell.elf device_handles 12 12
chip-shell.elf text 4 4
chip-lock.elf text -16 -16
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_info,0,10526
.debug_line,0,988
.debug_str,0,385
.debug_ranges,0,320
.debug_loc,0,83
device_handles,12,12
text,4,4
.debug_aranges,0,-8
.debug_frame,0,-16
.debug_abbrev,0,-22
.symtab,0,-48
.strtab,0,-52

Comparing ./master_artifact/chip-lock.elf and ./pull_artifact/chip-lock.elf:

sections,vmsize,filesize
.debug_info,0,19670
.debug_line,0,1680
.debug_str,0,377
.debug_ranges,0,320
.debug_aranges,0,-8
.debug_frame,0,-16
text,-16,-16
.symtab,0,-96
.strtab,0,-100
.debug_loc,0,-273
.debug_abbrev,0,-286


@kpschoedel
Copy link
Contributor Author

@mspang mspang merged commit 371fb31 into project-chip:master Aug 31, 2021
@kpschoedel kpschoedel deleted the x7725-system-event-6-init branch August 31, 2021 14:07
mkardous-silabs pushed a commit to mkardous-silabs/connectedhomeip that referenced this pull request Sep 24, 2021
#### Problem

There have been multiple instances of code using a `System::Layer`
object after it has been shut down or destroyed, some previously
fixed in project-chip#8865. (In the ancestral code, `System::Layer` was fully
static.)

#### Change overview

- More thoroughly track and check `System::Layer` object state.
- Spin out state tracking into `lib/support/ObjectLifeCycle.h`
- Fix several sequencing issues.

#### Testing

CI; no change to visible functionality intended.
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