Summary: | Crash in KScreen::Mode::id() on Wayland when setting resolution to 1280x720 when native resolution is 1920x1080 | ||
---|---|---|---|
Product: | [Applications] systemsettings | Reporter: | simaduck |
Component: | kcm_kscreen | Assignee: | kscreen-bugs-null <kscreen-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | audun, nate, plasma-bugs, sites+kdebugs, xaver.hugl, yerrey |
Priority: | NOR | Keywords: | drkonqi |
Version: | 5.25.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=432906 | ||
Latest Commit: | https://invent.kde.org/plasma/kwin/commit/d4d4a05444e18963359f3fa6fe482ed6a419aa19 | Version Fixed In: | 5.25.3 |
Sentry Crash Report: | |||
Attachments: | New crash information added by DrKonqi |
Description
simaduck
2022-06-17 12:03:10 UTC
I believe the issue might be related to some modes having bizarre refresh rates on Wayland. Running kscreen-console, you can output the modes and on my system at least 2 of these modes have negative refresh rates: "31" "1368x768@-1501773" QSize(1368, 768) -1.50177e+06 "32" "1280x720@-1075622" QSize(1280, 720) -1.07562e+06 Both of these crash KScreen on Wayland, on X11 none of the modes have negative refresh rates. I'm running this on a VM so I can't be sure if QEMU is reporting the screen modes wrong, or if the problem is in Wayland reading them wrong. (In reply to Yerrey Dev from comment #1) > I believe the issue might be related to some modes having bizarre refresh > rates on Wayland. Running kscreen-console, you can output the modes and on > my system at least 2 of these modes have negative refresh rates: > > "31" "1368x768@-1501773" QSize(1368, 768) -1.50177e+06 > "32" "1280x720@-1075622" QSize(1280, 720) -1.07562e+06 > > Both of these crash KScreen on Wayland, on X11 none of the modes have > negative refresh rates. I'm running this on a VM so I can't be sure if QEMU > is reporting the screen modes wrong, or if the problem is in Wayland reading > them wrong. I run system not on VM. kscreen-console: "0" "1920x1080@60" QSize(1920, 1080) 60.008 "1" "1280x1024@-2026142" QSize(1280, 1024) -2.02614e+06 "2" "1280x800@-1396948" QSize(1280, 800) -1.39695e+06 "3" "1600x900@2058702" QSize(1600, 900) 2.0587e+06 "4" "1368x768@-1501773" QSize(1368, 768) -1.50177e+06 "5" "1280x720@-1075622" QSize(1280, 720) -1.07562e+06 1920x1080 - default 1600x900 - doing nothing other resolutions - crashes The actual KCM crash is caused by https://invent.kde.org/plasma/kscreen/-/blob/master/kcm/output_model.cpp#L396 comparison, where the reported refresh rate is compared with being larger than bestRefreshRate which is 0. When the reported refresh rate is negative, this comparison will never trigger and we'll fail at the Q_ASSERT following right after. A MR to fix the KCM crash would be trivial, but I've yet to figure out the reason of the negative refresh rates. Possibly something to do with libxcvt which was added in https://invent.kde.org/plasma/kwin/-/merge_requests/2235 for Wayland. Could be an upstream bug in that library. I've hit a similar issue when in Plasma 5.25 on NixOS. I don't get the crash, but I do get nonsensical refresh rates, and the mode doesn't actually change. * 3546x2160 - 60Hz (original, good) <-- This is the only mode that the EDID reports * 2560x1600 - 728501Hz * 1920x1200 - 1293352Hz Here's the distro bug report, I can make a new one here if that'd be better: https://github.com/NixOS/nixpkgs/issues/178393 (In reply to Zane from comment #5) > I've hit a similar issue when in Plasma 5.25 on NixOS. I don't get the > crash, but I do get nonsensical refresh rates, and the mode doesn't actually > change. > > * 3546x2160 - 60Hz (original, good) <-- This is the only mode that the EDID > reports > * 2560x1600 - 728501Hz > * 1920x1200 - 1293352Hz > > Here's the distro bug report, I can make a new one here if that'd be better: > https://github.com/NixOS/nixpkgs/issues/178393 That is the same bug, the reason it doesn't crash is because the refresh rate is positive, not negative. It appears that none of the "common modes" added in https://invent.kde.org/plasma/kwin/-/merge_requests/2235 MR work on Wayland, and show up as bizarre high or bizarre negative refresh rates. Don't know if we can ping the original contributor to see if they know better whether it is upstream bug or not. (In reply to Yerrey Dev from comment #6) > (In reply to Zane from comment #5) > > I've hit a similar issue when in Plasma 5.25 on NixOS. I don't get the > > crash, but I do get nonsensical refresh rates, and the mode doesn't actually > > change. > > > > * 3546x2160 - 60Hz (original, good) <-- This is the only mode that the EDID > > reports > > * 2560x1600 - 728501Hz > > * 1920x1200 - 1293352Hz > > > > Here's the distro bug report, I can make a new one here if that'd be better: > > https://github.com/NixOS/nixpkgs/issues/178393 > > That is the same bug, the reason it doesn't crash is because the refresh > rate is positive, not negative. It appears that none of the "common modes" > added in https://invent.kde.org/plasma/kwin/-/merge_requests/2235 MR work on > Wayland, and show up as bizarre high or bizarre negative refresh rates. > Don't know if we can ping the original contributor to see if they know > better whether it is upstream bug or not. Probably the best way is for someone with a GitLab account (i.e. not myself) to create a kwin issue and ping them there. No need, I'm looking into the problem A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2593 Git commit 0c453739b1da4f0e0075fdaf2894e70b17271ef4 by Xaver Hugl. Committed on 29/06/2022 at 18:53. Pushed by zamundaaa into branch 'master'. backends/drm: fix common mode generation The unit for refresh rate was wrong, which caused insanely high as well as negative refresh rates M +2 -2 src/backends/drm/drm_object_connector.cpp M +1 -1 src/backends/drm/drm_object_connector.h https://invent.kde.org/plasma/kwin/commit/0c453739b1da4f0e0075fdaf2894e70b17271ef4 Git commit d4d4a05444e18963359f3fa6fe482ed6a419aa19 by Xaver Hugl. Committed on 30/06/2022 at 01:50. Pushed by zamundaaa into branch 'Plasma/5.25'. backends/drm: fix common mode generation The unit for refresh rate was wrong, which caused insanely high as well as negative refresh rates (cherry picked from commit 0c453739b1da4f0e0075fdaf2894e70b17271ef4) M +2 -2 src/backends/drm/drm_object_connector.cpp M +1 -1 src/backends/drm/drm_object_connector.h https://invent.kde.org/plasma/kwin/commit/d4d4a05444e18963359f3fa6fe482ed6a419aa19 *** Bug 456274 has been marked as a duplicate of this bug. *** Created attachment 150401 [details]
New crash information added by DrKonqi
systemsettings (5.25.2) using Qt 5.15.5
Crashed when setting resolution to 1280x800 on virtual evdi screen.
Looks like the same bug as marked duplicate of, output of kscreen-console seems to confirm:
"4" "1920x1080@60" QSize(1920, 1080) 60
"40" "1280x800@-1396948" QSize(1280, 800) -1.39695e+06
Other strange modes:
"41" "3200x1800@516402" QSize(3200, 1800) 516402
"42" "2880x1620@638536" QSize(2880, 1620) 638536
"43" "1600x900@2058702" QSize(1600, 900) 2.0587e+06
"44" "1368x768@-1501773" QSize(1368, 768) -1.50177e+06
-- Backtrace (Reduced):
#4 0x00007f1b5993b3c4 in KScreen::Mode::id() const () at /usr/lib/libKF5Screen.so.7
[...]
#9 0x00007f1b7dbabbb0 in QV4::QObjectWrapper::setProperty(QV4::ExecutionEngine*, QObject*, QQmlPropertyData*, QV4::Value const&) () at /usr/lib/libQt5Qml.so.5
#10 0x00007f1b7dbac376 in QV4::QObjectWrapper::setQmlProperty(QV4::ExecutionEngine*, QQmlContextData*, QObject*, QV4::String*, QV4::QObjectWrapper::RevisionMode, QV4::Value const&) () at /usr/lib/libQt5Qml.so.5
#11 0x00007f1b7dbaf407 in QV4::QObjectWrapper::virtualPut(QV4::Managed*, QV4::PropertyKey, QV4::Value const&, QV4::Value*) () at /usr/lib/libQt5Qml.so.5
#12 0x00007f1b7db580e5 in QV4::Lookup::setterFallback(QV4::Lookup*, QV4::ExecutionEngine*, QV4::Value&, QV4::Value const&) () at /usr/lib/libQt5Qml.so.5
|