could not start ksmserver with nvidia-prime at next login

Bug #1291526 reported by solazs
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
nvidia-prime (Ubuntu)
Fix Released
Critical
Unassigned

Bug Description

Steps to reproduce:
Install nvidia-prime,
select nvidia card using prime-select nvidia,
connect external monitor and try to change the resolution,
log out and log back in,
Could not start ksmserver message pops up.
Works fine with ubuntu, must be a KDE related bug.
The problem is not present when using the intel card.
This bug has been present in 13.10, too.

baloo@LeW-O-Laptop:~$ dpkg -l | grep nvidia
ii nvidia-331 331.49-0ubuntu1~xedgers14.04.3 amd64 NVIDIA binary driver - version 331.49
ii nvidia-libopencl1-331 331.49-0ubuntu1~xedgers14.04.3 amd64 NVIDIA OpenCL Driver and ICD Loader library
ii nvidia-opencl-icd-331 331.49-0ubuntu1~xedgers14.04.3 amd64 NVIDIA OpenCL ICD
ii nvidia-prime 0.6 amd64 Tools to enable NVIDIA's Prime
ii nvidia-settings 331.38-0ubuntu1~xedgers~trusty1 amd64 Tool for configuring the NVIDIA graphics driver
I'm on a Dell N7110.

lsb_release -rd
Description: Ubuntu Trusty Tahr (development branch)
Release: 14.04

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: kdebase-workspace (not installed)
ProcVersionSignature: Ubuntu 3.13.0-17.37-generic 3.13.6
Uname: Linux 3.13.0-17-generic x86_64
ApportVersion: 2.13.3-0ubuntu1
Architecture: amd64
CurrentDesktop: KDE
Date: Wed Mar 12 18:57:25 2014
InstallationDate: Installed on 2014-03-11 (1 days ago)
InstallationMedia: Kubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20140311)
SourcePackage: kde-workspace
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
solazs (solazs) wrote :
Anders (eddiedog988)
Changed in kde-workspace (Ubuntu):
status: New → Confirmed
Revision history for this message
Harald Sitter (apachelogger) wrote :

xorgedgers is not supported unfortunately.

