kdm does not restart X server (that crashed on logout)

Bug #432521 reported by Achim Bohnet on 2009-09-18
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
xf86-video-intel
Fix Released
Medium
kdebase-workspace (Ubuntu)
High
Unassigned
Karmic
High
Unassigned
xserver-xorg-video-intel (Ubuntu)
High
Unassigned
Karmic
High
Unassigned

Bug Description

Binary package hint: kdm

Problem:
Intel gfx driver crashes on logout (see LP #432509) from KDE session.
User does not get a login screen again. Instead the screen is a black screen
and Alt-F1,2,3, etc show now effect, screen still completely black.
ps output shows that no X server is running.
Bug is that kdm does not start a new X server

Hack/Workaround:
remote login and running:

  service kdm reload

gives a shiny now login screen.

Configuration detail see apport attachment in https://bugs.launchpad.net/ubuntu/+bug/432509

Tail of End of session and Head of Start of session kdm.log snippet:

...
Backtrace:
0: /usr/bin/X(xorg_backtrace+0x26) [0x4f0086]
1: /usr/bin/X(xf86SigHandler+0x41) [0x485091]
2: /lib/libc.so.6 [0x7f4611750530]
3: /usr/lib/libdrm_intel.so.1(drm_intel_bo_alloc+0) [0x7f460fd288e0]
4: /usr/lib/xorg/modules/drivers//intel_drv.so(i830_allocate_memory+0x24a) [0x7f460ff6495a]
5: /usr/lib/xorg/modules/drivers//intel_drv.so(i830_allocate_2d_memory+0xb4) [0x7f460ff65274]
6: /usr/lib/xorg/modules/drivers//intel_drv.so [0x7f460ff5afa7]
7: /usr/lib/xorg/modules/drivers//intel_drv.so [0x7f460ff5f420]
8: /usr/bin/X(AddScreen+0x1d4) [0x4336e4]
9: /usr/bin/X(InitOutput+0x76f) [0x46efdf]
10: /usr/bin/X(main+0x1fe) [0x433dee]
11: /lib/libc.so.6(__libc_start_main+0xfd) [0x7f461173babd]
12: /usr/bin/X [0x433429]
Saw signal 11. Server aborting.

X.Org X Server 1.6.3
Release Date: 2009-7-31
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.24-23-server x86_64 Ubuntu
Current Operating System: Linux alleehol 2.6.31-10-generic #34-Ubuntu SMP Wed Sep 16 01:09:15 UTC 2009 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.31-10-generic root=UUID=c81e0cef-ccb2-4fb0-9d11-02e85ba75a4c ro quiet splash
Build Date: 09 September 2009 12:45:08AM
xorg-server 2:1.6.3-1ubuntu6 (<email address hidden>)
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
...

Achim

Jonathan Thomas (echidnaman) wrote :

KDM, as an X application, goes down along with the X server. So if KDM is not running I think it's a bit much to expect it to restart X ;-)

Achim Bohnet (allee) wrote :

Hi Jonathan,
that a common prejudice: kdm runs fine without X and even without a gfx card, e.g. on a mulituser server, kdm only announces the login service via XDMCP ;)

Back to topic: Current behaviour is broken: in the good-old-days, before alt-ctrl-del was disbled, kdm restarted the Xserver when it was killed (or crashed). In case of a broken Xserver kdm tried 3 times to start the Xsever, then gave up [today AFAIK a VESA Xserver will now be started instead?].

As further 'prove' of broken behaviour: /etc/init.d/kdm reload starts an Xserver then shows the login screen. Bugfree behaviour would be to restart X without a kick into the kdms a** via the reload command ;)

Achim

Achim Bohnet (allee) wrote :

Since xserver-xorg-video-intel (2:2.8.1-1ubuntu2) upload the intel gfx driver does not crash
anymore but nevertheless, kdm does not start a new greeter.

After the crash I had a completely black screen, now I see black screen, for a short time
the busy mouse cursor (2 rotating white dots) then the standard mouse cursor appear
but screen stays black. No login greeter.

Now I have to 'service kdm restart' instead of reload, to get the login greeter back.

Achim

