regression in X11R7.2?
jamey at minilop.net
Wed Nov 21 12:06:01 PST 2007
-----BEGIN PGP SIGNED MESSAGE-----
On 11/16/07, Jack Howarth <howarth at bromo.msbb.uc.edu> wrote:
> I see the same behavior under Fedora 8. I have any of the four calls
> to XAllocID() in server.c of libxview succeed but a second call will
> fail. The hack is to substitute a call to XAllocIDs to achieve all
> four XAllocID() calls at once and eliminate the need for multiple
> calls to XAllocID(). With this change, the openwin clients no longer
> crash and nmrDraw behaves normally as well.
I'm sorry I didn't notice your mail sooner. I appreciate folks defending
my work, but only the locking assertions are definitively bugs in the
caller. I hadn't seen any other assertions, like this one, fail until
I tested `ico -threads 2`. That actually triggered this same assertion,
but was a correct caller, so I removed the assertion in git about three
weeks ago. The fix isn't in a release yet.
In this case, XView really was broken, though. XAllocID was never safe
to be called multiple times without issuing a request after each call.
Before XCB, calling XAllocID multiple times would have worked most of
the time, but would have failed whenever the client ran out of its batch
of IDs. With XCB, the second and later calls will always fail, until the
SyncHandle macro is invoked.
Anyway, using XAllocIDs is clearer, and will work with all versions of
Xlib. I hope that patch is accepted.
(OMG, I had no idea XAllocID is public in Xlib.h. It totally isn't
thread-safe and makes all sorts of assumptions about how it's called,
and it isn't documented.)
I made the mistake of reading libxview source while trying to answer
this mail. It seems to be in the classic tradition of layers of bad code
built upon more bad code, starting with Xlib. This particular bit should
have just used Xlib's atom cache rather than building its own, and
should have done just about anything besides using XSaveContext to
associate types and private data with atoms. Then it wouldn't have to
allocate XIDs for a strictly client-side resource. </rant>
> On Fri, Nov 16, 2007 at 09:16:11PM +0100, Nicolas Mailhot wrote:
> > Otherwise keep posting on the list till one of the XCB people
> > explain it.
Heh, yeah, that works eventually. :-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the xorg