[BUG] [Tizen] Calling ChipDnssdResolve
with the CHIP stack locked can cause deadlock
#25466
Labels
tizen
For Tizen platform
Reproduction steps
During our (SmartThings) testing on the Tizen platform we have been encountering an issue where the DNS-SD implementation may become deadlocked when attempting to resolve multiple devices at the same time. I have determined that this occurs because we call
ChipDnssdResolve
with the CHIP stack locked. Consider the following scenario with threads [1] and [2]:ChipDnssdResolve
acquires the CHIP stack lock some arbitrary amount of time beforehand.ChipDnssdResolve
, this thread reachesdnssd_create_remote_service
and attempts to acquire the NSD lock. It waits.OnResolve
in the Matter SDK attempts to acquire the CHIP stack lock. It also waits (here).As a result, the mutually dependent NSD and CHIP stack locks become deadlocked.
If it helps, I've also modified the
TestDnssd
unit test and some build files on a branch in a fork to demonstrate this issue (just a rough patch using your existing work with containers, @arkq). You can find it at https://github.com/gharveymn/connectedhomeip/tree/tizen-deadlock. You can run the test by starting up the docker container and executinggen-cmd.sh
and thenninja -C out/tizen-unit-check check-unit
.CC: @msandstedt @arkq @hyunuktak @chulspro
Bug prevalence
Whenever successfully resolving multiple devices concurrently
GitHub hash of the SDK that was being used
3957377
Platform
other
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: