Strange libXrender behaviour on Solaris10/SPARC

Nicolai Stange m222086 at kim.cis.zmaw.de
Wed Nov 10 04:16:48 PST 2010


Hi everybody,

after installing gtk-engines the problem occured again (and thus, the
opensolaris patches Alan pointed me to did not solve the problem).

However I did some further investigation with xscope and gdb and tracked
it down.  The setup the problem occurs in: I'm running mozilla on
Solaris10/SPARC with gtk-engines (clearlooks) through 'ssh -X' with a
local X server on Linux/x86_64 (Debian Lenny).

It is actually a problem with the xorg-server. When s client calls
XRenderCreateLinearGradient on SPARC, this request and a following
GetInputFocus get transmitted properly (MSB first) over the wire.  The
xorg-server on Linux/x86_64 then converts the big endian request to
little endian and while doing so, it errorneously overwrites the
following GetInputFocus-request.
The problem is in render.c:
static void swapStops(void *stuff, int num)
{
    int i, n;
    CARD32 *stops;
    CARD16 *colors;
    stops = (CARD32 *)(stuff);
    for (i = 0; i < num; ++i) {
        swapl(stops, n);
        ++stops;
    }
    colors = (CARD16 *)(stops);
    for (i = 0; i < 4*num; ++i) {
        swaps(stops, n);
        ++stops;
    }
}

When converting the colors, not stops but colors should be incremented:
static void swapStops(void *stuff, int num)
{
    int i, n;
    CARD32 *stops;
    CARD16 *colors;
    stops = (CARD32 *)(stuff);
    for (i = 0; i < num; ++i) {
        swapl(stops, n);
        ++stops;
    }
    colors = (CARD16 *)(stops);
    for (i = 0; i < 4*num; ++i) {
        swaps(colors, n);
        ++colors;
    }
}


Just for completeness: Through xscope it looks like this:
259.33: Client 2 -->   56 bytes
                     Request (fd 8): 8d 22 00 0d 00 20 00 e9 00 00 00 00 00 00
00 00 00 00 00 00 00 19 00 00 00 00 00 02 00 00 00 00 00 01 00 00 ed ed ec ec
eb eb ff ff e4 e4 e3 72 e2 01 ff ff
         ............REQUEST: RenderRequest
               RENDERREQUEST: RenderCreateLinearGradient
             sequence number: 0000115c
              request length: 000d
                     picture: PICTURE 002000e9
                          p1: POINT    0.00,    0.00
                          p2: POINT    0.00,   25.00
                   num stops: 00000002
                     Request (fd 8): 2b 20 00 01
         ............REQUEST: GetInputFocus
             sequence number: 0000115d
              request length: 0001
Have 0 need 4
331.91:                                           32 bytes <-- X11 Server 2
                                                       Error (fd 9): 00 10 11
5d 00 20 00 54 00 00 20 4a 00 20 00 e2 00 00 00 00 02 80 02 00 02 80 01 a3 00
00 00 03
                                         ..............ERROR: Length
                                             sequence number: 115d
                                                minor opcode: 0000
                                                major opcode: 20

swapStops overwrites the majorop-Field of the GetInputFocus-Request,
resulting in Request- and Length-errors.
May I expect this to get fixed in 1.7.x, that is Debian, too?

Best Regards

Nicolai



More information about the xorg mailing list