Bug 319848

Summary: Crash when disconnecting monitor
Product: [Plasma] kwin Reporter: Aleix Pol <aleixpol>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash Keywords: drkonqi
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.11
Sentry Crash Report:

Description Aleix Pol 2013-05-14 22:17:54 UTC
Application: kwin (4.10.60)
KDE Platform Version: 4.10.60 (Compiled from sources)
Qt Version: 4.8.4
Operating System: Linux 3.8.4-1-ARCH x86_64
Distribution: "Arch Linux"

-- Information about the crash:
- What I was doing when the application crashed:
When I unplug the VGA cable (and have the desktop resized using kscreen) I get this crash sometimes.

I'm unsure what further information to provide.

The crash can be reproduced sometimes.

-- Backtrace:
Application: KWin (kwin), signal: Aborted
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f27ac591780 (LWP 13513))]

Thread 2 (Thread 0x7f278ed07700 (LWP 13535)):
#0  0x00007f27a62788b4 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f27ab4c5f6b in ?? () from /usr/lib/libQtScript.so.4
#2  0x00007f27ab4c5fa9 in ?? () from /usr/lib/libQtScript.so.4
#3  0x00007f27a6274dd2 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007f27a422aced in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7f27ac591780 (LWP 13513)):
[KCrash Handler]
#6  0x00007f27a417a1c9 in raise () from /usr/lib/libc.so.6
#7  0x00007f27a417b5c8 in abort () from /usr/lib/libc.so.6
#8  0x00007f27a64f98df in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
#9  0x00007f27a64f9a69 in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f27a64fa274 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
#11 0x00007f27ac04688b in QVector<QMap<KWin::Group*, KWin::Layer> >::operator[] (this=0x7fffac01d990, i=1) at /usr/include/qt4/QtCore/qvector.h:359
#12 0x00007f27ac044a6f in KWin::Workspace::constrainedStackingOrder (this=0x2131cb0) at /home/kde-devel/src/kde-workspace/kwin/layers.cpp:521
#13 0x00007f27ac043180 in KWin::Workspace::updateStackingOrder (this=0x2131cb0, propagate_new_clients=false) at /home/kde-devel/src/kde-workspace/kwin/layers.cpp:125
#14 0x00007f27ac08cd14 in KWin::Client::setGeometry (this=0x2216f10, x=0, y=0, w=1680, h=1050, force=KWin::NormalGeometrySet) at /home/kde-devel/src/kde-workspace/kwin/geometry.cpp:1930
#15 0x00007f27ac0193a2 in KWin::Client::setGeometry (this=0x2216f10, r=..., force=KWin::NormalGeometrySet) at /home/kde-devel/src/kde-workspace/kwin/client.h:1209
#16 0x00007f27ac08df22 in KWin::Client::blockGeometryUpdates (this=0x2216f10, block=false) at /home/kde-devel/src/kde-workspace/kwin/geometry.cpp:2077
#17 0x00007f27ac01915e in KWin::GeometryUpdatesBlocker::~GeometryUpdatesBlocker (this=0x7fffac01de40, __in_chrg=<optimized out>) at /home/kde-devel/src/kde-workspace/kwin/client.h:1007
#18 0x00007f27ac08f638 in KWin::Client::changeMaximize (this=0x2216f10, vertical=false, horizontal=false, adjust=true) at /home/kde-devel/src/kde-workspace/kwin/geometry.cpp:2337
#19 0x00007f27ac087295 in KWin::Client::checkWorkspacePosition (this=0x2216f10, oldGeometry=..., oldDesktop=1) at /home/kde-devel/src/kde-workspace/kwin/geometry.cpp:1054
#20 0x00007f27ac08283e in KWin::Workspace::updateClientArea (this=0x2131cb0, force=false) at /home/kde-devel/src/kde-workspace/kwin/geometry.cpp:240
#21 0x00007f27ac082a31 in KWin::Workspace::updateClientArea (this=0x2131cb0) at /home/kde-devel/src/kde-workspace/kwin/geometry.cpp:254
#22 0x00007f27ac081c52 in KWin::Workspace::desktopResized (this=0x2131cb0) at /home/kde-devel/src/kde-workspace/kwin/geometry.cpp:82
#23 0x00007f27ac01719e in KWin::Workspace::qt_static_metacall (_o=0x2131cb0, _c=QMetaObject::InvokeMetaMethod, _id=77, _a=0x7fffac01ea50) at kwin/workspace.moc:279
#24 0x00007f27a66178ec in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#25 0x00007f27ac00d6db in KWin::Screens::changed (this=0x2141690) at kwin/moc_screens.cpp:161
#26 0x00007f27ac00d3e7 in KWin::Screens::qt_static_metacall (_o=0x2141690, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x26f4570) at kwin/moc_screens.cpp:71
#27 0x00007f27a661bc5e in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#28 0x00007f27a578d0ac in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#29 0x00007f27a5793670 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#30 0x00007f27a73bb9ab in KApplication::notify (this=0x7fffac01f2d0, receiver=0x2141690, event=0x275c980) at /home/kde-devel/src/kdelibs/kdeui/kernel/kapplication.cpp:311
#31 0x00007f27ac049be6 in KWin::Application::notify (this=0x7fffac01f2d0, o=0x2141690, e=0x275c980) at /home/kde-devel/src/kde-workspace/kwin/main.cpp:423
#32 0x00007f27a6603c3d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#33 0x00007f27a6606c8f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#34 0x00007f27a582a7dc in ?? () from /usr/lib/libQtGui.so.4
#35 0x00007f27a660296f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#36 0x00007f27a6602c65 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#37 0x00007f27a6607ccb in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#38 0x00007f27ac04ad30 in kdemain (argc=2, argv=0x7fffac01f918) at /home/kde-devel/src/kde-workspace/kwin/main.cpp:591
#39 0x0000000000400a82 in main (argc=2, argv=0x7fffac01f918) at kwin/kwin_dummy.cpp:3

