-
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
Data race in UDPEndpoint on lwIP and OpenThread #20478
Comments
@kpschoedel How do you think of this issue? |
I do think the correct solution is expand thread lock into a global matter lock
This also works, but I wonder if it is able to catch 1.0 timeline
This is the evidence that there is a bug inside thread implementation. It won't crash inside |
|
Problem
One of our vendors reported random crashes in the light app. The app crashes at line
UDPEndPointImplLwIP::LwIPReceiveUDPMessage
. Theep->Retain();
line reports invalid reference count and aborted.The current imlementaion of this function will suffer from data race.
ep->Retain()
will be executed in the lwIP event loop whileep->Release()
is executed in the Matter event loop. The following patch has been suggested to the vendor:This is not correct but will resolve the data race issue. After applying the patch the crash no longer happens. Similar logic is found in the OpenThread UDP endpoint implementation so there will be potential bugs as well.
Proposed solution
One of the following solutions can be adpoted:
Retain
andRelease
logic since in practice nobody is releasing the endpoint.The text was updated successfully, but these errors were encountered: