[8254] in Athena Bugs
RT X server bug
daemon@ATHENA.MIT.EDU (kkkken@Athena.mit.edu)
Mon Sep 23 12:39:48 1991
From: kkkken@Athena.mit.edu
Date: Mon, 23 Sep 91 12:40:09 -0400
To: bugs@Athena.mit.edu
Cc: kkkken@Athena.mit.edu, web@Athena.mit.edu
I'm using a public RT (M16-034-10) and the following short program
demonstrates a somewhat-nasty RT server bug.
If you do an XDrawRectangle followed by XDrawString, and have set line
attributes to width=2, LineSolid, CapButt, JoinBevel, the text comes
out very strange. Background and foreground are reversed, and there's
a solid box around it (that looks dword-aligned in video memory or
something.. the size of the box is variable.)
I've got a simple test program that demonstrates it clearly... look at
/mit/kkkken/src/rtxbug/rtxbug.c ... it's neat (and built for RT, in
/mit/kkkken/src/rtxbug/rtxbug). For convenience, here's the code:
#include <X11/Xlib.h>
main()
{
Display *dpy = XOpenDisplay(0);
int screen = DefaultScreen(dpy);
Window win = XCreateSimpleWindow(dpy, RootWindow(dpy, screen),
100, 100, 300, 300, 3,
BlackPixel(dpy, screen),
WhitePixel(dpy, screen));
GC gc = XCreateGC (dpy, win, 0, 0);
XFontStruct *font = XLoadQueryFont (dpy, "-*-new*-bold-i-*--24*");
XEvent event;
int n;
XSelectInput (dpy, win, ExposureMask);
XMapWindow (dpy, win);
XSetFont (dpy, gc, font->fid);
XSetLineAttributes(dpy, gc, 2, LineSolid, CapButt, JoinBevel);
do {
XNextEvent (dpy, &event);
if (event.type == Expose) {
XClearWindow (dpy, win);
for (n = 0; n < 3; n++) {
XDrawRectangle (dpy, win, gc, n*80 + 10, 30, 60, 40);
XDrawString (dpy, win, gc, n*80 + 13, 30 + font->ascent + 10, "A", 1);
}
}
} while (1);
}
I spent a fair amount of time making this bug repeatable... please let
me know if anyone will ever try to track it down. Thanks.
Kenneth J. Duda
MIT Network Services
Member, Student Information Processing Board
<kkkken@mit.edu>