Bug 2228 - Xorg server unusable when DefaultGcc2i386Opt has both -O and -mXXXX CPU architecture optimizations
Summary: Xorg server unusable when DefaultGcc2i386Opt has both -O and -mXXXX CPU archi...
Status: RESOLVED WONTFIX
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 6.8.1
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-05 03:49 UTC by Bauke Jan Douma
Modified: 2007-11-16 16:42 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Bauke Jan Douma 2005-01-05 03:49:38 UTC
Not really a bug, but a FYI with some compile tests of Xorg-6.8.1.

I know the stock build flags don't use these optimizations together, but
I have seen some host.def's that were modified to have a highly optimized
DefaultGcc2i386Opt.  For me that doesn't work, and here are some of my   
findings.



Static:
-------
System:
        IA32, Pentium4
        Linux-2.6.9; Linux-2.6.10
        custom, homegrown system, no distribution

Glibc:
        glibc-2.3.3 + NPTL (cvs glibc-20041004)

Gcc:
        gcc-3.4.3 (stock)

Graphics driver:
        nvidia-6629 custom compiled

Xorg:
        6.8.1 (stock); 6.8.1 cvs Dec 24 10:38 MET

Window manager:
        vtwm-2.5.6b

Specific xorg.conf options:
        RenderAccel "on"   

Specific Xorg build options:
        DefaultCCOptions:       default
        OptimizedCDebugFlags:   default



Variable:
---------
DefaultGcc2i386Opt:
        gtk progams run without problems when X server is compiled with:
        -I/usr/local/include/freetype2 -O0 -march=pentium3
        -I/usr/local/include/freetype2 -O0 -march=pentium4
        -I/usr/local/include/freetype2 -O0
        -I/usr/local/include/freetype2 -O1
        -I/usr/local/include/freetype2 -O2 -fno-strength-reduce

        gtk programs freeze the X server when X server is compiled with:
        -I/usr/local/include/freetype2 -O2 -fno-strength-reduce -march=pentium4
        -I/usr/local/include/freetype2 -O2 -fno-strength-reduce -mfpmath=sse -msse2
        -I/usr/local/include/freetype2 -O1 -march=pentium4

notes:
- gtk programs are: gqview, gimp, wininfo
- freeze happens when the program in question is
  started, and the pointer moves into the window;
  at that time X freezes, system becomes unusable,
  reboot necessary.


