Bug 435104

Summary: Xorg crashes on pressing of any key
Product: [Fedora] Fedora Reporter: Matěj Cepl <mcepl>
Component: xorg-x11-serverAssignee: Adam Jackson <ajax>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: gilboad, krh, lordmorgul, matt_domsch, mcepl, olivares14031, xgl-maint
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-03 06:47:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screenshot of the data
none
/var/log/Xorg.0.log
none
/etc/X11/xorg.conf
none
Xorg.0.log
none
recorded the session
none
recorded the session
none
xorg.conf none

Description Matěj Cepl 2008-02-27 12:26:27 UTC
Description of problem:
When starting in telinit 5 I got gdm pretty fine, but when pressing *any* key on
the keyboard (mouse seems to work fine), Xorg restarts. It makes it hard to log
in to my gnome-session ;-)

OK, so startx. It starts almost well (animated background is missing), then I
get dialog window asking me to get result of xprop -root |grep XKB and
gconftool. Well, not easy when pressing of any key crashes Xorg server :-)

However, after some playing with pasting selections I got the attached
screenshot (without pressing any key; yay, we are finally in writing with mouse
business :-)).

Version-Release number of selected component (if applicable):
libxkbfile-1.0.4-5.fc9.x86_64
xorg-x11-drv-keyboard-1.2.2-4.fc9.x86_64
xorg-x11-server-common-1.4.99.1-0.23.20080222.fc9.x86_64
xorg-x11-server-Xorg-1.4.99.1-0.23.20080222.fc9.x86_64
xorg-x11-server-utils-7.3-3.fc9.x86_64

How reproducible:
100% (unfortunately)

Comment 1 Matěj Cepl 2008-02-27 12:26:27 UTC
Created attachment 296055 [details]
screenshot of the data

Comment 2 Matěj Cepl 2008-02-27 15:01:34 UTC
Still the same with the latest updates from koji:

libxkbfile-1.0.4-5.fc9.x86_64
xorg-x11-drv-keyboard-1.2.2-4.fc9.x86_64
xorg-x11-server-common-1.4.99.1-0.23.20080222.fc9.x86_64
xorg-x11-server-Xorg-1.4.99.1-0.23.20080222.fc9.x86_64
xorg-x11-server-utils-7.3-3.fc9.x86_64


Comment 3 Matěj Cepl 2008-02-27 15:06:24 UTC
Created attachment 296068 [details]
/var/log/Xorg.0.log

Comment 4 Matěj Cepl 2008-02-27 15:07:23 UTC
Created attachment 296069 [details]
/etc/X11/xorg.conf

Comment 5 Matěj Cepl 2008-02-27 15:38:06 UTC
Created attachment 296075 [details]
/var/log/messages

Comment 6 Matěj Cepl 2008-02-27 20:40:42 UTC
*** Bug 435183 has been marked as a duplicate of this bug. ***

Comment 8 Andrew Farris 2008-02-27 21:52:54 UTC
I see a similar thing with one system, but another is not doing this.  However mine does not reset Xorg 
when I type a key it only resets when I try to login, then gdm restarts and the process repeats (type name, 
type password, Xorg restart, gdm restart).  It does not appear to be even trying to get into gnome yet at 
the point it fails and restarts gdm (nothing relevant in .xsession-errors).

Comment 9 Yijun Yuan 2008-02-28 01:29:22 UTC
I have problem with rhgb. At rhgb I press "space" then rhgb crashes. When it
comes to gdm, I can login without problem. This is several days ago, now I use
startx and disabled rhgb to boot faster (since it has some chance of freeze when
gnome starts I may have to reboot. BTW, if nautilus and gnome-panel crash, and
"alt" key lost response, what can I do to reboot safely?)

Comment 10 Andrew Farris 2008-02-28 01:47:08 UTC
As of today I'm no longer getting gdm allowing me to type in username/pw, but I don't think my gdm 
version changed so something else must have.  It is not respawning immediately as soon as it displays the 
userlist window (I see 'Other' then it restarts gdm).