Changed in kde-workspace (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
solazs (solazs) wrote :

Marked as new, because after ppa-purging xorg-edgers, the problem is still present.
baloo@LeW-O-Laptop:~$ dpkg -l | grep nvidia
ii nvidia-331 331.38-0ubuntu4 amd64 NVIDIA binary driver - version 331.38
ii nvidia-libopencl1-331 331.38-0ubuntu4 amd64 NVIDIA OpenCL Driver and ICD Loader library
ii nvidia-opencl-icd-331 331.38-0ubuntu4 amd64 NVIDIA OpenCL ICD
ii nvidia-prime 0.6.1 amd64 Tools to enable NVIDIA's Prime
ii nvidia-settings 331.20-0ubuntu8 amd64 Tool for configuring the NVIDIA graphics driver

Changed in kde-workspace (Ubuntu):
status: Invalid → New
Revision history for this message
Harald Sitter (apachelogger) wrote :

Please login to a fallback sessio or use a tty to get a backtrace with:

gdb ksmserver
run

(it hopefully crashes, and a prompt comes up again - if not, please post the output until then, otherwise run:)

thread apply all bt

and paste the output of that.

Changed in kde-workspace (Ubuntu):
status: New → Incomplete
Revision history for this message
solazs (solazs) wrote :

I've logged in a tty to run gdb, the problem is I can't redirect the output of ksmserver to a file.
I've tried gdb ksmserver, then run 2>&1 > output.txt, but it only outputs a few lines to the output file and prints the rest to the console.
Could you help me with that?
The other thing is, that after restarting ksmserver it does not crash until the next resolution (or monitor alignment) change, but it is still unusable, because one of the displays is off, but the desktop is there, as i can move the mouse there.
I've attached the few outputted lines.

Revision history for this message
solazs (solazs) wrote :
Download full text (5.1 KiB)

I kept trying and apport came up. Got an error while trying to submit to bugs.kde.org, but here is the crash report:
Application: ksmserver (0.4)
KDE Platform Version: 4.12.3
Qt Version: 4.8.6
Operating System: Linux 3.13.0-17-generic x86_64
Distribution: Ubuntu Trusty Tahr (development branch)

-- Information about the crash:
- What I was doing when the application crashed:
trying to log in.
Steps to reproduce:
install nvidia-prime
switch to nvidia card using prime-select nvidia
log out and log back in
I'm on Ubuntu 14.04 x64 and a Dell N7110

The crash can be reproduced every time.

-- Backtrace:
Application: KDE munkamenetkezelő (ksmserver), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[KCrash Handler]
#6 0x00007f1c2265d992 in QObject::connect (sender=0x7f1c229ae920 <QString::shared_null>, signal=signal@entry=0x7f1c266f3446 "2phase2Done()", receiver=receiver@entry=0xc1fb20, method=method@entry=0x7f1c266f3435 "1kcmPhase2Done()", type=type@entry=Qt::AutoConnection) at kernel/qobject.cpp:2546
#7 0x00007f1c266e06e1 in connect (atype=Qt::AutoConnection, amember=0x7f1c266f3435 "1kcmPhase2Done()", asignal=0x7f1c266f3446 "2phase2Done()", asender=<optimized out>, this=0xc1fb20) at /usr/include/qt4/QtCore/qobject.h:339
#8 KSMServer::autoStart2 (this=0xc1fb20) at ../../ksmserver/startup.cpp:396
#9 0x00007f1c266e14fc in KSMServer::tryRestoreNext (this=this@entry=0xc1fb20) at ../../ksmserver/startup.cpp:360
#10 0x00007f1c266e18e8 in KSMServer::autoStart1Done (this=0xc1fb20) at ../../ksmserver/startup.cpp:304
#11 0x00007f1c266d7ef5 in KSMServer::qt_static_metacall (_o=0xc1fb20, _id=644822086, _a=0x7f1c22725346, _c=<optimized out>) at ./server.moc:132
#12 0x00007f1c2265c87a in QMetaObject::activate (sender=0xc29550, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3539
#13 0x00007f1c23ad6905 in OrgKdeKLauncherInterface::qt_static_metacall (_o=0xc5ce50, _id=644822086, _id@entry=1, _a=0x7fff087c99a0, _c=<optimized out>) at ./klauncher_iface.moc:93
#14 0x00007f1c23ad8713 in qt_static_metacall (_a=0x7fff087c99a0, _id=1, _c=QMetaObject::InvokeMetaMethod, _o=0xc29550) at ./klauncher_iface.moc:162
#15 OrgKdeKLauncherInterface::qt_metacall (this=0xc29550, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fff087c99a0) at ./klauncher_iface.moc:163
#16 0x00007f1c229d41f6 in QDBusConnectionPrivate::deliverCall (this=0xab37b0, object=0xc29550, msg=..., metaTypes=..., slotIdx=6) at qdbusintegrator.cpp:951
#17 0x00007f1c22660c1e in QObject::event (this=0xc29550, e=<optimized out>) at kernel/qobject.cpp:1194
#18 0x00007f1c22df4e2c in QApplicationPrivate::notify_helper (this=this@entry=0x9f7980, receiver=receiver@entry=0xc29550, e=e@entry=0xc90da0) at kernel/qapplication.cpp:4567
#19 0x00007f1c22dfb4a0 in QApplication::notify (this=this@entry=0x9e39c0, receiver=receiver@entry=0xc29550, e=e@entry=0xc90da0) at kernel/qapplication.cpp:4353
#20 0x00007f1c25cadb9a in KApplication::notify (this=0x9e39c0, receiver=0xc29550, event=0xc90da0) at ../../kdeui/kernel/kapplication.cpp:311
#21 0x00007f1c226484dd in QCoreApplication::notifyInternal (this=0x9e39c0, receiver=receiver@entry=0xc2...

Read more...

Revision history for this message
solazs (solazs) wrote :

After restarting ksmserver several times I've managed to turn on all displays using xrandr and start plasma-desktop, but The Could not start ksmserver message is still present and if I close it anyhow, X restarts.

Sorry for the multipost!

Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

Well here we are again... This should not happen if you use LightDM as DisplayManager, since it restarts X automatically on logout.

This function should be added to KDM (wouldn't hurt) in Kubuntu. And then be SRU-backported to Precise.

@ solacz: X needs to be restarted BEFORE you login again after you have switched to the other graphics solution (dGPU/iGU).

You can test it out from the login menu. The function has for now to be selected manually from within the login-menu. It's not automated yet.

Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

@ apachelogger:

The cross-reference bug is bug #1262068 "nvidia-prime should support gdm also"

Revision history for this message
solazs (solazs) wrote :

@Flames: yes, i am aware of that. Btw kubuntu does use LightDM as DislpayManager, so the bug you linked does not apply to this case.

Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

O.K. Ecxuse me for beeing on the wrong track ;-)

There seems to be a direct correlation to the xorgedgers-ppa, see also comment#4 in bug #1283353

Please use the ppa-purge command to replace the files from the PPA with the system files..

Revision history for this message
solazs (solazs) wrote :

Yes, i've been told so, see comment#3.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Well, the backtrace seems somewhat improbable my best guess right now is that prime somehow messes with dbus (which would be weird but hey).

The crash appears to not be caused by anything rational though:
    if (kcminitSignals) {
        connect( kcminitSignals, SIGNAL(phase2Done()), SLOT(kcmPhase2Done()));

kcminitSignals is a dbusinterface, it will be null if the interface is invalid after creation, or if kcminitSignals was deleted. so really there is no reason for it to crash there. at all.

Lacking understanding of how exactly a different gpu can cause this I'll move the bug to prime, perhaps someone more knowledable has ideas. To me it seems very random to the point that it may be a symptom of a completely different problem.

affects: kde-workspace (Ubuntu) → nvidia-prime (Ubuntu)
Changed in nvidia-prime (Ubuntu):
status: Incomplete → New
Revision history for this message
solazs (solazs) wrote :

I've kept trying, and with the most recent updates (versions below) logging in is possible (but only with the external monitor connected via HDMI, which is wired to the nvidia card), however KDE seems to forget my prevorious display setup (i think this is why i can log in), but as soon as I try to realign the displays, the could not start ksmserver msg pops up.

baloo@LeW-O-Laptop:~$ dpkg -l | grep nvidia
ii nvidia-331 331.38-0ubuntu5 amd64 NVIDIA binary driver - version 331.38
ii nvidia-libopencl1-331 331.38-0ubuntu5 amd64 NVIDIA OpenCL Driver and ICD Loader library
ii nvidia-opencl-icd-331 331.38-0ubuntu5 amd64 NVIDIA OpenCL ICD
ii nvidia-prime 0.6.1 amd64 Tools to enable NVIDIA's Prime
ii nvidia-settings 331.20-0ubuntu8 amd64 Tool for configuring the NVIDIA graphics driver

I also got a backtrace after a crash, I've attached it.

Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

Looks like bug #1260220 (Greeter and other clients cannot connect to X server) to me.

So if this gets in line again with the next update of LightDM (1.9.12-0ubuntu1), pls advise.

Revision history for this message
Alberto Milone (albertomilone) wrote :

nvidia-prime doesn't use dbus, not directly at least (it can use policykit on demand)

What I see from the backtrace is that ksmserver gets an _XIOError, which I assume ksmserver handles with its own Xio_ErrorHandler(). Returning from the error handler causes ksmserver to exit. If you want to get around this, you can either use xcb (instead of xlib), or do what they suggest here:
http://lists.x.org/archives/xorg-devel/2010-July/011539.html

Revision history for this message
Alberto Milone (albertomilone) wrote :

Please reassign to whatever package ksmserver belongs to.

Changed in nvidia-prime (Ubuntu):
status: New → Incomplete
status: Incomplete → Invalid
solazs (solazs)
affects: nvidia-prime (Ubuntu) → kdebase-workspace (Ubuntu)
Changed in kdebase-workspace (Ubuntu):
status: Invalid → Incomplete
solazs (solazs)
Changed in kdebase-workspace (Ubuntu):
status: Incomplete → New
Revision history for this message
solazs (solazs) wrote :

The bug is still present with the newest lightdm.
This is not bug #1260220, because the crash always happens upon realigning the displays.

Revision history for this message
solazs (solazs) wrote :

Installed a lot of updates, including the nvidia driver, but the but is still there.
I've just noticed, ksmserver crashes upon disabling a display, too.
Versions:
ii liblightdm-gobject-1-0 1.9.12-0ubuntu1 amd64 LightDM GObject client library
ii liblightdm-qt-3-0 1.9.12-0ubuntu1 amd64 LightDM Qt client library
ii lightdm 1.9.12-0ubuntu1 amd64 Display Manager
ii lightdm-kde-greeter 0.3.2.2-0ubuntu1 amd64 LightDM KDE greeter
ii nvidia-331 331.38-0ubuntu6 amd64 NVIDIA binary driver - version 331.38
ii nvidia-libopencl1-331 331.38-0ubuntu6 amd64 NVIDIA OpenCL Driver and ICD Loader library
ii nvidia-opencl-icd-331 331.38-0ubuntu6 amd64 NVIDIA OpenCL ICD
ii nvidia-prime 0.6.1 amd64 Tools to enable NVIDIA's Prime
ii nvidia-settings 331.20-0ubuntu8 amd64 Tool for configuring the NVIDIA graphics driver

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kdebase-workspace (Ubuntu):
status: New → Confirmed
Revision history for this message
Harald Sitter (apachelogger) wrote :

Moving to nvidia-prime again because I have absolutely no idea what to do.

Yes, ksmserver crashes in the XIO errorhandler, the handler is from kdelibs and meant to attempt a cleanup to prevent data loss. The problem is not that it crashes, the problem is that it gets an XIO error with prime, while it does not get one without it (i.e. because it does not crash - even if it did manage a cleanup before exiting it would still result in a defunct session as KSMServer does the session management)..

affects: kdebase-workspace (Ubuntu) → nvidia-prime (Ubuntu)
Revision history for this message
Xavier Gnata (xavier-gnata-gmail) wrote :

It makes nvidia-prime pretty much useless on my box.
I'm not an Xorg expert but if you have any idea/patch I would be happy to help to test it.

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

It renders the system temporarily or permanently unusable.

Changed in nvidia-prime (Ubuntu):
importance: Undecided → Critical
status: Confirmed → Triaged
Revision history for this message
solazs (solazs) wrote :

Upgraded everything, nothing's changed.
Versions:
$ dpkg -l | grep lightdm
ii liblightdm-gobject-1-0 1.9.14-0ubuntu2 amd64 LightDM GObject client library
ii liblightdm-qt-3-0 1.9.14-0ubuntu2 amd64 LightDM Qt client library
ii lightdm 1.9.14-0ubuntu2 amd64 Display Manager
ii lightdm-kde-greeter 0.3.2.2-0ubuntu1 amd64 LightDM KDE greeter
$ dpkg -l | grep nvidia
ii nvidia-331 331.38-0ubuntu7 amd64 NVIDIA binary driver - version 331.38
ii nvidia-libopencl1-331 331.38-0ubuntu7 amd64 NVIDIA OpenCL Driver and ICD Loader library
ii nvidia-opencl-icd-331 331.38-0ubuntu7 amd64 NVIDIA OpenCL ICD
ii nvidia-prime 0.6.2 amd64 Tools to enable NVIDIA's Prime
ii nvidia-settings 331.20-0ubuntu8 amd64 Tool for configuring the NVIDIA graphics driver

Revision history for this message
solazs (solazs) wrote :

This bug seems partially fixed by today's update, which included kde-workspace and kdebase.
The only problem is, that kubuntu now sees the 2 displays as one (panels run along both displays instead of one and the desktop area is a rectangle, wich is wrong, because i have 2 different sized displays, so there is an out-of-display area, where i can move windows or the cursor, but can not see what's in there. I believe this is a different bug, so if this bug is fixed at everyone, it should be closed.

Revision history for this message
Xavier Gnata (xavier-gnata-gmail) wrote :

I also have 2 different sized displays but the bug is still there on my up to date box today.

Revision history for this message
Xavier Gnata (xavier-gnata-gmail) wrote :

It looks now ok on my box.
I cannot tell in which update the "fix" was.

Changed in nvidia-prime (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

In accordance wt comment #27 this bug got closed somewhere else.

Thanks for reporting Xavier. Hope you still have fun with Kubuntu. Enjoy it! (like me)

Revision history for this message
giacof (giacof) wrote :

This was NOT fixed to me: I'm having a very similar issue (see https://bugs.launchpad.net/ubuntu/+source/nvidia-prime/+bug/1370725)

Please consider reopening this bug in case mine is marked as a duplicate!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.