Jonathan Riddell (jr) on 2009-09-28
Changed in kdebase-workspace (Ubuntu):
milestone: none → karmic-updates
milestone: karmic-updates → ubuntu-9.10
Changed in kdebase-workspace (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Scott Kitterman (kitterman) wrote :

If I could edit bugs right now, I'd refocus the text of this bug to be primarily about what's in comment #3. The Intel crash is fixed, so fixing the kdm behavior when X doesn't crash is the priority.

Richard Johnson (nixternal) wrote :

A work around for this right now is to uncomment 'TerminateServer=true' in /etc/kde4/kdm/kdmrc.

Here is the work I have done thus far and tested without any resolve. I built a completely, patch-free, version of kdebase-workspace and tested it. I was still unable to logout. Further research will be done on this and hopefully we will have a valid fix instead of incorporating the work around. If anyone is able to come up with a valid fix, please state so in this report or in #kubuntu-devel on IRC ASAP. Thanks!

I tested the workaround for user switching. It does not wipe out the
original user's session as I had feared it might. User switching works.
Although not ideal, I think this is a valid work around if we can't get the
root cause solved before release.

Scott Kitterman (kitterman) wrote :

I take it back. I lose compositing with that option set (and get it back if I unset it).

Scott Kitterman (kitterman) wrote :

OK. Maybe it was something else. I'll test some more.

shahn (shahn) wrote :

If this is any help:

The screen stays black, but the login still seems to work. You can see the cursor changing over the (non visible) username and password entry fields. If you manage to type your password in the right field, kdm will happily login.

Richard Johnson (nixternal) wrote :

If KDM logins in, do you see your screen at all or is it still black? I just did it, heard the startup sound, but everything was black.

shahn (shahn) wrote :

Hmm, you're right. The screen stays black on login. (No idea, if it's really logging in, though.) But i remember having the behaviour described in comment #9 yesterday. Don't know what i changed :( Happens with and without compositing.

Achim Bohnet (allee) wrote :

I've tried 4 computers: 3 with intel gfx card and one with radeon. The radeon show login after logout again. The three onboard intel gfx did not: Black screen with 'standard' mouse cursor visible.

While merging my jaunty config changes to karmic I've found this (forgotten) hack/workaround that 'fixes' this problem for all 3 intel gfx hardware: After logout as root. e.g.,

   DISPLAY=:0 XAUTHORITY=/var/run/xauth/A:0-w764YP xrandr --output VGA1 --off
   DISPLAY=:0 XAUTHORITY=/var/run/xauth/A:0-w764YP xrandr --output VGA1 --auto

