FE/Qt: Do not wildcard-disconnect the synthetic work-area workers - #844
Open
dr1fter wants to merge 1 commit into
Open
FE/Qt: Do not wildcard-disconnect the synthetic work-area workers#844dr1fter wants to merge 1 commit into
dr1fter wants to merge 1 commit into
Conversation
r173930 introduced 'pWorker->disconnect(); pWorker->deleteLater();' for the UIInvisibleWindow helpers used to measure host-screen available geometry. The no-argument disconnect() is a wildcard and also removes Qt's internal destroyed() connections, which Qt warns about: QObject::disconnect: wildcard call disconnects from destroyed signal of UIInvisibleWindow::unnamed With that bookkeeping gone, any host work-area change can crash the frontend while the replacement worker is being created: QAccessibleWidget::text() <- QWidgetPrivate::setWindowTitle_sys() <- QWidgetPrivate::create() <- QWidget::showMaximized() <- UIDesktopWidgetWatchdog::sltHandleHostScreenWorkAreaResized() No monitor hotplug, suspend/resume or DPMS transition is needed; on X11 an ordinary _NET_WORKAREA change (a desktop panel hiding, or the shell being restarted) is sufficient and reproduces on the first attempt. Disconnect only the worker signal actually connected here, at all three worker-lifecycle sites, keeping the deleteLater() from r173930. Tested on 7.2.16 with Qt 6.11.2 on X11: stock crashes on the first forced work-area change, patched survives repeated cycles with no new coredumps and no wildcard-disconnect warning. Fixes: VirtualBox#397 Signed-off-by: Christian Cwienk <ccwienk@dr1fter.de>
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #397. Likely also covers #658 and #633, which are the same crash reached
by a shell restart or screen lock changing the host work area.
Problem
r173930 / 700da74 introduced this teardown for the
UIInvisibleWindowhelpersthat measure host-screen available geometry:
The no-argument
disconnect()is a wildcard: it also removes Qt's internaldestroyed()connections. Qt warns about exactly this:With that bookkeeping gone, any host work-area change can crash the frontend
while the replacement worker is being created:
Notably this needs no monitor hotplug, suspend/resume or DPMS transition. On
X11 an ordinary
_NET_WORKAREAchange is enough — toggling a desktop panel'sautohide reproduces it on the first attempt, which is why reports involving
shell restarts (#658) and screen locks (#633) look unrelated but are not.
QT_ACCESSIBILITY=0is sometimes suggested as a workaround; it has no effecton Qt 6, where the AT-SPI bridge is brought up over D-Bus regardless.
Change
Disconnect only the signal actually connected here —
UIInvisibleWindow::sigHostScreenAvailableGeometryCalculated— at all threeworker-lifecycle sites (
sltHandleHostScreenAvailableGeometryCalculated,updateHostScreenAvailableGeometry,cleanupExistingWorkers), keeping thedeleteLater()from r173930.Validation
Arch Linux, X11, Cinnamon 6.6.9/Muffin 6.6.3, VirtualBox 7.2.16, Qt 6.11.2.
Trigger: toggling panel autohide, moving
_NET_WORKAREAbetween 1170 and 1200.Note on the wider design
The deeper issue is that the work-area handler itself calls
updateHostScreenAvailableGeometry(), which creates a real window andmaximises it — so measuring the work area perturbs the work area. This change
makes that survivable; a re-entrancy guard in
sltHandleHostScreenWorkAreaResized()would address the shape of it moredirectly. I kept to the smaller change because it is the one I could verify.