-
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
Use Pool for mDNS udp endpoint, fix endpoint leak #12417
Merged
Merged
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
pullapprove
bot
requested review from
anush-apple,
austinh0,
balducci-apple,
bzbarsky-apple,
carol-apple,
cecille,
chrisdecenzo,
chulspro,
Damian-Nordic,
electrocucaracha,
emargolis,
erjiaqing,
franck-apple,
harimau-qirex,
hawk248,
jelderton,
jepenven-silabs,
jmartinez-silabs,
LuDuda,
mlepage-google,
msandstedt,
mspang,
pan-apple,
sagar-apple,
saurabhst,
selissia,
tcarmelveilleux,
tecimovic and
turon
December 1, 2021 16:39
pullapprove
bot
requested review from
vijs,
vivien-apple,
wbschiller,
woody-apple and
yunhanw-google
December 1, 2021 16:39
kghost
force-pushed
the
fix-mdns-udp-leak
branch
from
December 1, 2021 16:49
75cc994
to
43d7be6
Compare
andy31415
reviewed
Dec 1, 2021
andy31415
reviewed
Dec 1, 2021
andy31415
reviewed
Dec 1, 2021
andy31415
approved these changes
Dec 1, 2021
PR #12417: Size comparison from a7b18b8 to 43d7be6 Increases above 0.2%:
Increases (16 builds for esp32, linux, mbed, p6)
Decreases (6 builds for mbed, p6)
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
woody-apple
approved these changes
Dec 1, 2021
kghost
force-pushed
the
fix-mdns-udp-leak
branch
from
December 2, 2021 17:16
43d7be6
to
ba9fdc3
Compare
yunhanw-google
approved these changes
Dec 2, 2021
kghost
force-pushed
the
fix-mdns-udp-leak
branch
from
December 2, 2021 17:21
ba9fdc3
to
c1fd988
Compare
kghost
force-pushed
the
fix-mdns-udp-leak
branch
from
December 2, 2021 17:32
c1fd988
to
6d4b0b9
Compare
this wastes one copy of the data and that could be optimized awayconnectedhomeip/src/lib/dnssd/minimal_mdns/Server.cpp Lines 363 to 373 in 6d4b0b9
This comment was generated by todo based on a
|
kghost
force-pushed
the
fix-mdns-udp-leak
branch
from
December 2, 2021 20:19
6d4b0b9
to
9cb6acd
Compare
PR #12417: Size comparison from 803f3b8 to 9cb6acd Increases above 0.2%:
Increases (17 builds for esp32, linux, mbed, p6)
Decreases (7 builds for mbed, p6)
Full report (39 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
kpschoedel
added a commit
to kpschoedel/connectedhomeip
that referenced
this pull request
Dec 3, 2021
andy31415
pushed a commit
that referenced
this pull request
Dec 4, 2021
* Catch or release ObjectPool leaks #### 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 (#11983, #12031), but there are still a few remaining. Fixes #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. * new uses in #12417
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
There are 2 problems:
ServerBase::Listen
ofsrc/lib/dnssd/minimal_mdns/Server.cpp
. IfJoinMulticastGroup
,endpointIndex
won't advance, theunicast_query_udp
assigned to this slot will be override by next item.Server
class insrc/lib/dnssd/minimal_mdns/Server.h
is derived fromServerBase
, when destructingServer
instance, themAllocatedStorage
array is disposed before destructor ofServerBase
is called, so~ServerBase
will access already disposed memory.Change overview
Use memory pool to manage objects instead of an array.
Reorder destructor of those objects
Testing
Manually tested with unit-tests using x64 linux