[Xcb] xcb_io.c:378: _XAllocID: Assertion `ret != inval_id' failed

Jamey Sharp jamey at minilop.net
Wed Oct 7 19:39:35 PDT 2009


On Wed, Oct 7, 2009 at 7:02 PM,  <fdsteve at ihug.co.nz> wrote:
> First post from an X newbie - so please go easy on me :)

You're off to a great start then. :-)

>     shminfo->shmseg = XAllocID(dpy);
>     LockDisplay(dpy);
>...
> Is this a bug in XShmAttach? Should LockDisplay() be moved before the
> XAllocId() line...?
> I made and tested a patch with LockDisplay moved before XAllocID and it
> definitely fixed our problem.

Good work! I agree, XShmAttach is busted here.

I've pushed a fix to libXext git. Thanks for the report!

>  I added an assert in XAllocID to try and find the offending caller:
>
>     if( dpy->lock && dpy->lock->mutex )
>         assert( pthread_mutex_lock(dpy->lock->mutex) == EDEADLK );

I wish we could print a warning when this condition fails, but I don't
think it'll work portably. I'd be tempted to make it an assert, even,
except I learned my lesson from the last time we shipped an assertion in
libX11 to catch buggy callers. :-/

Jamey


More information about the Xcb mailing list