You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, using the ReadInteraction SubscribeAttribute API (via CHIPCluster in this case) means that there is no way to free the callback context (except on errors), because it never delivers OnDone.
In particular, this means that if you shut down and restart the stack the subscription will be dead in the water but its associated memory will be leaked.
This has been a problem all along, but it got highlighted in #22323 because we started freeing the ReadClient (but not the callback context) and now LSan can detect the leak. I assume that it couldn't before because it can't detect leaks of objects that reference each other; it thinks they are referenced from allocated memory....
Proposed Solution
Either fix the ReadInteraction and CHIPCluster API to allow passing in an OnDone callback for subscriptions or stop using them altogether and use ReadClient directly.
Or remove the Darwin subscribeAttribute APIs.
The text was updated successfully, but these errors were encountered:
Problem
See #22323 (comment)
Basically, using the ReadInteraction SubscribeAttribute API (via CHIPCluster in this case) means that there is no way to free the callback context (except on errors), because it never delivers OnDone.
In particular, this means that if you shut down and restart the stack the subscription will be dead in the water but its associated memory will be leaked.
This has been a problem all along, but it got highlighted in #22323 because we started freeing the ReadClient (but not the callback context) and now LSan can detect the leak. I assume that it couldn't before because it can't detect leaks of objects that reference each other; it thinks they are referenced from allocated memory....
Proposed Solution
Either fix the ReadInteraction and CHIPCluster API to allow passing in an OnDone callback for subscriptions or stop using them altogether and use ReadClient directly.
Or remove the Darwin subscribeAttribute APIs.
The text was updated successfully, but these errors were encountered: