during investigation of Sun's bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373 I've found that the cause of the problem is in XCB, not in Sun's code. I've developed the small test to demonstrate the problem. The test is very simple: it calls LockDisplay() and _XReply(), in usual situation it hangs because there is no replies, but on in bad it throws the assertion. To reproduce the problem you need to build the test on platform which doesn't have xcb and then run it on a platform with xcb.
Here is the test (made from source of Xinerama by removing most of the code):
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/Xos.h>
#include <X11/Xutil.h>
#include "Xext.h" /* in ../include */
#include "extutil.h" /* in ../include */
#include "panoramiXext.h"
#include "panoramiXproto.h" /* in ../include */
during investigation of Sun's bug http:// bugs.sun. com/bugdatabase /view_bug. do?bug_ id=6532373 I've found that the cause of the problem is in XCB, not in Sun's code. I've developed the small test to demonstrate the problem. The test is very simple: it calls LockDisplay() and _XReply(), in usual situation it hangs because there is no replies, but on in bad it throws the assertion. To reproduce the problem you need to build the test on platform which doesn't have xcb and then run it on a platform with xcb.
Here is the test (made from source of Xinerama by removing most of the code):
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/Xos.h>
#include <X11/Xutil.h>
#include "Xext.h" /* in ../include */
#include "extutil.h" /* in ../include */
#include "panoramiXext.h"
#include "panoramiXproto.h" /* in ../include */
#include <stdio.h>
static XExtensionInfo _panoramiX_ ext_info_ data; ext_info_ data; extension_ name = PANORAMIX_ PROTOCOL_ NAME;
static XExtensionInfo *panoramiX_ext_info = &_panoramiX_
static /* const */ char *panoramiX_
#define PanoramiXCheckE xtension( dpy,i,val) \ nsion (dpy, i, panoramiX_ extension_ name, val) CheckExtension( dpy,i) \ ckExtension (dpy, i, panoramiX_ extension_ name)
XextCheckExte
#define PanoramiXSimple
XextSimpleChe
static int close_display(); extension_ hooks = { FIND_DISPLAY (find_display, panoramiX_ext_info,
panoramiX_ extension_ name,
&panoramiX_ extension_ hooks,
0, NULL) CLOSE_DISPLAY (close_display, panoramiX_ext_info)
static /* const */ XExtensionHooks panoramiX_
NULL, /* create_gc */
NULL, /* copy_gc */
NULL, /* flush_gc */
NULL, /* free_gc */
NULL, /* create_font */
NULL, /* free_font */
close_display, /* close_display */
NULL, /* wire_to_event */
NULL, /* event_to_wire */
NULL, /* error */
NULL, /* error_string */
};
static XEXT_GENERATE_
static XEXT_GENERATE_
Status XPanoramiXQuery Version( ueryVersionRepl y rep; VersionReq *req; */
Display *dpy,
int *major_versionp,
int *minor_versionp
)
{
/* XExtDisplayInfo *info = find_display (dpy); */
xPanoramiXQ
/* xPanoramiXQuery
/* PanoramiXCheckE xtension (dpy, info, 0); */
LockDisplay (dpy); Version, req); */ >major_ opcode; */ eqType = X_PanoramiXQuer yVersion; */ MAJOR_VERSION; */ MINOR_VERSION; */
UnlockDisplay (dpy);
/* GetReq (PanoramiXQuery
/* req->reqType = info->codes-
/* req->panoramiXR
/* req->clientMajor = PANORAMIX_
/* req->clientMinor = PANORAMIX_
if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
SyncHandle ();
return 0;
}
*major_versionp = rep.majorVersion;
*minor_versionp = rep.minorVersion;
UnlockDisplay (dpy);
SyncHandle ();
return 1;
}
int main(int argc, char **argv)
{
Display *display;
int major_version;
int minor_version;
char *display_name = NULL; display_ name)) == NULL)
fprintf( stderr, "Couldn't open %s\n", XDisplayName( display_ name));
if ((display = XOpenDisplay(
{
return -1;
}
XPanoramiXQ ueryVersion( display, &major_version, &minor_version);
return 0;
}