-
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
Shutdown while there are live exchanges will crash #20880
Comments
Easy way to reproduce: set |
Shutting down exchanges has nuances - if the exchange is awaiting a response, then the exchange management layer presumably owns the ref, and should call |
Hi, I had the same problem while doing a thread-ble pairing (succeeded, OnPairingComplete was called) . After debugging as shown in the stack below, a call to the "SystemLayer" function is made after a call to "GetSessionManager()" which returns a null pointer. I am on 1a25bbd / SVE - Ubuntu 20.04 64 bits Callstack: |
… outstanding. Commissioner shutdown shuts down the CASE sessions associated with the commissioner, but not the PASE sessions. Those sessions then get shut down much later in shutdown, at which point various objects that are needed to handle the shutdown are no longer present. The fix is to shut down PASE sessions when we destroy CommissioneeDeviceProxy objects, and ensure that we always destroy CommissioneeDeviceProxy via ReleaseCommissioneeDevice, so we don't end up with dangling pointers to the objects. Fixes project-chip#16440 Should vastly improve, if not completely fix, project-chip#20880
… outstanding. Commissioner shutdown shuts down the CASE sessions associated with the commissioner, but not the PASE sessions. Those sessions then get shut down much later in shutdown, at which point various objects that are needed to handle the shutdown are no longer present. The fix is to shut down PASE sessions when we destroy CommissioneeDeviceProxy objects, and ensure that we always destroy CommissioneeDeviceProxy via ReleaseCommissioneeDevice, so we don't end up with dangling pointers to the objects. Fixes project-chip#16440 Should vastly improve, if not completely fix, project-chip#20880
… outstanding. Commissioner shutdown shuts down the CASE sessions associated with the commissioner, but not the PASE sessions. Those sessions then get shut down much later in shutdown, at which point various objects that are needed to handle the shutdown are no longer present. The fix is to shut down PASE sessions when we destroy CommissioneeDeviceProxy objects, and ensure that we always destroy CommissioneeDeviceProxy via ReleaseCommissioneeDevice, so we don't end up with dangling pointers to the objects. Fixes project-chip#16440 Should vastly improve, if not completely fix, project-chip#20880
… outstanding. Commissioner shutdown shuts down the CASE sessions associated with the commissioner, but not the PASE sessions. Those sessions then get shut down much later in shutdown, at which point various objects that are needed to handle the shutdown are no longer present. The fix is to shut down PASE sessions when we destroy CommissioneeDeviceProxy objects, and ensure that we always destroy CommissioneeDeviceProxy via ReleaseCommissioneeDevice, so we don't end up with dangling pointers to the objects. Fixes project-chip#16440 Should vastly improve, if not completely fix, project-chip#20880
… outstanding. Commissioner shutdown shuts down the CASE sessions associated with the commissioner, but not the PASE sessions. Those sessions then get shut down much later in shutdown, at which point various objects that are needed to handle the shutdown are no longer present. The fix is to shut down PASE sessions when we destroy CommissioneeDeviceProxy objects, and ensure that we always destroy CommissioneeDeviceProxy via ReleaseCommissioneeDevice, so we don't end up with dangling pointers to the objects. Fixes project-chip#16440 Should vastly improve, if not completely fix, project-chip#20880
… outstanding. (#22282) Commissioner shutdown shuts down the CASE sessions associated with the commissioner, but not the PASE sessions. Those sessions then get shut down much later in shutdown, at which point various objects that are needed to handle the shutdown are no longer present. The fix is to shut down PASE sessions when we destroy CommissioneeDeviceProxy objects, and ensure that we always destroy CommissioneeDeviceProxy via ReleaseCommissioneeDevice, so we don't end up with dangling pointers to the objects. Fixes #16440 Should vastly improve, if not completely fix, #20880
… outstanding. Commissioner shutdown shuts down the CASE sessions associated with the commissioner, but not the PASE sessions. Those sessions then get shut down much later in shutdown, at which point various objects that are needed to handle the shutdown are no longer present. The fix is to shut down PASE sessions when we destroy CommissioneeDeviceProxy objects, and ensure that we always destroy CommissioneeDeviceProxy via ReleaseCommissioneeDevice, so we don't end up with dangling pointers to the objects. Fixes project-chip#16440 Should vastly improve, if not completely fix, project-chip#20880
On the client, if you use DeviceController we now do that during DeviceController shutdown.... But on the server, or if not using DeviceController, you're on your own. |
… outstanding. (project-chip#22282) Commissioner shutdown shuts down the CASE sessions associated with the commissioner, but not the PASE sessions. Those sessions then get shut down much later in shutdown, at which point various objects that are needed to handle the shutdown are no longer present. The fix is to shut down PASE sessions when we destroy CommissioneeDeviceProxy objects, and ensure that we always destroy CommissioneeDeviceProxy via ReleaseCommissioneeDevice, so we don't end up with dangling pointers to the objects. Fixes project-chip#16440 Should vastly improve, if not completely fix, project-chip#20880
We could end up shutting down the exchange manager while we still had live sessions/exchanges, at which point shutting down those would crash as they tried to get information from the exchange manager. The fix is to document the required shutdown ordering and enforce it correctly in CHIPDeviceControllerFactory and Server. Fixes project-chip#20880
We could end up shutting down the exchange manager while we still had live sessions/exchanges, at which point shutting down those would crash as they tried to get information from the exchange manager. The fix is to document the required shutdown ordering and enforce it correctly in CHIPDeviceControllerFactory and Server. Fixes project-chip#20880
We could end up shutting down the exchange manager while we still had live sessions/exchanges, at which point shutting down those would crash as they tried to get information from the exchange manager. The fix is to document the required shutdown ordering and enforce it correctly in CHIPDeviceControllerFactory and Server. Fixes project-chip#20880
Problem
During shutdown, we shut down the exchange manager, then the session manager.
Session manager shutdown evicts all sessions.
If there are exchanges waiting on a response timer, this will try to cancel the response timer, which will crash because we already shut down the exchange manager and that code is doing:
so we null-deref
mExchangeMgr->GetSessionManager()
.Stack:
Proposed Solution
Shutdown of the exchange manager should probably shut down outstanding exchanges. Or we should evict all sessions much earlier in shutdown, before we start tearing down object relationships.
Or both: since shutting down exchanges notifies applications, we should be doing that as early during shutdown as we can, so that there is minimal risk that applications touch something that is already torn down.
The text was updated successfully, but these errors were encountered: