Bug 276860

Summary: KWin crashed after nvidia driver installed
Product: [Plasma] kwin Reporter: progopis
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description progopis 2011-06-30 21:46:32 UTC
Application: kwin (4.6.2 (4.6.2))
KDE Platform Version: 4.6.2 (4.6.2)
Qt Version: 4.7.2
Operating System: Linux 2.6.38-8-generic x86_64
Distribution: Ubuntu 11.04

-- Information about the crash:
I've installed  package for support NVIDIA driver on dual card laptop (INTEL and NVIDIA). After restart Desktop Effects turned on and crash window appeared.

-- Backtrace:
Application: KWin (kwin), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fe84fa447a0 (LWP 2147))]

Thread 3 (Thread 0x7fe82ffff700 (LWP 2184)):
#0  0x00007fe84f297143 in select () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007fe84b67532c in qt_safe_select (nfds=15, fdread=0x33dc0b0, fdwrite=0x33dc348, fdexcept=0x33dc5e0, orig_timeout=<value optimized out>) at kernel/qcore_unix.cpp:82
#2  0x00007fe84b67a3d0 in QEventDispatcherUNIXPrivate::doSelect (this=0x33dbef0, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:219
#3  0x00007fe84b67b04a in QEventDispatcherUNIX::processEvents (this=0x33f0d90, flags=...) at kernel/qeventdispatcher_unix.cpp:919
#4  0x00007fe84b64c882 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fe84b64cabc in QEventLoop::exec (this=0x7fe82fffedb0, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007fe84b563924 in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:492
#7  0x00007fe84b62ec2f in QInotifyFileSystemWatcherEngine::run (this=0x33db040) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007fe84b566175 in QThreadPrivate::start (arg=0x33db040) at thread/qthread_unix.cpp:320
#9  0x00007fe845c59d8c in start_thread (arg=0x7fe82ffff700) at pthread_create.c:304
#10 0x00007fe84f29f04d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fe82f7fe700 (LWP 2192)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fe84e0fe2a2 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x7fe84e417180) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2  0x00007fe84e0fe2d9 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=0x7fe84e425254) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3  0x00007fe845c59d8c in start_thread (arg=0x7fe82f7fe700) at pthread_create.c:304
#4  0x00007fe84f29f04d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fe84fa447a0 (LWP 2147)):
[KCrash Handler]
#6  intel_region_buffer (intel=0x4589040, region=0x0, flag=2) at intel_regions.c:514
#7  0x00007fe8371286c2 in intelClearWithBlit (ctx=0x4589040, mask=2) at intel_blit.c:262
#8  0x00007fe83712ad2a in intelClear (ctx=0x4589040, mask=2) at intel_clear.c:177
#9  0x00007fe84f615ce7 in KWin::SceneOpenGL::paintBackground (this=<value optimized out>, region=<value optimized out>) at ../../kwin/scene_opengl.cpp:921
#10 0x00007fe84f60d88f in KWin::Scene::paintGenericScreen (this=0x2fb55e0, orig_mask=32) at ../../kwin/scene.cpp:188
#11 0x00007fe84f60ac7a in KWin::Scene::finalPaintScreen (this=0x2fb55e0, mask=32, region=<value optimized out>, data=<value optimized out>) at ../../kwin/scene.cpp:178
#12 0x00007fe84f628f19 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=32, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:173
#13 0x00007fe8360e65a6 in KWin::StartupFeedbackEffect::paintScreen (this=0x456efb0, mask=32, region=<value optimized out>, data=...) at ../../../kwin/effects/startupfeedback/startupfeedback.cpp:166
#14 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=32, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#15 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=32, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#16 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=32, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#17 0x00007fe83608d44d in KWin::LogoutEffect::paintScreen (this=0x2e6f180, mask=32, region=..., data=...) at ../../../kwin/effects/logout/logout.cpp:207
#18 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=32, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#19 0x00007fe8360a857b in KWin::ShadowEffect::paintScreen (this=0x30886b0, mask=32, region=..., data=...) at ../../../kwin/effects/shadow/shadow.cpp:189
#20 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=32, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#21 0x00007fe8360bae68 in KWin::BlurEffect::paintScreen (this=<value optimized out>, mask=32, region=..., data=...) at ../../../kwin/effects/blur/blur.cpp:230
#22 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#23 0x00007fe836091fbd in KWin::PresentWindowsEffect::paintScreen (this=0x467dbc0, mask=0, region=..., data=...) at ../../../kwin/effects/presentwindows/presentwindows.cpp:205
#24 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#25 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#26 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#27 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#28 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#29 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#30 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#31 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#32 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#33 0x00007fe836079365 in KWin::DesktopGridEffect::paintScreen (this=0x302c9f0, mask=0, region=..., data=...) at ../../../kwin/effects/desktopgrid/desktopgrid.cpp:155
#34 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#35 0x00007fe8360aeb8f in KWin::SlideEffect::paintScreen (this=<value optimized out>, mask=0, region=..., data=...) at ../../../kwin/effects/slide/slide.cpp:86
#36 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#37 0x00007fe836072bad in KWin::BoxSwitchEffect::paintScreen (this=0x2e54e30, mask=0, region=..., data=...) at ../../../kwin/effects/boxswitch/boxswitch.cpp:143
#38 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#39 0x00007fe8360c9256 in KWin::CubeEffect::paintScreen (this=<value optimized out>, mask=0, region=..., data=...) at ../../../kwin/effects/cube/cube.cpp:698
#40 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#41 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#42 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#43 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#44 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#45 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#46 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#47 0x00007fe8360c1d86 in KWin::CoverSwitchEffect::paintScreen (this=0x456ee80, mask=0, region=..., data=...) at ../../../kwin/effects/coverswitch/coverswitch.cpp:126
#48 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#49 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#50 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#51 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#52 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#53 0x00007fe84d6e8a18 in KWin::Effect::paintScreen (this=<value optimized out>, mask=0, region=<value optimized out>, data=...) at ../../../kwin/lib/kwineffects.cpp:227
#54 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#55 0x00007fe8360b839b in KWin::ZoomEffect::paintScreen (this=0x4586510, mask=0, region=..., data=...) at ../../../kwin/effects/zoom/zoom.cpp:341
#56 0x00007fe84f628fa3 in KWin::EffectsHandlerImpl::paintScreen (this=0x3206040, mask=0, region=<value optimized out>, data=...) at ../../kwin/effects.cpp:169
#57 0x00007fe84f60d0af in KWin::Scene::paintScreen (this=0x2fb55e0, mask=0x7fff53fffb6c, region=0x7fff53fffc50) at ../../kwin/scene.cpp:137
#58 0x00007fe84f620ef3 in KWin::SceneOpenGL::paint (this=0x2fb55e0, damage=..., toplevels=<value optimized out>) at ../../kwin/scene_opengl.cpp:772
#59 0x00007fe84f608275 in KWin::Workspace::performCompositing (this=0x7fe830353bb0) at ../../kwin/composite.cpp:442
#60 0x00007fe84b6611c9 in QObject::event (this=0x7fe830353bb0, e=<value optimized out>) at kernel/qobject.cpp:1190
#61 0x00007fe84aa0e9e4 in QApplicationPrivate::notify_helper (this=0x1d67470, receiver=0x7fe830353bb0, e=0x7fff540003c0) at kernel/qapplication.cpp:4462
#62 0x00007fe84aa133aa in QApplication::notify (this=<value optimized out>, receiver=0x7fe830353bb0, e=0x7fff540003c0) at kernel/qapplication.cpp:4341
#63 0x00007fe84ed9a866 in KApplication::notify (this=0x7fff540007c0, receiver=0x7fe830353bb0, event=0x7fff540003c0) at ../../kdeui/kernel/kapplication.cpp:311
#64 0x00007fe84b64d49c in QCoreApplication::notifyInternal (this=0x7fff540007c0, receiver=0x7fe830353bb0, event=0x7fff540003c0) at kernel/qcoreapplication.cpp:731
#65 0x00007fe84b67af12 in sendEvent (this=0x1d693d0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#66 QTimerInfoList::activateTimers (this=0x1d693d0) at kernel/qeventdispatcher_unix.cpp:604
#67 0x00007fe84b67b05b in QEventDispatcherUNIX::processEvents (this=0x1d0c340, flags=...) at kernel/qeventdispatcher_unix.cpp:923
#68 0x00007fe84aab6c0c in QEventDispatcherX11::processEvents (this=0x1d0c340, flags=...) at kernel/qeventdispatcher_x11.cpp:152
#69 0x00007fe84b64c882 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#70 0x00007fe84b64cabc in QEventLoop::exec (this=0x7fff54000700, flags=...) at kernel/qeventloop.cpp:201
#71 0x00007fe84b650ecb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#72 0x00007fe84f5a61ec in kdemain (argc=<value optimized out>, argv=0x7fff54000e58) at ../../kwin/main.cpp:542
#73 0x00007fe84f1d7eff in __libc_start_main (main=0x400740 <main(int, char**)>, argc=3, ubp_av=0x7fff54000e58, init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fff54000e48) at libc-start.c:226
#74 0x0000000000400669 in _start ()

This bug may be a duplicate of or related to bug 252817.

Possible duplicates by query: bug 276797, bug 276695, bug 276588, bug 276484, bug 276152.

Reported using DrKonqi
Comment 1 Thomas Lübking 2011-06-30 21:55:22 UTC
This is a crash in the intel driver.
The nvidia driver is NOT in use here.

The intel bug is not related to the nvidia GPU and can be worked around by omitting fullscreen window unredirection (see dupe).

To enforce the nvidia driver consult "man xorg.conf" or use the nvidia shellscript to generate a valid X11 configuration.

Afaik "Optimus" is NOT supported on Linux.

*** This bug has been marked as a duplicate of bug 252817 ***
Comment 2 progopis 2011-07-01 05:52:06 UTC
>Afaik "Optimus" is NOT supported on Linux.

Ok, sir. But where did you seen in my message, that "Optimus" is turned on? NVIDIA has no own engine for output. NVIDIA chip works with Intel together, because NVIDIA is just works as accelerator for Intel (special mobile version with 'M' letter in the name of model). My current configuration is not Optimus, because it is based on a dynamic switching video cores, depending on conditions, while I have both cores are working all the time. I tried run desktop effects on Intel hardware without NVIDIA and it ended in failure. I installed 'bumblebee' special package and desktop effects will turn on automatically.

