-
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
Fix crashes when closing all exchanges for fabric. #19780
Merged
woody-apple
merged 6 commits into
project-chip:master
from
bzbarsky-apple:fix-crash-aborting
Jun 22, 2022
Merged
Fix crashes when closing all exchanges for fabric. #19780
woody-apple
merged 6 commits into
project-chip:master
from
bzbarsky-apple:fix-crash-aborting
Jun 22, 2022
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
PR #19780: Size comparison from 48606c6 to b37d526 Increases (35 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, nrfconnect, p6, telink)
Decreases (16 builds for cc13x2_26x2, linux)
Full report (36 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
pullapprove
bot
requested review from
anush-apple,
arkq,
Byungjoo-Lee,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
Damian-Nordic,
dhrishi,
electrocucaracha,
emargolis,
franck-apple,
gjc13,
hawk248,
harsha-rajendran,
isiu-apple,
jelderton,
jepenven-silabs,
jmartinez-silabs,
jtung-apple,
kpschoedel,
lazarkov,
LuDuda,
msandstedt,
mspang,
rgoliver and
sagar-apple
June 20, 2022 22:02
PR #19780: Size comparison from 2ac3ee7 to a6e33eb Increases (33 builds for cc13x2_26x2, cyw30739, k32w, linux, nrfconnect, p6, telink)
Decreases (16 builds for cc13x2_26x2, linux)
Full report (34 builds for cc13x2_26x2, cyw30739, k32w, linux, mbed, nrfconnect, p6, telink)
|
kghost
reviewed
Jun 21, 2022
Our "close all exchanges except this special one for this fabric" API messes up exchange refcounting, leading to use-after-free. The fix is to reuse, as much as possible, the normal "session is going away" flow to notify exchanges, and other session consumers, that the sessions are in fact going away. Fixes project-chip#19747
bzbarsky-apple
force-pushed
the
fix-crash-aborting
branch
from
June 21, 2022 13:57
f299d0e
to
89c4bac
Compare
PR #19780: Size comparison from c6724a0 to 89c4bac Increases (28 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, p6, telink)
Decreases (5 builds for cc13x2_26x2)
Full report (28 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, p6, telink)
|
msandstedt
reviewed
Jun 21, 2022
We need to allow messages on inactive sessions to reach the exchange manager, because such sessions need to be able to deliver an MRP ack to an exchange waiting for one. We also don't want to crash on an attempt to transition from Inactive to Defunct state; the transition should just be ignored. This way if we start trying to transitionin to Defunct on MRP delivery failures we will not start crashing if such a failure happens on an Inactive session.
bzbarsky-apple
force-pushed
the
fix-crash-aborting
branch
from
June 21, 2022 15:35
3a0aaf1
to
ca1e439
Compare
msandstedt
reviewed
Jun 21, 2022
msandstedt
reviewed
Jun 21, 2022
msandstedt
reviewed
Jun 21, 2022
msandstedt
reviewed
Jun 21, 2022
PR #19780: Size comparison from 39073b3 to 4eb7793 Increases (36 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Decreases (5 builds for cc13x2_26x2)
Full report (36 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
msandstedt
approved these changes
Jun 21, 2022
woody-apple
approved these changes
Jun 21, 2022
As per our discussions, will wait till the PR gets updated to the pinning approach outlined here, with revisions. |
mrjerryjohns
approved these changes
Jun 22, 2022
msandstedt
approved these changes
Jun 22, 2022
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.
Our "close all exchanges except this special one for this fabric" API
messes up exchange refcounting, leading to use-after-free.
The fix is to reuse, as much as possible, the normal "session is going
away" flow to notify exchanges, and other session consumers, that the
sessions are in fact going away.
Fixes #19747
Problem
See #19747.
Change overview
See above: we make this special operation look as much as possible like all the relevant sessions being marked for removal in the normal way.
Testing
Tests added that test various scenarios. Without this PR (using the old exchange manager API) those tests fail with all sorts of use-after-free issues.