Bug 309415

Summary: kwin crashed after attempting to set display to mirror vertically
Product: [Plasma] kwin Reporter: sparhawk <kdebugs>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Severity: crash CC: endless1239
Priority: NOR    
Version: 4.9.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description sparhawk 2012-11-02 11:03:21 UTC
Application: kwin (4.9.2)
KDE Platform Version: 4.9.2
Qt Version: 4.8.3
Operating System: Linux 3.5.0-17-generic x86_64
Distribution: Ubuntu 12.10

-- Information about the crash:
- What I was doing when the application crashed:

System settings > Hardware > Display and Monitor > Size & Orientation > LVDS1 (Connected) > Orientation.
I changed this from "No Rotation" to "Mirror Vertically". After clicking "Apply", the display flashed, the crash window popped up, and the monitor was the same as before the "change".

The crash can be reproduced every time.

-- Backtrace:
Application: KWin (kwin), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7eff4f336780 (LWP 6350))]

Thread 3 (Thread 0x7eff3ffff700 (LWP 6356)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007eff5f2d9cd7 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#2  0x00007eff5f2d9d09 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#3  0x00007eff573dfe9a in start_thread (arg=0x7eff3ffff700) at pthread_create.c:308
#4  0x00007eff623afcbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7eff328a3700 (LWP 17765)):
#0  0x00007eff623a9023 in select () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007eff5e058023 in qt_safe_select (nfds=20, fdread=0x7eff2c000ac8, fdwrite=0x7eff2c000d60, fdexcept=0x7eff2c000ff8, orig_timeout=0x0) at kernel/qcore_unix.cpp:83
#2  0x00007eff5e05c9e4 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x7eff2c000910, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:223
#3  0x00007eff5e05d572 in QEventDispatcherUNIX::processEvents (this=0x7eff2c0008f0, flags=...) at kernel/qeventdispatcher_unix.cpp:926
#4  0x00007eff5e02b2bf in QEventLoop::processEvents (this=this@entry=0x7eff328a2dd0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007eff5e02b548 in QEventLoop::exec (this=0x7eff328a2dd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007eff5df2cb10 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007eff5e00b9af in QInotifyFileSystemWatcherEngine::run (this=0x1ed0c40) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007eff5df2faec in QThreadPrivate::start (arg=0x1ed0c40) at thread/qthread_unix.cpp:338
#9  0x00007eff573dfe9a in start_thread (arg=0x7eff328a3700) at pthread_create.c:308
#10 0x00007eff623afcbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7eff4f336780 (LWP 6350)):
[KCrash Handler]
#6  brw_update_renderbuffer_surface (brw=0x20a5020, rb=0x206bc40, unit=0) at brw_wm_surface_state.c:1109
#7  0x00007eff4646eaa0 in brw_update_renderbuffer_surfaces (brw=0x20a5020) at brw_wm_surface_state.c:1205
#8  0x00007eff46458ae2 in brw_upload_state (brw=brw@entry=0x20a5020) at brw_state_upload.c:498
#9  0x00007eff464461d7 in brw_try_draw_prims (max_index=5, min_index=3434837352, ib=<optimized out>, nr_prims=<optimized out>, prim=0x7fffccbb7550, arrays=<optimized out>, ctx=0x20a5020) at brw_draw.c:493
#10 brw_draw_prims (ctx=0x20a5020, prim=0x7fffccbb7550, nr_prims=<optimized out>, ib=<optimized out>, index_bounds_valid=<optimized out>, min_index=0, max_index=5, tfb_vertcount=0x0) at brw_draw.c:589
#11 0x00007eff45fc5b54 in vbo_draw_arrays (ctx=0x20a5020, mode=4, start=0, count=6, numInstances=1, baseInstance=<optimized out>) at ../../../../../src/mesa/vbo/vbo_exec_array.c:645
#12 0x00007eff5ed2f89e in KWin::GLVertexBufferPrivate::corePainting (this=0x22a7a10, region=..., primitiveMode=4, hardwareClipping=<optimized out>) at ../../../kwin/libkwineffects/kwinglutils.cpp:1218
#13 0x00007eff5ed2fdbd in KWin::GLVertexBuffer::render (this=this@entry=0x22a6e00, region=..., primitiveMode=primitiveMode@entry=4, hardwareClipping=hardwareClipping@entry=false) at ../../../kwin/libkwineffects/kwinglutils.cpp:1341
#14 0x00007eff5ed2fe41 in KWin::GLVertexBuffer::render (this=0x22a6e00, primitiveMode=4) at ../../../kwin/libkwineffects/kwinglutils.cpp:1333
#15 0x00007eff6273b661 in KWin::SceneOpenGL::paintBackground (this=this@entry=0x1e56770, region=...) at ../../kwin/scene_opengl.cpp:210
#16 0x00007eff6272b270 in KWin::Scene::paintSimpleScreen (this=this@entry=0x1e56770, orig_mask=orig_mask@entry=8, region=...) at ../../kwin/scene.cpp:323
#17 0x00007eff62728ee2 in KWin::Scene::finalPaintScreen (this=0x1e56770, mask=8, region=..., data=...) at ../../kwin/scene.cpp:192
#18 0x00007eff62748463 in KWin::EffectsHandlerImpl::paintScreen (this=0x2368100, mask=mask@entry=8, region=..., data=...) at ../../kwin/effects.cpp:246
#19 0x00007eff60b9bbf7 in KWin::Effect::paintScreen (this=this@entry=0x24e0be0, mask=mask@entry=8, region=..., data=...) at ../../../kwin/libkwineffects/kwineffects.cpp:142
#20 0x00007eff6274840b in KWin::EffectsHandlerImpl::paintScreen (this=0x2368100, mask=8, region=..., data=...) at ../../kwin/effects.cpp:243
#21 0x00007eff6272a52b in KWin::Scene::paintScreen (this=0x1e56770, mask=0x7fffccbb7b6c, region=0x7fffccbb7c10) at ../../kwin/scene.cpp:146
#22 0x00007eff6273f022 in KWin::SceneOpenGL::paint (this=0x1e56770, damage=..., toplevels=...) at ../../kwin/scene_opengl_glx.cpp:481
#23 0x00007eff62724238 in KWin::Workspace::performCompositing (this=0x200a100) at ../../kwin/composite.cpp:440
#24 0x00007eff5e04126c in QObject::event (this=0x200a100, e=<optimized out>) at kernel/qobject.cpp:1157
#25 0x00007eff5d3d3e9c in QApplicationPrivate::notify_helper (this=this@entry=0x1e5ae40, receiver=receiver@entry=0x200a100, e=e@entry=0x7fffccbb82f0) at kernel/qapplication.cpp:4562
#26 0x00007eff5d3d830a in QApplication::notify (this=0x7fffccbb8930, receiver=0x200a100, e=0x7fffccbb82f0) at kernel/qapplication.cpp:4423
#27 0x00007eff61e9e1d6 in KApplication::notify (this=0x7fffccbb8930, receiver=0x200a100, event=0x7fffccbb82f0) at ../../kdeui/kernel/kapplication.cpp:311
#28 0x00007eff5e02c56e in QCoreApplication::notifyInternal (this=0x7fffccbb8930, receiver=0x200a100, event=0x7fffccbb82f0) at kernel/qcoreapplication.cpp:915
#29 0x00007eff5e05d462 in sendEvent (event=0x7fffccbb82f0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#30 QTimerInfoList::activateTimers (this=0x1e5b988) at kernel/qeventdispatcher_unix.cpp:611
#31 0x00007eff5e05d4c0 in QEventDispatcherUNIX::activateTimers (this=this@entry=0x1e06ad0) at kernel/qeventdispatcher_unix.cpp:868
#32 0x00007eff5e05d618 in QEventDispatcherUNIX::processEvents (this=0x1e06ad0, flags=...) at kernel/qeventdispatcher_unix.cpp:930
#33 0x00007eff5d479a3f in QEventDispatcherX11::processEvents (this=0x1e06ad0, flags=...) at kernel/qeventdispatcher_x11.cpp:152
#34 0x00007eff5e02b2bf in QEventLoop::processEvents (this=this@entry=0x7fffccbb8640, flags=...) at kernel/qeventloop.cpp:149
#35 0x00007eff5e02b548 in QEventLoop::exec (this=0x7fffccbb8640, flags=...) at kernel/qeventloop.cpp:204
#36 0x00007eff5e030708 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#37 0x00007eff626dde34 in kdemain (argc=1, argv=0x7fffccbb8a78) at ../../kwin/main.cpp:545
#38 0x00007eff622dd76d in __libc_start_main (main=0x4006a0 <main(int, char**)>, argc=1, ubp_av=0x7fffccbb8a78, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffccbb8a68) at libc-start.c:226
#39 0x00000000004006d1 in _start ()

Possible duplicates by query: bug 307027, bug 306927, bug 306254, bug 304464, bug 304241.

Reported using DrKonqi
Comment 1 Martin Flöser 2012-11-02 11:09:30 UTC
crashes in the driver, not much we can do about that, sorry.

To circumvent the problem press once Alt+Shift+F12 prior to changing the monitor settings. Afterwards you can use the same shortcut again to re-enable compositing.
Comment 2 sparhawk 2012-11-02 11:12:16 UTC
No worries. FWIW, that workaround didn't work for me. It did prevent the crash, but the setting just reverts to "No Rotation" again.
Comment 3 Thomas Lübking 2012-11-02 13:24:47 UTC
bug/defect in driver, bug in libxrandr, bug in the randr kcm or you missed the confirmation dialog.

run "xrandr -o inverted" and see what happens
Comment 4 sparhawk 2012-11-03 00:05:48 UTC
Ah yes, that works fine. Thank you.
Comment 5 Thomas Lübking 2012-11-03 00:13:38 UTC
ok, interesting.
please use "xrandr -q" to determine the exact string of your display (will be sth. around "LVDS1") and use it in
   "xrand --output LVDS1 --rotate inverted"

If that works as well, there might be a bug in the krandr kcm, please file it against that component then (please do not just relable this one, would be too confusing)
Comment 6 sparhawk 2012-11-06 01:17:51 UTC
That does work as well. Should I just replicate the crash then immediately change the component to xrandr?
Comment 7 Thomas Lübking 2012-11-06 01:25:20 UTC
(In reply to comment #6)
> That does work as well. Should I just replicate the crash then immediately
> change the component to xrandr?

No. Do not relabel this bug, but file a new one against krandr, explining in the description what GUI way you attempt to use an fail while flipping with xrandr works.
Also maybe try 90° rotations for the report.
Comment 8 sparhawk 2012-11-06 01:33:03 UTC
Sorry, I was unclear. I meant refile the bug by replicating the crash, then change the component on the new bug.
Comment 9 Thomas Lübking 2012-11-06 06:12:04 UTC
No, the backtrace of kwin is completely irrelevant to the krandr developers.
That's for the moment a problem in the GPU driver (but of course maybe induced by the krandr action if you can perform the xrandr inversion with activated compositing)
Comment 10 sparhawk 2012-11-09 03:08:32 UTC
Thanks. New bug filed against krandr here: https://bugs.kde.org/show_bug.cgi?id=309789
Comment 11 Martin Flöser 2012-11-24 17:21:39 UTC
*** Bug 310612 has been marked as a duplicate of this bug. ***