This results in one flicker, but works. Simple Patch for /etc/kde4/kdm/Xsetup appended.
(does not dynamicly check with xrandr output(s) to use.

Achim

Achim Bohnet (allee) wrote :

I've checked which config needed the hack in jaunty. The Intel driver was (all hardware running jaunty here has intel gfx GM45):

xserver-xorg-video-intel 2:2.6.3-0ubuntu9.3

In jaunty the login screen was black after a cold boot, not after logout. Now in karmic with

xserver-xorg-video-intel 2:2.8.1-1ubuntu2

it's the other way round: cold boot is fine, but screen black after logout.

Achim

Achim Bohnet (allee) wrote :

When I installed jaunty kde 4.3.0 was in ppa. So I've only seem the problem with kdm of 4.3.0 and 4.3.1 never
tried 4.2.* yet. So it looks like at least kdm 4.3* and inter gfx driver 2.6 or 2.8 don't like each other.

Tony Espy (awe) wrote :

I just did a fresh Kubuntu Karmic Beta install on my Macbook Pro(3,1) which has nVidia graphics. I was able to logout and back in again with no issues.

Scott Kitterman (kitterman) wrote :

Based on some of the other comments, I was starting to feel like this was
another Intel issue. I think your test confirms it.

Changed in xserver-xorg-video-intel (Ubuntu Karmic):
importance: Undecided → High
milestone: none → ubuntu-9.10
status: New → Confirmed
Albert Damen (albrt) wrote :

Testing shows this problem only occurs with KMS active.

Debugging with gdb shows we get a new frontbuffer when we logout and the xserver is reset. However, the new frontbuffer is not connected to the crtc .
in drmmode_set_mode_major we have:
        if (drmmode->fb_id == 0) {
                ret = drmModeAddFB(drmmode->fd,
and because fb_id is not null when the xserver is reset, drmModeAddFB is not called.

Attached patch solves this problem for me. I consider this a proof of concept patch; upstream may want to fix the issue in a different way (I don't like I had to add a new public function in drmmode_display.c).

Can someone confirm this patch solves the issue for them as well? If so, I will forward the bug and patch upstream tomorrow.

Jonathan Thomas (echidnaman) wrote :

That pretty much confirms it's a driver issue then. Thanks for investigating this.

Changed in kdebase-workspace (Ubuntu Karmic):
status: Confirmed → Invalid
Bryce Harrington (bryce) on 2009-10-07
tags: added: kubuntu

Bug description:
When logging out from KDE (Kubuntu Karmic), the login screen does not appear. Instead the screen stays black, only showing the mouse cursor.

System environment:
-- chipset: GM965
-- system architecture: 64-bit
-- xf86-video-intel: 2.9.0
-- xserver: 1.6.3
-- mesa: 7.6.0~git20090817 (up to git commit 7c4223876b4f)
-- libdrm: 2.4.13
-- kernel: 2.6.31-12-generic (based on 2.6.31.2)
-- Linux distribution: Kubuntu Karmic (development release)
-- Machine or mobo model: Compal laptop IFL91
-- Display connector: LVDS

Reproducing steps:
Make sure TerminateServer is false (or not set) in /etc/kde4/kdm/kdmrc, so the xserver is reset instead of restarted at logout (default in Kubuntu).
Logout from the session and wait for the login screen. Notice the screen stays black, only the mouse cursor is visible and changes shape if it is moved over the (invisible) password entry box.

Additional info:
With UMS the problem does not exist. The login screen is shown properly after logging out with UMS.

Debugging with gdb shows:
- pI830->front-buffer has got a new value after the logout
- drmmode_set_mode_major is called but drmModeAddFB is not called because drmmode->fb_id is not 0.

Attached patch solves the problem for me, by setting drmmode->fb_id=0 in I830CloseScreen, so drmModeAddFB is called with the new frontbuffer. It also seemed cleaner to call drmModeRmFB at the same time to drop the old frontbuffer from the crtc.

Created an attachment (id=30146)
X log after logging out

Created an attachment (id=30147)
Possible fix

I had to add a new public function in drmmode_display.c to set drmmode->fb_id=0 and call drmModeRmFB. I am not sure if that was really needed; there may be a better place to do this.

Changed in xserver-xorg-video-intel:
status: Unknown → Confirmed
Scott Kitterman (kitterman) wrote :

Retested after today's X updates and the problem is still present.

If I logout of the only user session, I get the problem described (cursor only and the KDM screen is present, so I can put a password in, but not see anything other than the mouse pointer). If I activate a second user session (from the option from a locked screen) I can start the new user session, switch back and forth, and log out of the second one with no problems.

Pushed this to xf86-video-intel:

commit fcc2ee48b866b81c79315ff10189b56fc201539d
Author: Albert Damen <email address hidden>
Date: Wed Oct 7 21:55:42 2009 +0200

    Drop frontbuffer from crtc in I830CloseScreen

Thanks.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xserver-xorg-video-intel - 2:2.9.0-1ubuntu2

---------------
xserver-xorg-video-intel (2:2.9.0-1ubuntu2) karmic; urgency=low

  * Add 100_drop_fb_from_crtc.patch. Fixes lockup with black screen on
    logout of KDE with KMS enabled. Patch zeroes out the framebuffer id
    to clean up on screen closure. Cherrypick from upstream.
    (LP: #432521)

 -- Bryce Harrington <email address hidden> Tue, 13 Oct 2009 11:31:29 -0700

Changed in xserver-xorg-video-intel (Ubuntu Karmic):
status: Confirmed → Fix Released
Changed in xserver-xorg-video-intel:
status: Confirmed → Fix Released
Achim Bohnet (allee) wrote :

Great! Thx a lot!!! I've installed 2:2.9.0-1ubuntu2 and now I get the login greeter again after logout.

chiefaua (tom-t) wrote :

Hi,

After installing this update, the login screen (kdm in my case) doesn't show up any more. I only get a black screen with sometimes video garbage.
Changing to another VT doesn't work, there is also only a black screen with a lonley "_" somewhere on the screen (not in the native video resolution by the way).
Restarting in recovery mode or with the nomodeset kernel parameter does work sometimes, sometimes this only leads to a black screen as well. Sometimes, after starting in recovery mode or with nomodeset, the normal startup works again once, but after another restart the black screen problem occurs again.

I would like to test if my problem really relates to the latest update, but I couldn't find the older package any more. Where can I find it, and would there be a problem if I simply reinstall the older package?

Regards,
Thomas

Changed in xserver-xorg-video-intel:
importance: Unknown → Medium
Changed in xserver-xorg-video-intel:
importance: Medium → Unknown
Changed in xserver-xorg-video-intel:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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