Yuan, if you have another machine you can login and restart via ssh.  If you don't have another machine, 
then put a terminal launcher on your desktop so you can try using that to open a terminal and reboot from 
there (assuming nautilus is showing your desktop but panel is crashed).  You could also configure a key in 
gnome to shutdown or logoff (then you'd just need to hit enter to exit).

Comment 11 Andrew Farris 2008-02-28 01:48:06 UTC
That should have been 'it is now respawning immediately as soon as it displays the userlist'

Comment 12 Antonio A. Olivares 2008-02-28 16:37:13 UTC
Now everything crashes X session.  I type startx from level 3 and it goes 
down.  Is there something that we can do to make it work again.

Comment 13 Antonio A. Olivares 2008-02-28 16:38:30 UTC
Now everything crashes X session.  I type startx from level 3 and it goes 
down.  Is there something that we can do to make it work again.

Comment 14 Matt Domsch 2008-02-28 19:19:42 UTC
In my case I tracked it down to a segfault in the X server code.  Reading the 
code, I don't see how that failure could be happening, which makes me think 
either the SIGALRM that comes in immediately ahead of the failure stomps on the 
stack somehow.

Comment 15 Matt Domsch 2008-02-28 19:24:06 UTC
http://domsch.com/linux/fedora/xorg-segv-ltrace.txt shows the failure.  Look 
for SEGV and then back up a few lines.

Comment 16 Matěj Cepl 2008-02-28 22:26:24 UTC
Could all of you please, attach your /var/log/Xorg.0.log from the attempt to run
Xorg as a separate uncompressed attachment to this bug, please?

Comment 17 Matt Domsch 2008-02-29 00:23:24 UTC
Created attachment 296293 [details]
Xorg.0.log

Comment 18 Antonio A. Olivares 2008-02-29 14:53:45 UTC
Created attachment 296359 [details]
recorded the session

Comment 19 Antonio A. Olivares 2008-02-29 14:54:54 UTC
Created attachment 296360 [details]
recorded the session

Comment 20 Matt Domsch 2008-02-29 14:55:38 UTC
I think there are several different crashes going on here.

If I remove /etc/X11/xorg.conf such that X uses its effective built-in defaults,
I get it to crash on keypress in dix/getevents.c: GetKeyboardValuatorEvents():

    KeySym *map = pDev->key->curKeySyms.map;
    KeySym sym = map[key_code * pDev->key->curKeySyms.mapWidth];

However, curKeySyms.map is a NULL pointer, so boom.

Backtrace:

0: /usr/bin/X(xf86SigHandler+0x65) [0x47a705] (this is the SEGV handler)
1: /lib64/libc.so.6 [0x3293832ef0]

2: /usr/bin/X(GetKeyboardValuatorEvents+0x4a) [0x45680a]  (this is the real crash)
3: /usr/bin/X(GetKeyboardEvents+0x17) [0x456b77]
4: /usr/bin/X(xf86PostKeyboardEvent+0x7d) [0x4924ad]
5: /usr/lib64/xorg/modules/input//evdev_drv.so [0x1ae9b9b]
6: /usr/bin/X [0x47a855]
7: /usr/bin/X [0x46a4c7]
8: /lib64/libc.so.6 [0x3293832ef0]
9: /lib64/libc.so.6(__select+0x13) [0x32938de473]
10: /usr/bin/X(WaitForSomething+0x1db) [0x4e807b]
11: /usr/bin/X(Dispatch+0xa7) [0x445d47]
12: /usr/bin/X(main+0x45d) [0x42c6dd]
13: /lib64/libc.so.6(__libc_start_main+0xfa) [0x329381e36a]
14: /usr/bin/X(FontFileCompleteXLFD+0x281) [0x42bab9]


If I use an xorg.conf file that has Input sections for the mouse and keyboard,
it also crashes this way.

If I remove the InputDevice sections from my xorg.conf and use this ServerFlags
section instead, it fails the same way:
Section "ServerFlags"
        Option      "AllowEmptyInput" "True"
        Option      "AutoAddDevices" "True"
        Option      "AutoEnableDevices" "True"
EndSection

So, why is map NULL?

Comment 21 Matt Domsch 2008-02-29 15:51:00 UTC
Created attachment 296370 [details]
xorg.conf

Potential solution for me.

First, read this:
https://www.redhat.com/archives/fedora-devel-list/2008-February/msg02131.html

Second, *don't* follow this for step 2 or later!  You *do* want this section in
your xorg.conf file:

Section "ServerFlags"
	Option	    "AllowEmptyInput" "True"
	Option	    "AutoAddDevices" "True"
	Option	    "AutoEnableDevices" "True"
EndSection

In my case, I also need to have a section for the Synaptics touchpad.  See my
attached xorg.conf.
 
Adding in the suggested file /etc/hal/fdi/policy/10-x11-keyboard-layout.fdi
turns out to be what broke hal, which is what caused the keyboard map to be
null.  So don't do this.  Here's what I get from hal now:

$ lshal | grep xkb
  input.xkb.layout = 'us'  (string)
  input.xkb.model = 'evdev'  (string)
  input.xkb.rules = 'base'  (string)
  input.xkb.variant = ''  (string)


And this works for me.

X really should complain loudly if it can't set up the key map, not just wait
for it to crash on keypress.

Comment 22 Adam Jackson 2008-03-04 18:22:03 UTC
Should be working in 1.4.99.900-0.27.20080303.

Comment 23 Gilboa Davara 2008-03-13 21:21:13 UTC
I seem to be hitting this bug with
xorg-x11-server-Xorg-1.4.99.901-1.20080307.fc9.x86_64

$ cat /etc/X11/xorg.conf | grep Xkb
        Option          "XkbModel"              "pc105"
        Option          "XkbLayout"             "us,il"
        Option          "XkbOptions"    "grp:alt_shift_toggle,grp_led:scroll"
$ xinit
(type "exit" in X console)
....
Backtrace:
0: X(xf86SigHandler+0x65) [0x479d35]
1: /lib64/libc.so.6 [0x3089833000]
2: X(GetKeyboardValuatorEvents+0x3c) [0x45672c]
3: X(GetKeyboardEvents+0x17) [0x456aa7]
4: X(xf86PostKeyboardEvent+0x7d) [0x491add]
5: /usr/lib64/xorg/modules/input//evdev_drv.so [0x7326ab2]
6: X [0x479e85]
7: X [0x46a4f7]
8: /lib64/libc.so.6 [0x3089833000]
9: /lib64/libc.so.6(sigprocmask+0x10) [0x3089833230]
10: X(xf86UnblockSIGIO+0x2d) [0x469f4d]
11: /usr/lib64/xorg/modules//libint10.so(finish_int+0xb) [0x457d62b]
12: /usr/lib64/xorg/modules//libvbe.so(VBESetVBEMode+0xa0) [0x1bc4c30]
13: /usr/lib64/xorg/modules/drivers//vesa_drv.so [0x41afc0b]
14: /usr/lib64/xorg/modules/drivers//vesa_drv.so [0x41b165a]
15: X [0x501ebb]
16: X [0x522cf4]
17: X(main+0x4d4) [0x42c834]
18: /lib64/libc.so.6(__libc_start_main+0xfa) [0x308981e47a]
19: X(FontFileCompleteXLFD+0x279) [0x42bb99]

I managed to reproduce this crash twice.

- Gilboa

Comment 24 Matěj Cepl 2008-04-02 06:50:09 UTC
Could anybody reproduce this bug with the current updates of Rawhide (Beta and
post-Beta)? I certainly cannot and I think this bug should be CLOSED.

Comment 25 Matt Domsch 2008-04-02 13:56:58 UTC
I was able to for a while, but after setting up X to use evdev for the 
keyboard properly, it went away.  After X changed again to not use evdev, the 
problem re-appeared.  I then removed X using evdev parts of the config, and 
it's working again.  Oh the joys of running rawhide. :-)

Note I don't think the actual bug is fixed, I think it just gets masked when 
you have a proper keyboard config (for whatever definition of "proper" X 
expects today.)

Comment 26 Gilboa Davara 2008-04-02 15:54:24 UTC
Fresh 9-B installation + updates seems to work just fine.
Thanks!

- Gilboa

Comment 27 Matěj Cepl 2008-04-03 06:47:02 UTC
(In reply to comment #25)
> Note I don't think the actual bug is fixed, I think it just gets masked when 
> you have a proper keyboard config (for whatever definition of "proper" X 
> expects today.)

Yes, but I think it should be masked for everybody -- after many bugs like this,
evdev was ripped from all default configuration and unless you want
intentionally inflict pain on yourself and install it manually it shouldn't
happen anymore in F9 (not until it is thoroughly debugged).

Closing as RAWHIDE.