I ran into something I consider an X server bug today. I first saw it on an Ubuntu system, which prompted me to see if it existed elsewhere. It's present in the server shipped with NetBSD 9.1. It is not present in the one (also X.org) shipped with NetBSD 5.2, nor in the MIT X11R6.4p3 server I still use on older hardware. I don't know whether it's present in more recent versions; the NetBSD 9.1 and Ubuntu (22.04.5 LTS jammy) are the most recent ones I have easy access to at the moment. I've written a tiny test program, so people can try it.
As bugs go, it's relatively minor, but it had me chasing after nonexistent issues for a while. It is that, when a client issues a ChangeGC request trying to set a clip-mask pixmap with 0x2000001a as the pixmap ID (not a valid ID), and no other changes, the invalid ID value in the resulting error is 0 (which is *not* an invalid ID for that field of that request) instead of 0x2000001a. Similar things presumably will happen with various other invalid IDs as well, and likely other variations; that just happens to be how I first saw it and I saw little value in probing the exact envelope of the bug. My test program is on ftp.rodents-montreal.org in /mouse/X/test-err-1.c for interested parties. Just compile it and run it (of course, as with anything you fetch off the net, reading it over first is recommended; it's small). Correct output looks like this error report from Xlib (the serial numbers may vary - this example is from a client built with MIT Xlib and run against an MIT server): X Error of failed request: BadPixmap (invalid Pixmap parameter) Major opcode of failed request: 56 (X_ChangeGC) Resource id in failed request: 0x2000001a Serial number of failed request: 6 Current serial number in output stream: 8 On a buggy server, the error instead has a zero in the resource ID field (this example is the same client run against that Ubuntu server): X Error of failed request: BadPixmap (invalid Pixmap parameter) Major opcode of failed request: 56 (X_ChangeGC) Resource id in failed request: 0x0 Serial number of failed request: 8 Current serial number in output stream: 10 /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML [email protected] / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
