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

ObjectPool leaks in Session management #12505

Closed
kpschoedel opened this issue Dec 2, 2021 · 0 comments · Fixed by #12906
Closed

ObjectPool leaks in Session management #12505

kpschoedel opened this issue Dec 2, 2021 · 0 comments · Fixed by #12906
Labels
leak Memory leak bug

Comments

@kpschoedel
Copy link
Contributor

Problem

The following BitMapObjectPools had live objects when destroyed, during CI tests.yaml.

  • CASESessionManager::mActiveSessions
  • SecureSessionTable::mEntries
  • SessionManager::mSessionCreationDelegates
  • SessionManager::mSessionReleaseDelegates
  • SessionManager::mSessionRecoveryDelegates
  • UnauthenticatedSessionTable::mEntries

(Replacing issue #11880 Possible use of destroyed pool objects with specific issues for the few remaining instances.)

Proposed Solution

Someone with Session domain knowledge should decide where/whether remaining pool objects should be released (e.g. calling ReleaseAll() in the enclosing class's destructor), or whether some other action should be taken (e.g. extending the lifetime of the enclosing class instances).

@kpschoedel kpschoedel added the leak Memory leak bug label Dec 7, 2021
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this issue Dec 10, 2021
#### Problem

Fixes project-chip#12505 ObjectPool leaks in Session management

#### Change overview

- Call `ReleaseAll()` on the various object pools in their
  owners' destructors.
- Fix `TestSessionManager` to call `SessionManager::Shutdown()`
- Remove the now-unused `OnObjectPoolDestruction` option from
  object pools. Destroying a pool with live objects will now
  fail unconditionally.

#### Testing

CI; fixed unit tests.
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this issue Dec 10, 2021
#### Problem

Fixes project-chip#12505 ObjectPool leaks in Session management

#### Change overview

- Call `ReleaseAll()` on the various object pools in their
  owners' destructors.
- Fix `TestSessionManager` to call `SessionManager::Shutdown()`
- Remove the now-unused `OnObjectPoolDestruction` option from
  object pools. Destroying a pool with live objects will now
  fail unconditionally.

#### Testing

CI; fixed unit tests.
kpschoedel added a commit to kpschoedel/connectedhomeip that referenced this issue Dec 10, 2021
#### Problem

Fixes project-chip#12505 ObjectPool leaks in Session management

#### Change overview

- Call `ReleaseAll()` on the various object pools in their
  owners' destructors.
- Fix `TestSessionManager` to call `SessionManager::Shutdown()`
- Remove the now-unused `OnObjectPoolDestruction` option from
  object pools. Destroying a pool with live objects will now
  fail unconditionally.

#### Testing

CI; fixed unit tests.
bzbarsky-apple pushed a commit that referenced this issue Dec 11, 2021
#### Problem

Fixes #12505 ObjectPool leaks in Session management

#### Change overview

- Call `ReleaseAll()` on the various object pools in their
  owners' destructors.
- Fix `TestSessionManager` to call `SessionManager::Shutdown()`
- Remove the now-unused `OnObjectPoolDestruction` option from
  object pools. Destroying a pool with live objects will now
  fail unconditionally.

#### Testing

CI; fixed unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
leak Memory leak bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant