Bug 326321 - Kubuntu 13.10 startup crash
Summary: Kubuntu 13.10 startup crash
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 4.11.2
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2013-10-20 13:02 UTC by Konstantinos Koukos
Modified: 2013-12-20 15:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantinos Koukos 2013-10-20 13:02:56 UTC
Application: kwin (4.11.2)
KDE Platform Version: 4.11.2
Qt Version: 4.8.4
Operating System: Linux 3.11.0-12-generic x86_64
Distribution: Ubuntu 13.10

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

- Unusual behavior I noticed:
The whole Kwin was crashed. No hardware acceleration was provided, cairo-dock run in no-opengl mode. No desktop widgets were visible just a blank screen. System is a Dell Latitude E-6520 with dual graphics running using bumblebee using the default nvidia-319 drivers provided by the distro and the default intel graphics stack.

-- 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 0x7fbaf6dc87c0 (LWP 2081))]

Thread 2 (Thread 0x7fbad6cbb700 (LWP 2083)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fbaf578b06b in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#2  0x00007fbaf578b0a9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#3  0x00007fbaee06ef6e in start_thread (arg=0x7fbad6cbb700) at pthread_create.c:311
#4  0x00007fbaf65999cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7fbaf6dc87c0 (LWP 2081)):
[KCrash Handler]
#6  0x0000000000000000 in ?? ()
#7  0x00007fbaf693ffab in KWin::SceneOpenGL::copyPixels (region=...) at ../../kwin/scene_opengl.cpp:291
#8  0x00007fbaf6948cea in KWin::GlxBackend::present (this=0x23a3540) at ../../kwin/glxbackend.cpp:470
#9  0x00007fbaf6948269 in KWin::GlxBackend::endRenderingFrame (this=0x23a3540, damage=...) at ../../kwin/glxbackend.cpp:516
#10 0x00007fbaf6942d99 in KWin::SceneOpenGL::paint (this=this@entry=0x249c950, damage=..., toplevels=...) at ../../kwin/scene_opengl.cpp:375
#11 0x00007fbaf6943067 in KWin::SceneOpenGL1::paint (this=0x249c950, damage=..., windows=...) at ../../kwin/scene_opengl.cpp:838
#12 0x00007fbaf69284d3 in KWin::Compositor::performCompositing (this=0x249bea0) at ../../kwin/composite.cpp:618
#13 0x00007fbaf08b2be1 in QObject::event (this=0x249bea0, e=<optimized out>) at kernel/qobject.cpp:1156
#14 0x00007fbaefc37dfc in QApplicationPrivate::notify_helper (this=this@entry=0x22e4550, receiver=receiver@entry=0x249bea0, e=e@entry=0x7fffd3e35670) at kernel/qapplication.cpp:4567
#15 0x00007fbaefc3e470 in QApplication::notify (this=this@entry=0x7fffd3e35b40, receiver=receiver@entry=0x249bea0, e=e@entry=0x7fffd3e35670) at kernel/qapplication.cpp:4353
#16 0x00007fbaf51dfa6a in KApplication::notify (this=0x7fffd3e35b40, receiver=0x249bea0, event=0x7fffd3e35670) at ../../kdeui/kernel/kapplication.cpp:311
#17 0x00007fbaf089a8bd in QCoreApplication::notifyInternal (this=0x7fffd3e35b40, receiver=0x249bea0, event=0x7fffd3e35670) at kernel/qcoreapplication.cpp:946
#18 0x00007fbaf08ca403 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#19 QTimerInfoList::activateTimers (this=0x22e51c8) at kernel/qeventdispatcher_unix.cpp:622
#20 0x00007fbaf08ca480 in QEventDispatcherUNIX::activateTimers (this=this@entry=0x22e3bb0) at kernel/qeventdispatcher_unix.cpp:879
#21 0x00007fbaf08cad90 in QEventDispatcherUNIX::processEvents (this=this@entry=0x22e3bb0, flags=...) at kernel/qeventdispatcher_unix.cpp:941
#22 0x00007fbaefcda2f6 in QEventDispatcherX11::processEvents (this=0x22e3bb0, flags=...) at kernel/qeventdispatcher_x11.cpp:152
#23 0x00007fbaf08995ef in QEventLoop::processEvents (this=this@entry=0x7fffd3e359b0, flags=...) at kernel/qeventloop.cpp:149
#24 0x00007fbaf08998e5 in QEventLoop::exec (this=this@entry=0x7fffd3e359b0, flags=...) at kernel/qeventloop.cpp:204
#25 0x00007fbaf089ee5b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#26 0x00007fbaefc3634c in QApplication::exec () at kernel/qapplication.cpp:3828
#27 0x00007fbaf68e2956 in kdemain (argc=1, argv=0x7fffd3e35c88) at ../../kwin/main.cpp:597
#28 0x00007fbaf64c0de5 in __libc_start_main (main=0x4006d0 <main(int, char**)>, argc=1, ubp_av=0x7fffd3e35c88, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffd3e35c78) at libc-start.c:260
#29 0x00000000004006fe in _start ()

Possible duplicates by query: bug 324533.

Reported using DrKonqi
Comment 1 Thomas Lübking 2013-10-20 13:11:26 UTC
> The whole Kwin was crashed.
"kwin" is only the window manager.

> No hardware acceleration was provided, cairo-dock run in no-opengl mode.
Your driver/GL installation is broken because neither the nvidia blob nor the intel drivers would ever cause this render path.

Check "glxinfo" and the contents of "/var/log/Xorg.0.log" and your installed packages.

> No desktop widgets were visible just a blank screen.
Means plasma-desktop crashed as well, but that should be unrelated to this particular crash (yet likely caused by the same broken installation problem)

The particular crash is a bug in kwin, but your actual problem is the broken installation - most notably the proper installation of OpenGL libraries and X11 drivers / kernel modules.

Fixing that will turn the kwin crash into a remote issue for you (you don't want to use that render path anyway, your HW is *much* ahead of it)

*** This bug has been marked as a duplicate of bug 324533 ***
Comment 2 Konstantinos Koukos 2013-10-20 20:24:08 UTC
Thanks a lot,

It seems you are absolutely right. This was an artifact of an upgraded 
installation
from Kubuntu 13.04 to 13.10. I reinstalled bumblebee and both intel and 
nvidia
drivers trying to fix the issue. Although optirun works properly i 
cannot activate
OpenGL compositing (probably using the default Intel DRI) so i am stack 
using
XRender. Probably something remains broken in the OpenGL installation so 
i will
try to find it out.
Thanks a lot,

Best Regards,
Konstantinos.


On 2013-10-20 15:11, Thomas Lübking wrote:
> https://bugs.kde.org/show_bug.cgi?id=326321
>
> Thomas Lübking <thomas.luebking@gmail.com> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|UNCONFIRMED                 |RESOLVED
>           Resolution|---                         |DUPLICATE
>
> --- Comment #1 from Thomas Lübking <thomas.luebking@gmail.com> ---
>> The whole Kwin was crashed.
> "kwin" is only the window manager.
>
>> No hardware acceleration was provided, cairo-dock run in no-opengl mode.
> Your driver/GL installation is broken because neither the nvidia blob nor the
> intel drivers would ever cause this render path.
>
> Check "glxinfo" and the contents of "/var/log/Xorg.0.log" and your installed
> packages.
>
>> No desktop widgets were visible just a blank screen.
> Means plasma-desktop crashed as well, but that should be unrelated to this
> particular crash (yet likely caused by the same broken installation problem)
>
> The particular crash is a bug in kwin, but your actual problem is the broken
> installation - most notably the proper installation of OpenGL libraries and X11
> drivers / kernel modules.
>
> Fixing that will turn the kwin crash into a remote issue for you (you don't
> want to use that render path anyway, your HW is *much* ahead of it)
>
> *** This bug has been marked as a duplicate of bug 324533 ***
>
Comment 3 Thomas Lübking 2013-10-20 20:52:02 UTC
(In reply to comment #2)

> XRender. Probably something remains broken in the OpenGL installation so 
> i will

Mixed usage of MESA and nvidia parts, ie. one driver being loaded but libGL of the other in use or so.
Check /var/log/Xorg.0.log on whether the intel or the nvidia driver is loaded, ensure GLX loaded and then that the resolution for

   ldd `which kwin`| grep libGL

matches that driver (intel, i guess)
Comment 4 Martin Flöser 2013-10-21 14:25:29 UTC
if we see that crash more often before I'm going to ask Kubuntu for an SRU 
with the copy-pixels patch.
Comment 5 Konstantinos Koukos 2013-10-21 16:38:59 UTC
I have managed to reproduce the bug. It doesn't seem to be a KDE problem at all although it causes a kwin crash.

It is problem created by loading the wrong libGL.so.1 in a system with bumblebee and dual graphics cards (Intel HD 3000 and nvidia NVS 4200M). When this version of libGL.so.1:
libGL.so.1 => /usr/lib/nvidia-304/libGL.so.1 (detected using ldd `which kwin`| grep libGL)
is used with the KDE desktop effects enabled at startup and the compositing type is OpenGL with Qt native engine. The bug can be reproduced every time. Only the XRender compositing type is available in KDE settings when nvidia libGL.so. Trying to activate OpenGL acceleration is not allowed in KDE with a message:

Failed to activate desktop effects using the given configuration options. Settings will be reverted to their previous values. Check your X configuration....

When /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 is used (default is the Intel card) then everything is working fine and  OpenGL compositing works great. For some reason after upgrading to Kubuntu 13.10 (which uses KDE 4.11) the default load behavior for kwin is to load /usr/lib/nvidia-304/libGL.so.1 instead of the mesa one. This creates the whole problem.

How can i force kwin to load /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 by default instead of the nvidia? This should permanently solve the problem.

Best Regards,
Konstantinos.
Comment 6 Thomas Lübking 2013-10-21 17:54:49 UTC
/usr/lib/libGL.so and /usr/lib/libGL.so.1 are symbolic links, ensure they point to /usr/lib/x86_64-linux-gnu/mesa/libGL.so resp. /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (check for pot. lib64 paths, i've no idea how Ubuntu organizes them)

optirun should then alter the environment to pre-link the nvidia libGL (and setup some other stuff required to run on the nvidia GPU)
Comment 7 Konstantinos Koukos 2013-10-21 20:23:09 UTC
The explicit creation of /usr/lib/libGL.so and /usr/lib/libGL.so.1 links pointing to mesa libs instead of the nvidia permanently solved the problem. The dynamic change of cards works as long as i have both in the $PATH and so does CUDA and OpenCL. I have tested the config under 3 versions of nvidia driver: 304, 313 and 319. Everything seems to be working fine.
This actually solves a previous bug created by libGL posted here for Kubuntu 13.04:
https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/1240122
Thanks a lot.

Best Regards.
Comment 8 jimyx17 2013-12-20 15:48:53 UTC
Same problem here after update to Kubuntu 13.10. 

The problem is not the libGL location but the ld configuration. After change the config with the following command, everything went perfectly:

update-alternatives --config x86_64-linux-gnu_gl_conf

If you use the i386 version of kubuntu the name might change but it must be something similar.
Comment 9 jimyx17 2013-12-20 15:49:45 UTC
Sorry, I forgot to mention that you have to run ldconfig after change the configuration of ld.
Comment 10 Thomas Lübking 2013-12-20 15:56:06 UTC
This is downstream but the unsupported glBlitFramebuffer() lack (software gl) remains.