bjd
Comment 1 Donnie Berkholz 2005-01-07 08:23:54 UTC
Anything interesting happen if you use OptimizedCDebugFlags instead for your
optimized CFLAGS? And incidentally, is this reproduceable using the 'nv' driver?
Comment 2 Bauke Jan Douma 2005-01-07 13:24:33 UTC
(In reply to comment #1)
> Anything interesting happen if you use OptimizedCDebugFlags instead for your
> optimized CFLAGS? And incidentally, is this reproduceable using the 'nv' driver?


I'll try with the OptimizedCDebugFlags tomorrow.  As to the nv driver
instead of nvidia -- good question.  I'm alsmost sure the nv driver
does not show these problems, but I'll have to try that out too.
I am currently running a normal -O2 -fno-strength-reduce compiled
Xorg, so have to do that build tomorrow.  I did so many recompiles
and tests last couple of weeks (also dealing with other quirks) that
I can't remember now with certainty that nv.ko did not display these
problems.

bjd
Comment 3 Bauke Jan Douma 2005-01-09 04:25:57 UTC
(In reply to comment #2)

Ok, I did some more tests, this time with the variations in OptimizedCDebugFlags.
First of all, the nv.ko driver is ok; none of the problems (actually, it's pretty
much the same in all cases) described here apply to nv.ko.

Also I have to add the following notes, which apply retroactively to all
tests in this and the previous 'bug' reports:

- I am doing nothing fancy in the way of xcompgr, although I do have
  Composite and RENDER enabled.
- disabling the NVIDIA Option "RenderAccel" does not alleviate the
  problem.

And a remark that 'problem' just refers to the observed behaviour, not
to my emotions on it, since running a Xorg server compiled with the defaults
works fine (though displays some other, unrelated problems).

Here's the most recent builds and results:

DefaultCCOptions:       default (i.e. DefaultCCOptions not set in host.def)
DefaultGcc2i386Opt:     -O2 -fno-strength-reduce
OptimizedCDebugFlags:   -O0 -march=pentium4
result:                 ok

DefaultCCOptions:       default (i.e. DefaultCCOptions not set in host.def)
DefaultGcc2i386Opt:     -O2 -fno-strength-reduce
OptimizedCDebugFlags:   -O2 -fno-strength-reduce -march=pentium4 -mfpmath=sse -msse2
result:                 hang

DefaultCCOptions:       default (i.e. DefaultCCOptions not set in host.def)
DefaultGcc2i386Opt:     -O2 -fno-strength-reduce
OptimizedCDebugFlags:   -O1 -march=pentium4
result:                 hang


Again it would seem that even a combination of -O1 with another optimization
of the type -march=XXXX is vulnerable.

'Hang' refers to gqview, gimp and wininfo hanging the server (blacking
out the screen) as soon as pointer enters their window.  What's remarkable
here is that these are all gtk applications...

The reason I am calling it hang, is that the system itself does not actually
hang in a strict sense, because when I did some remote debugging 10 days ago,
after the 'hang', I could remotely bring down the system in a clean way
and reboot cleanly.  Other than that, when the hang occurs, in effect what
you have is a system that has become unusable (screen blacked out, keyboard
unresponsive) and needs a hard power cycle.

Let me give two remote debugging sessions from about 10 days ago.  I am not
sure what to make of them myself at this point, but I'm willing to do some
more of this if anybody wants me to do some more, or other, remote debugging.

bjdScript started on Mon Dec 27 23:52:06 2004

sh-3.00# gdb program 17730
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...program: No such file or directory.

Attaching to process 17730
Reading symbols from /usr/x11/bin/Xorg...done.
Using host libthread_db library "/lib/libthread_db.so.1".
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/x11/lib/modules/fonts/libfreetype.so...done.
Loaded symbols for /usr/X11R6/lib/modules/fonts/libfreetype.so
Reading symbols from /usr/local/lib/libfreetype.so.6...done.  
Loaded symbols for /usr/local/lib/libfreetype.so.6
0xffffe410 in ?? ()
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x0817fac5 in miWideDashSegment (pDrawable=0x86d8f68, pGC=0x869b280, spanData=0x0,
    pDashOffset=0xbffff2d4, pDashIndex=0xbffff2d0, x1=291, y1=0, x2=859, y2=0,
projectLeft=0,
    projectRight=0, leftFace=0xbffff398, rightFace=0xbffff368) at miwideline.c:1935
1935            first = FALSE;
(gdb) bt f
#0  0x0817fac5 in miWideDashSegment (pDrawable=0x86d8f68, pGC=0x869b280,
spanData=0x0,
    pDashOffset=0xbffff2d4, pDashIndex=0xbffff2d0, x1=291, y1=0, x2=859, y2=0,
projectLeft=0,
    projectRight=0, leftFace=0xbffff398, rightFace=0xbffff368) at miwideline.c:1935
        dashIndex = 0
        dashRemain = 1
        pDash = (unsigned char *) 0x8c6cb30 "\001\001ù·HN\225\b\020"
        L = 568
        l = 0.5
        k = 284
        vertices = {{x = 0, y = -0.5}, {x = 0, y = -0.5}, {x = -0, y = 0.5}, {x
= -0, y = 0.5}}
        saveRight = {x = 0, y = 0}
        saveBottom = {x = 0, y = 0}
        slopes = {{dx = 568, dy = 0, k = 284}, {dx = 0, dy = 568, k = 0}, {dx =
-568, dy = 0,
    k = 284}, {dx = 0, dy = -568, k = 0}}
        left = {{height = 0, x = 0, stepx = 0, signdx = 0, e = 0, dy = 0, dx =
0}, {height = 0,
    x = 0, stepx = 0, signdx = 0, e = 0, dy = 0, dx = 0}}
        right = {{height = 0, x = 0, stepx = 0, signdx = 0, e = 0, dy = 0, dx =
0}, {height = 0,
    x = 0, stepx = 0, signdx = 0, e = 0, dy = 0, dx = 0}}
        lcapFace = {xa = 0, ya = 0, dx = 0, dy = 0, x = 0, y = 0, k = 0}
        rcapFace = {xa = 0, ya = 0, dx = 0, dy = 0, x = 0, y = 0, k = 0}
        nleft = 0
        nright = 0
        h = 0
        y = 141144704
        dy = 0
        dx = 568
        pixel = 2
        LRemain = 568
        r = -nan(0x8000000000000)
        rdx = 0.5
        rdy = 0  
        dashDx = -nan(0x8000000000000)
        dashDy = -nan(0x8000000000000)
        saveK = 0
        first = 1
        lcenterx = 291
        lcentery = 0  
        rcenterx = 0  
        rcentery = 0  
        fgPixel = 0   
        bgPixel = 1   
#1  0x081806d8 in miWideDash (pDrawable=0x86d8f68, pGC=0x869b280, mode=0, npt=2,
pPts=0xb2e70040)
    at miwideline.c:2132
        x1 = 291
        y1 = 0  
        x2 = 859
        y2 = 0  
        pixel = 0
        projectLeft = 0
        projectRight = 0
        leftFace = {xa = 3.891354479419679e-268, ya = -1.997058899804836, dx =
138331013,
  dy = 141144704, x = 141397864, y = 0, k = 0}
        rightFace = {xa = 2.5810650130682013e-267, ya = 0, dx = 0, dy = 0, x =
0, y = 0,
  k = 6.9859848736621161e-316}
        prevRightFace = {xa = 4.476318331309257e-268, ya = -1.9969062805175783,
dx = 135166053,
  dy = 144002624, x = 0, y = -1073745052, k = 2.5810650130296511e-267}
        firstFace = {xa = 0, ya = 2.5810649545600524e-267, dx = -1208387584, dy
= -1208393740,
  x = -1208387584, y = 144002624, k = -2.7783092733402767e-39}
        first = 1
        dashIndex = 0
        dashOffset = 0
        prevDashIndex = 0
        spanDataRec = {fgGroup = {size = 113, count = -1209123999, group = 0x0,
ymin = 0,
    ymax = 0}, bgGroup = {size = 0, count = 0, group = 0x0, ymin = 0, ymax = 0}}
        spanData = 0x0
        somethingDrawn = 1
        selfJoin = 0
        endIsFg = 0 
        startIsFg = 0
        firstIsFg = 0
        prevIsFg = 0 
