On Wed, 7 Apr 2004, Ulrich Teichert wrote: > I'm having a wierd problem with XFree86 4.3.0.2 (build from source on > x86-linux, running on a settop box with a Geode chip, nsc driver, keyboard > and mouse over TV-IR and fed into /dev/tty0 and /dev/gpmdata, repectively) > First, the X server runs like a charm. Stable and reliable, does not seem > to have memory leaks or something. Very nice, until it comes to stopping > it. CTRL-C on the console or SIGTERM does not terminate the server and > it is using all CPU it can get in a busy loop. It is killable with SIGKILL, > though. > I really would like to understand the problem behind it, before I start > fiddeling with a workaround (like killing the Xserver with SIGKILL instead > of SIGTERM anytime). I suspect it's just a configuration issue. [...] > I traced it down where the server is hanging, it's the same spot everytime, > but I wasn't able to see the C-source of it, despite building *everything* > with debug and using a libc with debugging symbols (nfs mounted - the box > does not have a hard disk). The stack trace is: > #0 0x401a875c in ?? () > #1 0x4018a6b7 in ?? () > #2 0x4018a6e6 in ?? () > #3 0x081667da in AnimCurCloseScreen (index=0, pScreen=0x83327e0) > at animcur.c:126 > #4 0x080c07c5 in main (argc=8, argv=0xbffffdc4, envp=0xbffffde8) at main.c:459 > Line 126 in animcur.c is: > ret = (*pScreen->CloseScreen) (index, pScreen); > (gdb) p screenInfo > $2 = {imageByteOrder = 0, bitmapScanlineUnit = 32, bitmapScanlinePad = 32, > bitmapBitOrder = 0, numPixmapFormats = 7, formats = {{depth = 1 '\001', > bitsPerPixel = 1 '\001', scanlinePad = 32 ' '}, {depth = 4 '\004', > bitsPerPixel = 8 '\b', scanlinePad = 32 ' '}, {depth = 8 '\b', > bitsPerPixel = 8 '\b', scanlinePad = 32 ' '}, {depth = 15 '\017', > bitsPerPixel = 16 '\020', scanlinePad = 32 ' '}, {depth = 16 '\020', > bitsPerPixel = 16 '\020', scanlinePad = 32 ' '}, {depth = 24 '\030', > bitsPerPixel = 32 ' ', scanlinePad = 32 ' '}, {depth = 32 ' ', > bitsPerPixel = 32 ' ', scanlinePad = 32 ' '}, {depth = 0 '\0', > bitsPerPixel = 0 '\0', scanlinePad = 0 '\0'}}, arraySize = 16, > numScreens = 1, screens = {0x83327e0, 0x0 <repeats 15 times>}, > numVideoScreens = 1} > (gdb) p pScreen > $6 = 0x3d5 > The disassembled x86 code where it loops is: > 0x401a9759: mov %ebx,%edx > 0x401a975b: in (%dx),%al > 0x401a975c: test %al,%al > 0x401a975e: jl 0x401a9759 > 0x401a9760: mov $0x30,%al > 0x401a9762: mov %esi,%edx > 0x401a9764: out %al,(%dx) > (gdb) info all-registers > eax 0xff 255 > ecx 0x3d5 981 > edx 0x3d5 981 > ebx 0x3d5 981 > [snip] > The loop starts at 0x401a9759 and goes to 0x401a975e. If I jump to > 0x401a9760 in the debugger, the server terminates. So, it reads 0x3d5, > whatever that is (probably I/O stuff) and the test never succeeds. Looks like it's looping in function gfx_vga_mode_switch() near the tail end of xc/programs/Xserver/hw/xfree86/drivers/ncs/gfx/vga_gu1.c, part of which reads /* WAIT UNTIL SOFTVGA HAS VALIDATED MODE IF ENDING MODE SWITCH */ /* This is for VSA1 only, where SoftVGA waits until the next */ /* vertical blank to validate the hardware state. */ if ((!active) && (!(gu1_detect_vsa2()))) { OUTB(crtcindex, 0x33); while (INB(crtcdata) & 0x80) ; } Change this to ... /* WAIT UNTIL SOFTVGA HAS VALIDATED MODE IF ENDING MODE SWITCH */ /* This is for VSA1 only, where SoftVGA waits until the next */ /* vertical blank to validate the hardware state. */ if ((!active) && (!(gu1_detect_vsa2()))) { int cnt = 256; OUTB(crtcindex, 0x33); while (--cnt && (INB(crtcdata) & 0x80)); } ... and see what happens. Marc. +----------------------------------+-----------------------------------+ | Marc Aurele La France | work: 1-780-492-9310 | | Computing and Network Services | fax: 1-780-492-1729 | | 352 General Services Building | email: tsi@xxxxxxxxxxx | | University of Alberta +-----------------------------------+ | Edmonton, Alberta | | | T6G 2H1 | Standard disclaimers apply | | CANADA | | +----------------------------------+-----------------------------------+ XFree86 developer and VP. ATI driver and X server internals. _______________________________________________ XFree86 mailing list XFree86@xxxxxxxxxxx http://XFree86.Org/mailman/listinfo/xfree86