Summary: | VNC plugin deadlocks on connection | ||
---|---|---|---|
Product: | [Applications] krdc | Reporter: | Thiago Macieira <thiago> |
Component: | VNC | Assignee: | Urs Wolfer <uwolfer> |
Status: | RESOLVED FIXED | ||
Severity: | grave | CC: | chemobejk, nicolas.fella, vasyl.demin |
Priority: | NOR | ||
Version First Reported In: | 24.02.2 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/network/krdc/-/commit/e6a169e40b80b4fcd5e42dbba17d82f3f7bf4feb | Version Fixed In: | |
Sentry Crash Report: |
Description
Thiago Macieira
2024-04-26 22:55:49 UTC
I'd say "vncplugin doesn't work at all, ever, under any conditions, if you try to use it" is sufficient for "critical", but ok for "grave" BTW, I tried to fix that function myself. I can apply a workaround to just restore the previous behaviour, but that's papering over the sun with a sieve. I really don't understand what's going on and what is being locked. Is it trying to protect m_stopped? Why not use an atomic instead? Or, better, QThread::isInterruptionRequested()? But on line 549, it accesses m_stopped without a mutex, so I don't know if it needed protecting in the first place. Ditto for m_passwordError: why not an atomic? Or why not use a local variable and only lock to save the state when exiting the function? This code should be rewritten with closer locks, not that one QMutexLocker at the top that is used incorrectly. A possibly relevant merge request was started @ https://invent.kde.org/network/krdc/-/merge_requests/99 Git commit 48fbcdffc4ff22a11b56d8809739e0f096d190e6 by Nicolas Fella, on behalf of Thiago Macieira. Committed on 30/04/2024 at 22:45. Pushed by nicolasfella into branch 'release/24.02'. VNC: replace m_stopped with QThread's interruptionRequested It's an out-of-line function call, but it doesn't require a mutex for most uses. The uses in the callbacks are replaced with isRunning(), because interruptionRequested resets back to false as soon as run() exits. (cherry picked from commit 33f89ef0bb4f5186dad7ceecad599a0e834e7f88) M +14 -24 vnc/vncclientthread.cpp M +0 -1 vnc/vncclientthread.h https://invent.kde.org/network/krdc/-/commit/48fbcdffc4ff22a11b56d8809739e0f096d190e6 *** Bug 485215 has been marked as a duplicate of this bug. *** I can confirm that after applying the patch VNC connections work again with krdc. Git commit e6a169e40b80b4fcd5e42dbba17d82f3f7bf4feb by Nicolas Fella, on behalf of Thiago Macieira. Committed on 08/06/2024 at 18:42. Pushed by nicolasfella into branch 'release/24.05'. VNC: replace m_stopped with QThread's interruptionRequested It's an out-of-line function call, but it doesn't require a mutex for most uses. The uses in the callbacks are replaced with isRunning(), because interruptionRequested resets back to false as soon as run() exits. (cherry picked from commit 33f89ef0bb4f5186dad7ceecad599a0e834e7f88) M +14 -24 vnc/vncclientthread.cpp M +0 -1 vnc/vncclientthread.h https://invent.kde.org/network/krdc/-/commit/e6a169e40b80b4fcd5e42dbba17d82f3f7bf4feb |