#2  0xb7d88bc7 in ?? ()
No symbol table info available.
#3  0x086d8f68 in ?? ()
No symbol table info available.
#4  0x0869b280 in ?? ()
No symbol table info available.
#5  0x00000000 in ?? ()
No symbol table info available.
#6  0x00000003 in ?? ()
No symbol table info available.
#7  0xb2e70040 in ?? ()
No symbol table info available.
#8  0x081c814c in ?? ()
No symbol table info available.
#9  0x0869b324 in ?? ()
No symbol table info available.
#10 0x0869b280 in ?? ()
No symbol table info available.
#11 0xbffff448 in ?? ()
No symbol table info available.
#12 0x08167c88 in cwPolylines (pDst=0x1, pGC=0x0, mode=138600184, npt=71401,
ppt=0x8939b50)
    at cw_ops.c:258
        pGCPrivate = 0x3
        dst_off_x = 14279145
        dst_off_y = 14279145
        pBackingDst = 0xd9e1e9
        pBackingGC = 0xd9e1e9 
Previous frame inner to this frame (corrupt stack?)
(gdb) detach
Detaching from program: /usr/x11/bin/Xorg, process 17730
(gdb) quit
sh-3.00#  
Script done on Mon Dec 27 23:56:02 2004




Script started on Tue Dec 28 17:51:16 2004
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...program: No such file or directory.

Attaching to process 23989
Reading symbols from /usr/x11-default/bin/Xorg...done.
Using host libthread_db library "/lib/libthread_db.so.1".
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/x11-default/lib/modules/fonts/libfreetype.so...done.
Loaded symbols for /usr/x11/lib/modules/fonts/libfreetype.so
Reading symbols from /usr/local/lib/libfreetype.so.6...done.
Loaded symbols for /usr/local/lib/libfreetype.so.6
0xffffe410 in ?? ()
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x0817fac1 in miWideDashSegment (pDrawable=0x8693ce8, pGC=0x8695820, spanData=0x0,
    pDashOffset=0xbffff2d4, pDashIndex=0xbffff2d0, x1=291, y1=0, x2=859, y2=0,
projectLeft=0,
    projectRight=0, leftFace=0xbffff398, rightFace=0xbffff368) at miwideline.c:1935
1935            first = FALSE;
(gdb) bt f
#0  0x0817fac1 in miWideDashSegment (pDrawable=0x8693ce8, pGC=0x8695820,
spanData=0x0,
    pDashOffset=0xbffff2d4, pDashIndex=0xbffff2d0, x1=291, y1=0, x2=859, y2=0,