Reported using DrKonqi
Comment 1 Martin Flöser 2013-05-15 06:07:36 UTC
I assume you use KScreen, right?

which git commit do you use for kde-workspace?

@Thomas: did you already merge the one commit? Would it fix this issue?
Comment 2 Thomas Lübking 2013-05-15 08:05:37 UTC
no & yes.
sorry for the delay.
Comment 3 Aleix Pol 2013-05-15 10:33:50 UTC
That's the version I have compiled:
d0c465841a7938f4cabc81f8dc66d68dc64b4cac
Comment 4 Aleix Pol 2013-05-15 10:34:28 UTC
You don't assume I use KScreen, I said it in #0 ;)

I do use KScreen
Comment 5 Thomas Lübking 2013-05-15 13:21:01 UTC
KScreen doesn't really matter - i can trigger that by an xrandr shortcut.
You need https://git.reviewboard.kde.org/r/110385/ - i'll push it tonight.
Comment 6 Thomas Lübking 2013-05-15 20:39:13 UTC
Git commit 94f501fbfa070293c051b40934681d3b0d902a94 by Thomas Lübking.
Committed on 10/05/2013 at 22:03.
Pushed by luebking into branch 'master'.

connect toplevel to in-loop screenCount() signal

required because Screens::changed is emitted queued in case of timer shortcut
since a direct signal would cause problems on screen resizes (or rotations,
for that matter) since at that time QDesktopWidget::screenGeometry(int) -xrandr-
is updated, but QDesktopWidget::screen(int)->geometry() (root window) is NOT,
resulting in an invalid value in geometry.cpp/Workspace::desktopResiized(),
thus a "capped" overlay window

However, w/o the count updated we re-encounter what RR 110119 was supposed to fixed
in the first place ...

REVIEW: 110385
FIXED-IN: 4.11

M  +1    -0    kwin/toplevel.cpp

http://commits.kde.org/kde-workspace/94f501fbfa070293c051b40934681d3b0d902a94