From: Joerg Czeranski (injc@verleihnix.rz.tu-clausthal.de)
Date: 09/09/93


From: injc@verleihnix.rz.tu-clausthal.de (Joerg Czeranski)
Subject: bug in XFree 1.3 (XDrawArc)
Date: Thu, 9 Sep 1993 21:47:38 GMT

I have found a bug in the XDrawArc-routine of XFree 1.3.
Whenever I draw an arc of some specific size (and position?),
the X server freezes - for 45 seconds on a 386-40, only a short time
on a 486-33. Even the mouse pointer cannot be moved.
The problem appears on a Hercules card as well as on VGA.

This is a short (and dirty) program, that demonstrates the bug:

=================== bite here ===================
#include <X11/Xlib.h>

int main()
{
    Display *display;
    int screen, xid;
    display = XOpenDisplay("");
    screen = DefaultScreen(display);
    xid = XCreateWindow(display, RootWindow(display, screen),
        0, 0, 300, 170, 0, DefaultDepth(display, screen),
        InputOutput, CopyFromParent, 0, 0);
    XDrawArc(display, xid, XCreateGC(display, xid, 0, 0),
        -409, -1113, 3576, 2358, 0, 64 * 360);
    XFlush(display);
    return 0;
}
=================== bite here ===================

If is too fast, just add a for(i=0;i<20;i++) around the
XDrawArc :-).

BTW, I have the slight feeling, that the circle is not drawn exactly
with the specified width/height but maybe one pixel too wide.
(But I will have to test around a bit further.)

joerg