projectLeft=0,
    projectRight=0, leftFace=0xbffff398, rightFace=0xbffff368) at miwideline.c:1935
        dashIndex = 0
        dashRemain = 1
        pDash = (unsigned char *) 0x8699de8 "\001\001ù·(\236i\b\020"
        L = 568
        l = 0.5
        k = 284
        vertices = {{x = 0, y = -0.5}, {x = 0, y = -0.5}, {x = -0, y = 0.5}, {x
= -0, y = 0.5}}
        saveRight = {x = 0, y = 0}
        saveBottom = {x = 0, y = 0}
        slopes = {{dx = 568, dy = 0, k = 284}, {dx = 0, dy = 568, k = 0}, {dx =
-568, dy = 0,
    k = 284}, {dx = 0, dy = -568, k = 0}}
        left = {{height = 2928, x = 191889408, stepx = 0, signdx = 1, e =
-1210587566,
    dy = 138528800, dx = -1210892060}, {height = 732, x = 9, stepx = 732, signdx
= 0, 
    e = -1210918456, dy = 732, dx = 1835008}}
        right = {{height = 0, x = 0, stepx = 0, signdx = 0, e = 0, dy = 0, dx =
0}, {height = 0,
    x = 0, stepx = 0, signdx = 0, e = 0, dy = 191889408, dx = 191889408}}
        lcapFace = {xa = 0, ya = 0, dx = 0, dy = 0, x = 0, y = 0, k = 0} 
        rcapFace = {xa = 0, ya = 0, dx = 0, dy = 0, x = 0, y = 0, k = 0} 
        nleft = 0
        nright = 0
        h = 0
        y = 141121568
        dy = 0
        dx = 568
        pixel = 2
        LRemain = 568
        r = -nan(0x8000000000000)
        rdx = 0.5
        rdy = 0  
        dashDx = -nan(0x8000000000000)
        dashDy = -nan(0x8000000000000)
        saveK = 0
        first = 1
        lcenterx = 291
        lcentery = 0  
        rcenterx = 0  
        rcentery = 0  
        fgPixel = 0   
        bgPixel = 1   
#1  0x081806d4 in miWideDash (pDrawable=0x8693ce8, pGC=0x8695820, mode=0, npt=2,
pPts=0x8693f1c)
    at miwideline.c:2132
        x1 = 291
        y1 = 0  
        x2 = 859
        y2 = 0  
        pixel = 0
        projectLeft = 0
        projectRight = 0
        leftFace = {xa = 3.8378953086048747e-268, ya = -1.9970588997419387, dx =
138300809,
  dy = 141121568, x = 141114600, y = 0, k = 0}
        rightFace = {xa = 0, ya = 0, dx = 0, dy = 0, x = 0, y = 0, k =
6.9719897725517587e-316}
        prevRightFace = {xa = 0, ya = 0, dx = 0, dy = 0, x = 0, y = 0, k = 0}
        firstFace = {xa = 0, ya = 0, dx = 0, dy = 0, x = 0, y = 0, k = 0}
        first = 1
        dashIndex = 0
        dashOffset = 0
        prevDashIndex = 0
        spanDataRec = {fgGroup = {size = 113, count = 936000, group = 0x0, ymin
= 0, ymax = 0},
  bgGroup = {size = 0, count = 0, group = 0x0, ymin = 0, ymax = 0}}
        spanData = 0x0
        somethingDrawn = 1
        selfJoin = 0
        endIsFg = 0 
        startIsFg = 0
        firstIsFg = 0
        prevIsFg = 0 
#2  0xb7d88bc7 in ?? ()
No symbol table info available.
#3  0x08693ce8 in ?? ()
No symbol table info available.
#4  0x08695820 in ?? ()
No symbol table info available.
#5  0x00000000 in ?? ()
No symbol table info available.
#6  0x00000003 in ?? ()
No symbol table info available.
#7  0x08693f1c in ?? ()
No symbol table info available.
#8  0x081c814c in ?? ()
No symbol table info available.
#9  0x086958c4 in ?? ()
No symbol table info available.
#10 0x08695820 in ?? ()
No symbol table info available.
#11 0xbffff448 in ?? ()
No symbol table info available.
#12 0x08167c84 in cwPolylines (pDst=0x1, pGC=0x0, mode=138564184, npt=689,
ppt=0x86964c0)
    at cw_ops.c:258
        pGCPrivate = 0x3
        dst_off_x = 0   
        dst_off_y = 922746880
        pBackingDst = 0x9dc0 
        pBackingGC = 0x9d000000
Previous frame inner to this frame (corrupt stack?)
(gdb) detach
Detaching from program: /usr/x11-default/bin/Xorg, process 23989
(gdb) quit

Script done on Tue Dec 28 17:53:13 2004


Comment 4 Daniel Stone 2007-02-27 01:25:01 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 5 Adam Jackson 2007-11-16 16:42:36 UTC
Filed against the monolith, which is long dead now.  If this is still an issue with modern X, please reopen.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.