As I am not sure whether the KDE bug tracker is the right place and because it would be nice if someone else could reproduce it / dig into it a bit, so I’m opening a discussion first.
I use Windows 10/11 with KDE Connect 26.08.1 and wanted to try out the bluetooth backend functionality because I was curious. But when I try to connect to my Android 16 phone with KDE Connect 1.35.17 via bluetooth the connection gets lost about 4 seconds later. I looked in the windows event log and found out that the kdeconnectd.exe crashed with a stack overflow.
STATUS_STACK_OVERFLOW | ERROR_CODE: (NTSTATUS) 0xc00000fd - A new guard page for the stack cannot be created.
Further investigations showed that maybe the issue comes from the qtconnectivity code.
1. `ConnectionMultiplexer` connects the socket’s `bytesWritten` signal to its own slot `bytesWritten()` (<permalink to connectionmultiplexer.cpp#L37>).
2. That slot calls `mSocket->write(to_write_bytes)` (<permalink #L322>) and only removes the written data from `to_write_bytes` after `write()` has returned (L327-331).
3. On Windows, `QBluetoothSocketPrivateWinRT::writeData()` (qtconnectivity, `src/bluetooth/qbluetoothsocket_winrt.cpp`) writes synchronously and emits `bytesWritten` before it returns.
4. So the slot is re-entered while `to_write_bytes` is still unchanged, writes the same data again, which emits `bytesWritten` again, and so on until the stack overflows.
Do you think this is a valid explanation for the problem?
If kdeconnectd.exe is hitting STATUS_STACK_OVERFLOW (0xc00000fd) around the WinRT Bluetooth stream acquisition, this often points to recursive signal/slot dispatching or an unhandled event loop when the socket state changes. To pinpoint the exact trace leading into QtConnectivity, running kdeconnectd with QT_LOGGING_RULES=“kdeconnect.=true;qt.bluetooth.windows=true” in a terminal can capture the calls immediately preceding the overflow. Submitting this directly to bugs.kde.org under KDE Connect with the full crash dump / backtrace attached is likely the best way to get Windows maintainer attention.