Help with figuring out what is causing waitchain/deadlock in dashost (causing TaskMgr, Settings hang or any app that uses WiFi/BT)

Narayan B 110 Reputation points
2023-08-01T05:30:06.1966667+00:00

Windows 11 Home 22H2 22621.1992

Hang due to a deadlock between dashost.exe (Device association) and svchost [WLAN AutoConfig i.e. WlanSvc] for unknown reason, but caused by something waiting on the WiFi card. Drivers are up-to-date [RTL8822CE].

I need help figuring out what it is waiting for, specifically, is it caused by some enumeration issue or BT pairing locked somehow (my guesses). Not able to use bluetooth device at all for scanning, pairing, removing existing paired devices, etc. I can't even switch it on from the Taskbar.

WaitingOn output [on Task Manager after clicking "close"]: https://pastebin.com/b6RjkPxt

(I've gone and traced on all waiting processes. dashost seems to depend on WLanSvc, which in turn depends on dashost which is causing the cycle. dashost also created a massive amount of threads for unknown reasons.)

Relevant questions I asked on "answers" site, with some footage:

https://answers.microsoft.com/en-us/windows/forum/all/task-manager-hang-and-crash/a02568a6-6615-4ed9-aea1-14b6713eaaaf

https://answers.microsoft.com/en-us/windows/forum/all/windows-11-bluetooth-issue/a6e535e6-b76f-4b73-8f0e-cc5e686b633d

Task Manager hang - how to reproduce:

https://youtu.be/m5m-9p_xPfM

Bluetooth settings:

https://youtu.be/V_any4DV5yA

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,382 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Narayan B 110 Reputation points
    2023-11-16T05:20:03.96+00:00

    So I finally solved it!

    Source of the problem: an Android TV (HiSense model) connected to my network. Yes. A TV caused this issue.

    Details:

    The root cause is the TV generates random UUIDs for UPNP network discovery every few minutes. That means it poses as a new device. This caused windows to add it to the device list (Device Association Framework, aka DAF) as a new device. This means now 1000s of devices (which is the same device) filled the device tree causing it to enumerate forever. Thus the "deadlock".

    TaskManager uses DasHost to enumerate devices for some reason, so that hangs.

    Bluetooth relies on device discovery, so that also hangs, and Settings app along with it.

    Network discovery in file explorer obviously also needs Device discovery, so that also hangs.

    How to solve:

    1. Open Services App, find "Device Association Service", right-click it, properties and change Startup type to "Disabled". Then Apply and close.
      User's image
    2. You can't stop the process from Services, so you need to force kill it. Open ProcessExplorer by Sysinternals as Admin, stop the svchost.exe that is parent to dashost.exe.
    3. Download PStools by Sysinternals, open an Admin terminal, run:

    .\psexec.exe -i -d -s c:\windows\regedit.exe

    Screenshot 2023-11-16 102441

    This will open regedit as SYSTEM user.

    1. Navigate to:

    Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\DeviceAssociationService\State\Store

    You will find hundreds of keys with a DAFUPnPProvider#uuid.... name. You need to delete ALL of these ones (only inside the Store key, nothing else) and not any other prefix. ONLY THE DAFUPnPProvider ones, like so:
    Screenshot 2023-11-16 102433

    Just select the first key, hit delete key, then enter key. Keep doing it till I think WiFiDirect key and Bluetooth device keys remains.
    User's image

    1. Reboot. You should now enable (make startup type to Automatic) the service you disabled and it should start working.
    2. Done :)

    User's image

    BT fixed, TaskManager Fixed, and Network Discovery Fixed.

    How I discovered it:

    I was just checking the handles of the service and discovered the "Store" key by accident. I checked it and found maybe 300 or so keys. I knew this was an issue with UPnP because of the name of the service. Also I posted an issue before of the TV causing UPnP flood, but didn't think Windows would go for a toss due to this.

    Screenshot 2023-11-16 091541

    Update:

    You might also need to check out this key as well:

    Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\SWD\DAFUPnPProvider

    It also contains some UPnP discovery keys. There might be more places that I'm not aware of.

    User's image

    13 people found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more