-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Catch or release ObjectPool leaks #12499
Merged
andy31415
merged 3 commits into
project-chip:master
from
kpschoedel:x7715-pool-destructor
Dec 4, 2021
Merged
Catch or release ObjectPool leaks #12499
andy31415
merged 3 commits into
project-chip:master
from
kpschoedel:x7715-pool-destructor
Dec 4, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Problem No action is taken if an `ObjectPool` is destroyed while objects remain live. For the `BitMapObjectPool` case, such objects can't be safely touched. For `HeapObjectPool` such objects can be used but can't be released. Some leaks have been fixed (project-chip#11983, project-chip#12031), but there are still a few remaining. Fixes project-chip#11880 _Possible use of destroyed pool objects_ #### Change overview - Add an `ObjectPool` template argument specifying what to do if it is destroyed with live objects: abort with an error message (the default), release the live objects (which calls their destructors), or ignore the condition (transitionally, until all leaks are fixed). - Fix shutdown ordering in `DeviceControllerSystemState`. - For existing pools in `SessionManager`, `InteractionModelEngine`, and `GroupDataProviderImpl`, ignore the condition. #### Testing CI; no changes to functionality.
pullapprove
bot
requested review from
anush-apple,
balducci-apple,
bzbarsky-apple,
carol-apple,
chrisdecenzo,
chulspro,
Damian-Nordic,
electrocucaracha,
emargolis,
erjiaqing,
franck-apple,
hawk248,
holbrookt,
jelderton,
jepenven-silabs,
jmartinez-silabs,
kghost,
LuDuda,
mlepage-google,
mrjerryjohns,
msandstedt,
mspang,
pan-apple,
robszewczyk and
sagar-apple
December 2, 2021 20:13
pullapprove
bot
requested review from
saurabhst,
selissia,
tecimovic,
turon,
vijs,
vivien-apple,
wbschiller,
woody-apple and
yufengwangca
December 2, 2021 20:13
PR #12499: Size comparison from 803f3b8 to 8912f0b Increases above 0.2%:
Increases (36 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
Full report (39 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
kpschoedel
commented
Dec 2, 2021
woody-apple
approved these changes
Dec 2, 2021
Filed issues for the remaining leaks: |
andy31415
approved these changes
Dec 2, 2021
|
PR #12499: Size comparison from e8da685 to d1c79c0 Increases above 0.2%:
Increases (37 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
Decreases (15 builds for esp32, mbed, nrfconnect, p6)
Full report (39 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
ObjectPool
s are sometimes destroyed while objectsremain live. For
BitMapObjectPool
case, such objects can'tbe safely touched. For
HeapObjectPool
such objects can be usedbut can't be released.
Some leaks have been fixed (#11983, #12031), but there are still
a few remaining.
Fixes #11880 Possible use of destroyed pool objects
Change overview
Prevent future leaks by adding an
ObjectPool
template argumentspecifying what to do if it is destroyed with live objects: abort with
an error message (the default), release the live objects (which calls
their destructors), or ignore the condition (transitionally, until all
leaks are fixed).
Fix shutdown ordering in
DeviceControllerSystemState
.For existing pools in
SessionManager
,InteractionModelEngine
,and
GroupDataProviderImpl
, ignore the condition.Testing
CI; no changes to external functionality.