Also, it's not possible for xorg switch video device by configuring xorg.conf. X server can not switch between graphics cards with Optimus scheme. Just look here:

xorg.conf:
...
Section "Device"
    Identifier     "Device0"
    Driver         "intel"
    VendorName     "Intel GMA 3150"
    BusID       "PCI:0:2:0"
EndSection
...

This is the only section 'Device' in my xorg.conf. Nothing about NVIDIA (but you can not just replace the parameters BusID and Driver, as well as set IsolateDevice to enable NVIDIA). Now look here:

lsmod | grep -i -P "nv|i915"
nvidia              10718100  0 
i915                  514985  5 
drm_kms_helper         42136  1 i915
drm                   227495  6 i915,drm_kms_helper
i2c_algo_bit           13400  1 i915
video                  19438  1 i915

Both drivers loaded and works. Unfortunately this is a "hack", so that even the nvidia-config "thinks" that the NVIDIA driver is not used. Also I will try '/usr/local/bin/bumblebee-disablecard' script and report if it becomes known anything else.
Comment 3 Thomas Lübking 2011-07-01 15:22:49 UTC
(In reply to comment #2)
> Ok, sir. But where did you seen in my message, that "Optimus" is turned on?
Nowhere, was just a general comment that such attempts likely won't work (the naive way).

I'm not exactly sure how the bumblebee thing will work (pipe the nvidia output through the intel framebuffer *shrug*) but it ships a script to run applications accelerated which will likely preload the proper GL libraby.
So you must use "optirun kwin --replace &" in order to use the nvidia gpu in this context at all.

However, if you intend to use the window manager on top of the nvidia GPU, there's really no point in keeping the intel chip in use (in case the nvidia chip has access to some video out adapter) so you'd likely just want to configure a device for the nvidia chip, connect it to one or the screen for your server and you're done.

Some misconceptions:
----------
> Both drivers loaded and works. 
No, both kernel modules are loaded, that's not the same, nor a big deal (since they operate on different HW - show me an lsmod with nouveau and nvidia and i'm impressed ;-)
It has NO implications on the X11 server nor on the used (default) OpenGL librabry.
The kernel module resides in /lib/modules/2.6.39-ARCH/kernel/drivers/video/ and the xorg "driver" in /usr/lib/xorg/modules/drivers/
Despite the nvidia kernel module is merely a wrapper around the prop. driver, they are NOT THE SAME.

> nvidia-config "thinks" that the NVIDIA driver is not used.
Because it is not. That is no misassumption on the SW side.
Your GL lib probably links to the mesa variant which would not work with the nvidia driver even if that was configured to be used.
Just the fact that the kernel module is loaded means absolutely nothing in this regard.