https://bugs.kde.org/show_bug.cgi?id=475733

            Bug ID: 475733
           Summary: Infinite loop in KWin::Placement::placeSmart() on new
                    window
    Classification: Plasma
           Product: kwin
           Version: 5.27.8
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: wayland-generic
          Assignee: kwin-bugs-n...@kde.org
          Reporter: thay...@noraisin.net
  Target Milestone: ---

SUMMARY

Several times today, I've observed an infinite loop in
KWin::Placement::placeSmart() when opening a new application.

That leads to kwin_wayland becoming unresponsive until killed, in a 100% CPU
loop. I think this is the same root issue as bug #407221, but since that was
closed I thought better to file a new bug.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 38 with KDE 5.27.8

When it gets stuck, `KWin::Placement::placeSmart` is spinning in the overall
do/while loop:
`do { ... } while ((overlap != none) && (overlap != h_wrong) && (y <
area.bottom()));`

When it reaches the condition at the end of the loop, `y=1234` and area = `{xp
= 0, yp = 0, w = 2194.2857142857142, h = 1234.2857142857142}`

With the mismatch between integer y and fractional screen height, I think the
root cause is fractional scaling (I have a small 4k display and 175% scaling.

Backtrace:
(gdb) bt
#0  KWin::Placement::placeSmart(KWin::Window*, QRectF const&,
KWin::PlacementPolicy) (this=<optimized out>, area=..., window=<optimized out>)
at /usr/src/debug/kwin-5.27.8-1.fc38.x86_64/src/placement.cpp:201
#1  KWin::Placement::placeSmart(KWin::Window*, QRectF const&,
KWin::PlacementPolicy) (this=<optimized out>, window=<optimized out>, area=...)
at /usr/src/debug/kwin-5.27.8-1.fc38.x86_64/src/placement.cpp:159
#2  0x00007f10dd566e0e in KWin::X11Window::manage(unsigned int, bool)
(this=0x5633e2e12eb0, w=<optimized out>, isMapped=false) at
/usr/src/debug/kwin-5.27.8-1.fc38.x86_64/src/x11window.cpp:757
#3  0x00007f10dd546068 in KWin::Workspace::createX11Window(unsigned int, bool)
(this=0x5633e154d140, windowId=12582920, is_mapped=false) at
/usr/src/debug/kwin-5.27.8-1.fc38.x86_64/src/workspace.cpp:711
#4  0x00007f10dd44c455 in KWin::Workspace::workspaceEvent(xcb_generic_event_t*)
(this=0x5633e154d140, e=0x5633e1bc0120) at
/usr/src/debug/kwin-5.27.8-1.fc38.x86_64/src/events.cpp:215
#5  0x00007f10dbab123c in
QAbstractEventDispatcher::filterNativeEvent(QByteArray const&, void*, long*) ()
at /lib64/libQt5Core.so.5
#6  0x00005633e0a4c0d9 in
KWin::Xwl::Xwayland::dispatchEvents(KWin::Xwl::Xwayland::DispatchEventsMode) ()
#7  0x00007f10dbae8481 in void doActivate<false>(QObject*, int, void**) () at
/lib64/libQt5Core.so.5
#8  0x00007f10dbaeae8d in QSocketNotifier::activated(QSocketDescriptor,
QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () at
/lib64/libQt5Core.so.5
#9  0x00007f10dbaeb6fb in QSocketNotifier::event(QEvent*) () at
/lib64/libQt5Core.so.5
#10 0x00007f10db1aeb75 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
() at /lib64/libQt5Widgets.so.5
#11 0x00007f10dbab41a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
() at /lib64/libQt5Core.so.5
#12 0x00007f10dbb037ff in
QEventDispatcherUNIXPrivate::activateSocketNotifiers() () at
/lib64/libQt5Core.so.5
#13 0x00007f10dbb03b80 in
QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /lib64/libQt5Core.so.5
#14 0x00005633e0b199c2 in
QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
()
#15 0x00007f10dbab2b6b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at
/lib64/libQt5Core.so.5
#16 0x00007f10dbabadfb in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#17 0x00005633e0a32e44 in main ()

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to