Bug 340254 - Default i915 (GL1.4 only) to xrender compositing for segfaults on shader compilation
Summary: Default i915 (GL1.4 only) to xrender compositing for segfaults on shader comp...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.1.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-23 12:11 UTC by Jonathan Riddell
Modified: 2014-11-22 13:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.2


Attachments
LIBGL_DEBUG=verbose glxinfo output and stderr at bottom (10.88 KB, text/plain)
2014-10-24 15:20 UTC, Jonathan Riddell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Riddell 2014-10-23 12:11:51 UTC
Running a live image or on first login in to Kubuntu Plasma 5 I get a crash in KWin on both my netbooks.  This doesn't happen on my more powerful laptops.  Running Plasma 5.1.  Second login has no crash.

    Application: KWin (kwin_x11), signal: Aborted
    Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
    [Current thread is 1 (Thread 0xb1cca740 (LWP 18833))]
     
    Thread 2 (Thread 0xaefffb40 (LWP 18865)):
    #0  0xb771fc7c in __kernel_vsyscall ()
    #1  0xb7645442 in __GI___clock_gettime (clock_id=1, tp=0xaefff0f4) at ../sysdeps/unix/clock_gettime.c:115
    #2  0xb617d288 in ?? () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #3  0xb6356f91 in QTimerInfoList::updateCurrentTime() () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #4  0xb63574a4 in QTimerInfoList::timerWait(timespec&) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #5  0xb6356b08 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #6  0xb62fbcb3 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #7  0xb62fc0fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #8  0xb60d367d in QThread::exec() () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #9  0xb4e8aa7b in ?? () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
    #10 0xb60d891b in ?? () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #11 0xb4b3cf16 in start_thread (arg=0xaefffb40) at pthread_create.c:309
    #12 0xb76379fe in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129
     
    Thread 1 (Thread 0xb1cca740 (LWP 18833)):
    [KCrash Handler]
    #6  0xb771fc7c in __kernel_vsyscall ()
    #7  0xb757a577 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
    #8  0xb757bcf3 in __GI_abort () at abort.c:89
    #9  0xb5018cd3 in gl_provider_resolver (name=name@entry=0xb50664de <entrypoint_strings+21598> "glGetShaderiv", providers=providers@entry=0xb505e63c <providers>, entrypoints=0xb505e638 <entrypoints>) at gl_generated_dispatch.c:7647
    #10 0xb5040867 in epoxy_glGetShaderiv_resolver () at gl_generated_dispatch.c:19252
    #11 epoxy_glGetShaderiv_global_rewrite_ptr (shader=2, pname=35716, params=0xbf90aaa0) at gl_generated_dispatch.c:41335
    #12 0xb50b7b7e in KWin::GLShader::compile(unsigned int, unsigned int, QByteArray const&) const () from /usr/lib/i386-linux-gnu/libkwinglutils.so.5
    #13 0xb50b836a in KWin::GLShader::load(QByteArray const&, QByteArray const&) () from /usr/lib/i386-linux-gnu/libkwinglutils.so.5
    #14 0xb50b6c24 in KWin::GLShader::loadFromFiles(QString const&, QString const&) () from /usr/lib/i386-linux-gnu/libkwinglutils.so.5
    #15 0xb50b7066 in KWin::GLShader::GLShader(QString const&, QString const&, unsigned int) () from /usr/lib/i386-linux-gnu/libkwinglutils.so.5
    #16 0xb50b76fd in KWin::ShaderManager::initShaders() () from /usr/lib/i386-linux-gnu/libkwinglutils.so.5
    #17 0xb50b79ce in KWin::ShaderManager::instance() () from /usr/lib/i386-linux-gnu/libkwinglutils.so.5
    #18 0xb73d3a4e in ?? () from /usr/lib/i386-linux-gnu/libkwin.so.5
    #19 0xb73d3fb2 in ?? () from /usr/lib/i386-linux-gnu/libkwin.so.5
    #20 0xb73b368c in ?? () from /usr/lib/i386-linux-gnu/libkwin.so.5
    #21 0xb73b439b in ?? () from /usr/lib/i386-linux-gnu/libkwin.so.5
    #22 0xb7465b79 in ?? () from /usr/lib/i386-linux-gnu/libkwin.so.5
    #23 0xb632d9c0 in QMetaCallEvent::placeMetaCall(QObject*) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #24 0xb6330c53 in QObject::event(QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #25 0xb6c2ce1a in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
    #26 0xb6c323d1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
    #27 0xb73586ba in KWin::Application::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libkwin.so.5
    #28 0xb62fea9a in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #29 0xb6300cd4 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #30 0xb63569b4 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #31 0xb1a780ff in ?? () from /usr/lib/i386-linux-gnu/qt5/plugins/platforms/libqxcb.so
    #32 0xb62fbcb3 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #33 0xb62fc0fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #34 0xb6304115 in QCoreApplication::exec() () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
    #35 0xb6636b81 in QGuiApplication::exec() () from /usr/lib/i386-linux-gnu/libQt5Gui.so.5
    #36 0xb6c2b1c4 in QApplication::exec() () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
    #37 0xb76fdaef in kdemain () from /usr/lib/i386-linux-gnu/libkdeinit5_kwin_x11.so
    #38 0x08048647 in main ()



Reproducible: Always

Steps to Reproduce:
1. run kubuntu plasma 5 image
2. it'll crash at the start of the plasma session
3.
Comment 1 Martin Flöser 2014-10-23 12:17:23 UTC
Looks like a problem with the GL dispatcher. Are the OpenGL drivers working and setup at all?
Comment 2 Martin Flöser 2014-10-23 12:25:58 UTC
Best attach the output of glxinfo.
Comment 3 Jonathan Riddell 2014-10-23 12:33:16 UTC
Output from glxinfo

