-
Notifications
You must be signed in to change notification settings - Fork 235
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
[adv-proxy] potential issue in publishing multiple services may cause crash #1991
Comments
Some suggestions/ideas for fix (though none seem to be a quick/simple fix):
Thoughts? BTW, the new |
Thinking more on this I feel it may be easier if we fix this in OT core and in SRP server code:
This seems simpler than other approaches to fix this in I will try to submit a PR with this later today or tomorrow. |
Yeah, agree the SRP server side should guarantee that
Though the SRP server fix will make it work even without this change in OTBR, I think is still a good idea to stop trying to publish the rest of the service if the first one already failed (by checking if this |
Let me copy my thoughts/comment from openthread/openthread#9398: 😃
|
Should be resolved by openthread/openthread#9398 |
I have been testing/developing new code on
otbr
and noticed crash failures on some github action runs.An example from actions/run/6066185479:
This happens in the
SrpRegister500ServicesBR
tests, where clients try to register multiple services.Upon further investigation, I believe I have found the root cause of this issue:
AdvertisingProxy::PublishHostAndItsServices()
iterates over all services of the givenaHost
and callsMdns::Publisher::PublishService()
for each service.PublishService()
method to report back the result.PublishService()
method can invoke the callback directly (before returning fromPublishService()
). This is possible for both MDNSResponder and Avahi implementations.AdvertisingProxy::OnMdnsPublishResult()
method, which, in case of an error, will itself call the OT API to report the failure of the "Service Update Handler". It will callotSrpServerHandleServiceUpdateResult()
API, which will trigger OT SRP Sever to send a failure response to the SRP client and free theaHost
.aHost
, ifPublishService()
fails immediately for one of the first ones, the failure is reported all the way to the OT stack andaHost
is freed while the OTBRAdvertisingProxy
is still holding on theaHost
pointer and trying to iterate and access the next services on an already freedaHost
.The text was updated successfully, but these errors were encountered: