Bug 244820 - KWin crash when changing desktop effects configuration
Summary: KWin crash when changing desktop effects configuration
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-16 06:53 UTC by Nikos Chantziaras
Modified: 2010-11-13 21:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Chantziaras 2010-07-16 06:53:48 UTC
Application: kwin (4.4.92 (KDE 4.4.92 (KDE 4.5 RC2)))
KDE Platform Version: 4.4.92 (KDE 4.4.92 (KDE 4.5 RC2)) (Compiled from sources)
Qt Version: 4.7.0
Operating System: Linux 2.6.35-rc5 x86_64
Distribution: "Gentoo Base System release 2.0.1"

-- Information about the crash:
In System Settings, when I change some options in the "Advanced" tab of "Desktop Effects" (like changing "VSync" and "direct rendering"), KWin crashes.

Kernel 2.6.35-rc5
xorg-server 1.8.1.902
Latest xf86-video-ati from Git, using DRI2/KMS
Latest Mesa from Git
Latest libdrm from Git

The crash can be reproduced every time.

-- Backtrace:
Application: KWin (kwin), signal: Segmentation fault
[KCrash Handler]
#6  DRI2WireToEvent (dpy=<value optimized out>, event=<value optimized out>, wire=<value optimized out>) at dri2.c:105
#7  0x0000003002444f1e in _XEnq (dpy=<value optimized out>, event=<value optimized out>) at XlibInt.c:2431
#8  0x000000300244ca13 in handle_response (dpy=<value optimized out>, response=<value optimized out>, in_XReply=<value optimized out>) at xcb_io.c:279
#9  0x000000300244cfa0 in _XReply (dpy=<value optimized out>, rep=<value optimized out>, extra=<value optimized out>, discard=<value optimized out>) at xcb_io.c:554
#10 0x00000030024409e2 in XSync (dpy=<value optimized out>, discard=<value optimized out>) at Sync.c:46
#11 0x0000003008c5296f in DRI2DestroyDrawable (dpy=<value optimized out>, drawable=<value optimized out>) at dri2.c:350
#12 0x0000003008c51584 in dri2DestroyDrawable (pdraw=<value optimized out>) at dri2_glx.c:174
#13 0x0000003008c4bab3 in DestroyDRIDrawable (dpy=<value optimized out>, drawable=<value optimized out>, destroy_xdrawable=<value optimized out>) at glx_pbuffer.c:225
#14 0x0000003080ac4dc2 in KWin::SceneOpenGL::Texture::release (this=<value optimized out>) at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92/kwin/scene_opengl.cpp:1009
#15 0x0000003080ac5151 in KWin::SceneOpenGL::Texture::discard (this=<value optimized out>) at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92/kwin/scene_opengl.cpp:999
#16 0x0000003080ac516d in KWin::SceneOpenGL::Window::discardTexture (this=<value optimized out>) at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92/kwin/scene_opengl.cpp:1331
#17 0x0000003080ac5283 in ~Window (this=<value optimized out>, __in_chrg=<value optimized out>) at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92/kwin/scene_opengl.cpp:1304
#18 0x0000003080ac67dc in KWin::SceneOpenGL::windowClosed (this=<value optimized out>, c=<value optimized out>, deleted=<value optimized out>)
    at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92/kwin/scene_opengl.cpp:933
#19 0x0000003080ab30d9 in KWin::Workspace::finishCompositing (this=<value optimized out>) at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92/kwin/composite.cpp:258
#20 0x0000003080ab6489 in KWin::Workspace::fallbackToXRenderCompositing (this=<value optimized out>) at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92/kwin/composite.cpp:301
#21 0x0000003080a36768 in KWin::Workspace::qt_metacall (this=<value optimized out>, _c=<value optimized out>, _id=<value optimized out>, _a=<value optimized out>)
    at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92_build/kwin/workspace.moc:582
#22 0x0000003009f77bbe in QObject::event (this=<value optimized out>, e=<value optimized out>) at kernel/qobject.cpp:1211
#23 0x00000030137b031c in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4389
#24 0x00000030137b5e8d in QApplication::notify (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4270
#25 0x0000003015639c36 in KApplication::notify (this=<value optimized out>, receiver=<value optimized out>, event=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.4.92/work/kdelibs-4.4.92/kdeui/kernel/kapplication.cpp:309
#26 0x0000003009f65f3b in QCoreApplication::notifyInternal (this=<value optimized out>, receiver=<value optimized out>, event=<value optimized out>) at kernel/qcoreapplication.cpp:732
#27 0x0000003009f68e41 in QCoreApplication::sendEvent (receiver=<value optimized out>, event_type=<value optimized out>, data=<value optimized out>) at kernel/qcoreapplication.h:215
#28 QCoreApplicationPrivate::sendPostedEvents (receiver=<value optimized out>, event_type=<value optimized out>, data=<value optimized out>) at kernel/qcoreapplication.cpp:1373
#29 0x0000003013861214 in QCoreApplication::sendPostedEvents (this=<value optimized out>, flags=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#30 QEventDispatcherX11::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventdispatcher_x11.cpp:75
#31 0x0000003009f64c92 in QEventLoop::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:149
#32 0x0000003009f65074 in QEventLoop::exec (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:201
#33 0x0000003009f690cb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#34 0x0000003080a52d8d in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /var/tmp/portage/kde-base/kwin-4.4.92/work/kwin-4.4.92/kwin/main.cpp:531
#35 0x000000300041ebbd in __libc_start_main (main=<value optimized out>, argc=<value optimized out>, ubp_av=<value optimized out>, init=<value optimized out>, fini=<value optimized out>, 
    rtld_fini=<value optimized out>, stack_end=) at libc-start.c:226
#36 0x00000000004006c9 in _start ()

Reported using DrKonqi
Comment 1 Martin Flöser 2010-07-16 17:51:09 UTC
I'm sorry to say, but it is crashing in the OpenGL driver. There is nothing we can do about it. Feel free to report the crash at bugs.freedesktop.org
Comment 2 Thomas Lübking 2010-07-16 18:30:47 UTC
hmmmm...

a) there were at least 2 bugs around this in dri2, one fixed in january, one in april. (but "git" does not mean "stable" at all :-)

b) more interesting for kwin is however line #20 "0x0000003080ab6489 in KWin::Workspace::fallbackToXRenderCompositing" - and why opengl stops working after a context restart
this is probably a driver bug, but doesn't cause the crash

@nikos
a) please try swapping the event dispatcher by runnig either
QT_NO_GLIB=1 kwin --replace &
or
QT_NO_GLIB="" kwin --replace &

and attempt to trigger the crash

(rational: the fallback is called via a 0ms singleshot timer and the invocation bahaviour actually differs with the event dispatcher, maybe this can carry things across the fb swap, bypassing the dri2 bug condition %-\ )

b) run kwin (like above) from a textshell (konsole) and watch the output when attempting to change a relevant setting, maybe there's some useful hint on why GL fails...
Comment 3 Nikos Chantziaras 2010-07-17 01:27:45 UTC
(In reply to comment #2)
> @nikos
> a) please try swapping the event dispatcher by runnig either
> QT_NO_GLIB=1 kwin --replace &
> or
> QT_NO_GLIB="" kwin --replace &
> 
> and attempt to trigger the crash

Trying that crashes kwin immediately and KDE becomes useless since after that kwin keeps crashing and restarting a few times, and after a while compositing gets disabled.
Comment 4 Thomas Lübking 2010-07-17 17:24:17 UTC
ok, sorry but then the driver is far too much broken*, in a far guess, i suspect kms...

*apparently it cannot create a glcontext more than once, tried any opengl games/glxgears?
Comment 5 Simon Lewis 2010-11-13 14:14:15 UTC
I have the same problem on Fedora 12 with KDE SC 4.5.2 installed from KDE-Forge's fc12 stable repo.

Kwin freezes when accepting any changes made to desktop defects options under KDE's system settings.

Is there a work around as I am not sure if the 4.5.3 update will make it into KDE-Forge fc12 repo...?
Comment 6 Thomas Lübking 2010-11-13 15:05:50 UTC
that's probably not the same bug. you likely experience bug #241402 and to workaround, "export LIBGL_ALWAYS_INDIRECT=1" in ~/.xprofile should do, but this was a mesa bug and updating mesa to >= 7.9rc2 should fix it
Comment 7 Simon Lewis 2010-11-13 21:48:32 UTC
(In reply to comment #6)
> that's probably not the same bug. you likely experience bug #241402 and to
> workaround, "export LIBGL_ALWAYS_INDIRECT=1" in ~/.xprofile should do, but this
> was a mesa bug and updating mesa to >= 7.9rc2 should fix it

Hello Thomas

Thanks for your quick reply - I was able to build and install x86_64 rpms for libdrm 2.4.21 and mesa 7.8.2 including a patch for bug #241402

kwin no longer freezes when changing desktop effect options - nice one.

I could not build mesa 7.9.x as you suggested but 7.8.2 with patch seems to work.

Also I noticed that i686 versions of mesa 7.7 are installed - probably during the initial installation - I don't know how to build i686 rpms on his fc12 x86_64 laptop. Anyway everything is working OK my laptop so I guess I will leave it as is for now.

Once again many thanks for your help.

Best regards, Simon