http://starsky.19inch.net/~jr/tmp/GLXINFO

and on the command line it says..
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915

which makes me suspicious of the libgl drivers in Ubuntu
Comment 4 Martin Flöser 2014-10-23 12:40:55 UTC
I don't like the "failed to load driver". That sounds very suspicious.

From the output it says that your GPUs only support OpenGL 1.4. We might consider defaulting that one to XRender as it will have problems running GL2. In general it looks like you won't have fun with that hardware and an OpenGL 2 dependent system (QtQuick).
Comment 5 Thomas Lübking 2014-10-23 12:51:07 UTC
$ LIBGL_DEBUG=verbose glxinfo

you'll likely be falling back to swrast for the failure?

Does Ubuntu still ship /usr/lib/xorg/modules/dri/i915_dri.so and does ldd resolve all libs for it?

> Second login has no crash.
Because
a) compositing was disabled?
b) compositing fell back to xrender?
c) opengl and i915_dri.so now magically work?
d) you're running on swrast?

Personally, I can not recommend GL2 on i945
Comment 6 Jonathan Riddell 2014-10-24 15:20:17 UTC
Created attachment 89303 [details]
LIBGL_DEBUG=verbose glxinfo output and stderr at bottom
Comment 7 Jonathan Riddell 2014-10-24 15:22:59 UTC
$ ldd /usr/lib/i386-linux-gnu/dri/i915_dri.so
        linux-gate.so.1 =>  (0xb7774000)
        libdrm_intel.so.1 => /usr/lib/i386-linux-gnu/libdrm_intel.so.1 (0xb7171000)
        libdrm_nouveau.so.2 => /usr/lib/i386-linux-gnu/libdrm_nouveau.so.2 (0xb7169000)
        libdrm_radeon.so.1 => /usr/lib/i386-linux-gnu/libdrm_radeon.so.1 (0xb7159000)
        libdrm.so.2 => /usr/lib/i386-linux-gnu/libdrm.so.2 (0xb714b000)
        libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xb7122000)
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7105000)
        libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7100000)
        libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb700a000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb6fc4000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6e16000)
        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6df8000)
        libpciaccess.so.0 => /usr/lib/i386-linux-gnu/libpciaccess.so.0 (0xb6ded000)
        /lib/ld-linux.so.2 (0xb7777000)
        libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb6dd2000)
Comment 8 Jonathan Riddell 2014-10-24 15:24:40 UTC
i915_dri.so is from package libgl1-mesa-dri 10.3.0-0ubuntu3
Comment 9 Jonathan Riddell 2014-10-24 15:26:09 UTC
It says it has disabled compositing
Comment 10 Thomas Lübking 2014-10-24 15:45:27 UTC
Google says this
> libGL error: Version 4 or later of flush extension not found
> libGL error: failed to load driver: i915
is actually "harmless" (while I'd not consider "error" a good sign for "no harm", glxinfo works) so we're on epoxy shader compilation.

Since it doesn't affect your "more powerful™" machines, i'd however first irrationally blame
a) glamor
b) aurorae (ok, QtQuick ;-)

can you try
a) oxygen decoration (and enable compositing afterwards)
b) sna acceleration instead of glamor?

/etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod"  "sna"
EndSection
Comment 11 Jonathan Riddell 2014-10-24 16:13:28 UTC
I'm using the Oxygen decoration, all other settings are default too on a frash Kubuntu Plasma 5 install with Plasma 5.1.

Adding that file into /etc/X11/xorg.conf.d/20-intel.conf makes no difference, still crash when logging in as a user with no previous login.
Comment 12 Fredrik Höglund 2014-10-29 23:28:28 UTC
The extension list is missing GL_ARB_occlusion_query which is a requirement for OpenGL 2.0.

The source code shows that the driver does enable this extension for your chipset:
http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/i915/intel_extensions.c?h=10.3#n96

which suggests that there is something wrong with your packages.
Comment 13 Jonathan Riddell 2014-11-04 14:28:25 UTC
It's mesa 10.3.2

I see this patch which may be relevant but I'm not experienced enough to say
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/utopic/mesa/utopic/view/head:/debian/patches/i915-dont-default-to-2.1.patch
Comment 14 Fredrik Höglund 2014-11-05 23:13:19 UTC
Yeah, it looks like that patch is responsible for the problem.

There are basically two ways to fix it:

The first is to add code in kwinglutils_funcs.cpp that resolves the ARB_shader_objects functions that are not aliases of core functions to their core equivalents (glGetObjectParameterivARB -> glGetShaderiv etc.).

The second is to make the SceneOpenGL2 constructor fail when OpenGL 2.0 is not supported.
Comment 15 Martin Flöser 2014-11-06 07:43:35 UTC
> The second is to make the SceneOpenGL2 constructor fail when OpenGL 2.0 is
> not supported.

I'd prefer that option. It looks kind of more sane to me as it would properly 
raise the requirement to 2.0.
Comment 16 Fredrik Höglund 2014-11-22 13:22:11 UTC
Git commit 8d059ae2da8f0e3fad63b114cb2ebd6abdd0d4af by Fredrik Höglund.
Committed on 22/11/2014 at 13:19.
Pushed by fredrik into branch 'Plasma/5.1'.

Require OpenGL 2.0 in the SceneOpenGL2 constructor
FIXED-IN: 5.1.2

M  +8    -0    scene_opengl.cpp

http://commits.kde.org/kwin/8d059ae2da8f0e3fad63b114cb2ebd6abdd0d4af