Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 84689 - X crashes when run from init
Summary: X crashes when run from init
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: XFree86
Version: 1.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: 79579
TreeView+ depends on / blocked
 
Reported: 2003-02-20 14:42 UTC by Tim Waugh
Modified: 2007-04-18 16:51 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-02-24 22:22:26 UTC


Attachments (Terms of Use)
XFree86-revert-some.patch (deleted)
2003-02-21 22:45 UTC, Tim Waugh
no flags Details | Diff

Description Tim Waugh 2003-02-20 14:42:13 UTC
Description of problem:
X gives a segfault when run as '/etc/X11/X -query othermachine' from init (using
/etc/inittab).

Version-Release number of selected component (if applicable):
XFree86-4.2.99.902-20030218.0

How reproducible:
100%

Steps to Reproduce:
1. Set up othermachine for XDMCP
2. Fresh install
3. init 3
4. Change last line of /etc/inittab to:
x:5:respawn:/etc/X11/X -query othermachine
5. init q
6. init 5
    
Actual results:
Screen flickers until giving up.

Expected results:
X display.

Additional info:
Bizarrely, running '/etc/X11/X -query othermachine' from the console as root
works perfectly fine. :-/

Also, this is a new regression since a couple of days ago.

Comment 1 Mike A. Harris 2003-02-21 10:59:28 UTC
Please do a binary search of last builds to narrow down the single release
that introduces the problem for ya.

Comment 2 Tim Waugh 2003-02-21 12:25:32 UTC
17.1 works, 18.0 doesn't

Comment 3 Tim Waugh 2003-02-21 12:30:30 UTC
The machine with the crashing server has a Matrox G400 video card, by the way.

Comment 4 Tim Waugh 2003-02-21 15:56:06 UTC
Too weird.

So if I set the inittab line to run:
sh -c '/etc/X11/X -query othermachine'
then it will segfault.

But this works fine:
sh -c 'cd /;/etc/X11/X -query othermachine'

About the best stack trace I'm going to be able to get is this I think:

#0  0x4011e985 in ?? ()
#1  0x0876c646 in ?? ()
#2  0x08782ea7 in ?? ()
#3  0x08782bc3 in ?? ()
#4  0x08085dd6 in DGAShutdown () at xf86DGA.c:496
#5  0x0806e87e in ddxGiveUp ()
#6  0x08100512 in AbortServer () at utils.c:436
#7  0x08102060 in FatalError (
    f=0x81ed6c0 "Caught signal %d.  Server aborting\n") at utils.c:1421
#8  0x0808861e in xf86SigHandler (signo=11) at xf86Events.c:1186
#9  <signal handler called>
#10 0x4011e985 in ?? ()
#11 0x0876c4a4 in ?? ()
#12 0x08782771 in ?? ()
#13 0x080becec in CMapCloseScreen (i=0, pScreen=0x87a4aa8) at xf86cmap.c:215
#14 0x0809734f in DPMSClose (i=0, pScreen=0x87a4aa8) at xf86DPMS.c:100
#15 0x0830a800 in ?? ()
#16 0x4011a4df in ?? ()
#17 0x08193b94 in RRCloseScreen (i=0, pScreen=0x87a4aa8) at randr.c:159
#18 0x08096f8f in xf86RandRCloseScreen (index=0, pScreen=0x87a4aa8)
    at xf86RandR.c:235
#19 0x080b79f3 in VidModeClose (i=0, pScreen=0x87a4aa8) at xf86VidMode.c:100
#20 0x0818f9e8 in LbxCloseScreen (i=0, pScreen=0x87a4aa8) at lbxcmap.c:159
#21 0x081a2775 in AnimCurCloseScreen (index=0, pScreen=0x87a4aa8)
    at animcur.c:126
#22 0x080e16e9 in main (argc=3, argv=0xbfffea74, envp=0xbfffea84) at main.c:459
#23 0x420154a4 in __libc_start_main () from /lib/tls/libc.so.6

Comment 5 Tim Waugh 2003-02-21 17:20:10 UTC
The only other thing I've managed to capture is this fragment of strace output.
 Running X under strace to start with ends up looping with signals, so I had to
attach it at the instant before it crashed; not easy.

write(0, "[drm] unmapping 8192 bytes of SA"..., 61) = 61
munmap(0x4001b000, 8192)                = 0
fstat64(7, {st_mode=S_IFCHR|0666, st_rdev=makedev(226, 0), ...}) = 0
fstat64(7, {st_mode=S_IFCHR|0666, st_rdev=makedev(226, 0), ...}) = 0
close(7)                                = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---

Comment 6 Tim Waugh 2003-02-21 18:21:15 UTC
I put this in section 'device' (mga driver):

Option "HWCursor" "off"

That makes the problem go away.  Some hwcursor bug I guess.

Comment 7 Tim Waugh 2003-02-21 22:45:11 UTC
Created attachment 90268 [details]
XFree86-revert-some.patch

This patch (which reverts a change in 0217->0218) seems to make the problem go
away, unless I tested wrong.

Comment 8 Mike A. Harris 2003-02-24 10:05:19 UTC
This patch, which was checked into CVS by Alan, should fix this problem.

   939. Check pScrn->vtSema before calling xf86SetCursor() from
        xf86CursorCloseScreen().  This avoids a segfault at exit with some
        drivers (Alan Hourihane).

--- xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c:1.18     Tue Feb 18
10:42:13 2003
+++ xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c  Fri Feb 21 17:40:33 2003
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c,v 1.17tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c,v 1.18
2003/02/18 15:42:13 tsi Exp $ */
 
 #include "xf86.h"
 #include "xf86_ansic.h"
@@ -122,7 +122,7 @@
     xf86CursorScreenPtr ScreenPriv =
        pScreen->devPrivates[xf86CursorScreenIndex].ptr;
 
-    if (ScreenPriv->isUp)
+    if (ScreenPriv->isUp && pScrn->vtSema)
        xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
 
     pScreen->CloseScreen = ScreenPriv->CloseScreen;

Comment 9 Mike A. Harris 2003-02-24 10:06:29 UTC
Setting to MODIFIED, please test XFree86-4.2.99.902-20030223.0
build and set to RAWHIDE if fixed or ASSIGNED if broken still.

Comment 10 Tim Waugh 2003-02-24 22:22:26 UTC
Yes, seems to fix it here.  Thanks.


Note You need to log in before you can comment on or make changes to this bug.